mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-16 21:30:31 +02:00
Dummy Gui
This commit is contained in:
5
src/Bilder.qrc
Normal file
5
src/Bilder.qrc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/Icons/Buttons">
|
||||||
|
<file>icons/icon.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
// ---------- IntelliPhotoGui.cpp ----------
|
// ---------- IntelliPhotoGui.cpp ----------
|
||||||
|
|
||||||
#include <QtWidgets>
|
|
||||||
#include <QPixmap>
|
|
||||||
|
|
||||||
#include "IntelliPhotoGui.h"
|
#include "IntelliPhotoGui.h"
|
||||||
#include "Layer/PaintingArea.h"
|
#include "Layer/PaintingArea.h"
|
||||||
|
|
||||||
@@ -19,7 +16,7 @@ IntelliPhotoGui::IntelliPhotoGui(){
|
|||||||
// Size the app
|
// Size the app
|
||||||
resize(600,600);
|
resize(600,600);
|
||||||
showMaximized();
|
showMaximized();
|
||||||
|
setDefaultToolValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// User tried to close the app
|
// User tried to close the app
|
||||||
@@ -245,6 +242,11 @@ void IntelliPhotoGui::slotAboutDialog(){
|
|||||||
tr("<p><b>IntelliPhoto</b>Pretty basic editor.</p>"));
|
tr("<p><b>IntelliPhoto</b>Pretty basic editor.</p>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IntelliPhotoGui::slotEnterPressed(){
|
||||||
|
QString string = EditLineWidth->text();
|
||||||
|
paintingArea->Toolsettings.setLineWidth(string.toInt());
|
||||||
|
}
|
||||||
|
|
||||||
// Define menu actions that call functions
|
// Define menu actions that call functions
|
||||||
void IntelliPhotoGui::createActions(){
|
void IntelliPhotoGui::createActions(){
|
||||||
// Get a list of the supported file formats
|
// Get a list of the supported file formats
|
||||||
@@ -361,6 +363,9 @@ void IntelliPhotoGui::createActions(){
|
|||||||
// Create about Qt action and tie to IntelliPhotoGui::aboutQt()
|
// Create about Qt action and tie to IntelliPhotoGui::aboutQt()
|
||||||
actionAboutQtDialog = new QAction(tr("About &Qt"), this);
|
actionAboutQtDialog = new QAction(tr("About &Qt"), this);
|
||||||
connect(actionAboutQtDialog, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
|
connect(actionAboutQtDialog, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
|
||||||
|
|
||||||
|
actionPressEnter = new QAction();
|
||||||
|
connect(EditLineWidth, SIGNAL(returnPressed()), this, SLOT(slotEnterPressed()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the menubar
|
// Create the menubar
|
||||||
@@ -436,11 +441,81 @@ void IntelliPhotoGui::createGui(){
|
|||||||
|
|
||||||
// create Gui elements
|
// create Gui elements
|
||||||
paintingArea = new PaintingArea();
|
paintingArea = new PaintingArea();
|
||||||
Push
|
|
||||||
|
QPixmap p(":/Icons/Buttons/icons/icon.png");
|
||||||
|
|
||||||
|
CircleButton = new QPushButton();
|
||||||
|
CircleButton->setFixedSize(Buttonsize);
|
||||||
|
CircleButton->setIcon(p);
|
||||||
|
CircleButton->setIconSize(Buttonsize);
|
||||||
|
|
||||||
|
FloodFillButton = new QPushButton();
|
||||||
|
FloodFillButton->setFixedSize(Buttonsize);
|
||||||
|
FloodFillButton->setIcon(p);
|
||||||
|
FloodFillButton->setIconSize(Buttonsize);
|
||||||
|
|
||||||
|
LineButton = new QPushButton();
|
||||||
|
LineButton->setFixedSize(Buttonsize);
|
||||||
|
LineButton->setIcon(p);
|
||||||
|
LineButton->setIconSize(Buttonsize);
|
||||||
|
|
||||||
|
PenButton = new QPushButton();
|
||||||
|
PenButton->setFixedSize(Buttonsize);
|
||||||
|
PenButton->setIcon(p);
|
||||||
|
PenButton->setIconSize(Buttonsize);
|
||||||
|
|
||||||
|
PlainButton = new QPushButton();
|
||||||
|
PlainButton->setFixedSize(Buttonsize);
|
||||||
|
PlainButton->setIcon(p);
|
||||||
|
PlainButton->setIconSize(Buttonsize);
|
||||||
|
|
||||||
|
PolygonButton = new QPushButton();
|
||||||
|
PolygonButton->setFixedSize(Buttonsize);
|
||||||
|
PolygonButton->setIcon(p);
|
||||||
|
PolygonButton->setIconSize(Buttonsize);
|
||||||
|
|
||||||
|
RectangleButton = new QPushButton();
|
||||||
|
RectangleButton->setFixedSize(Buttonsize);
|
||||||
|
RectangleButton->setIcon(p);
|
||||||
|
RectangleButton->setIconSize(Buttonsize);
|
||||||
|
|
||||||
|
WidthLine = new QLabel();
|
||||||
|
WidthLine->setText("Width");
|
||||||
|
WidthLine->setFixedSize(QSize(100,20));
|
||||||
|
|
||||||
|
EditLineWidth = new QLineEdit();
|
||||||
|
EditLineWidth->setFixedSize(QSize(50,20));
|
||||||
|
EditLineWidth->setText("5");
|
||||||
|
ValidatorLineWidth = new QIntValidator();
|
||||||
|
ValidatorLineWidth->setTop(50);
|
||||||
|
ValidatorLineWidth->setBottom(1);
|
||||||
|
EditLineWidth->setValidator(ValidatorLineWidth);
|
||||||
|
|
||||||
|
innerAlphaLine = new QLabel();
|
||||||
|
innerAlphaLine->setText("Inner Alpha");
|
||||||
|
innerAlphaLine->setFixedSize(QSize(100,20));
|
||||||
|
|
||||||
|
EditLineInnerAlpha = new QLineEdit();
|
||||||
|
EditLineInnerAlpha->setFixedSize(QSize(50,20));
|
||||||
|
EditLineInnerAlpha->setText("255");
|
||||||
|
ValidatorInnerAlpha = new QIntValidator();
|
||||||
|
ValidatorInnerAlpha->setTop(255);
|
||||||
|
ValidatorInnerAlpha->setBottom(0);
|
||||||
|
EditLineInnerAlpha->setValidator(ValidatorInnerAlpha);
|
||||||
|
|
||||||
// set gui elements
|
// set gui elements
|
||||||
mainLayout->addWidget(paintingArea,1,1,10,10);
|
mainLayout->addWidget(paintingArea,1,1,20,1);
|
||||||
mainLayout->addWiget();
|
mainLayout->addWidget(CircleButton,1,2,1,1);
|
||||||
|
mainLayout->addWidget(FloodFillButton,2,2,1,1);
|
||||||
|
mainLayout->addWidget(LineButton,3,2,1,1);
|
||||||
|
mainLayout->addWidget(PenButton,4,2,1,1);
|
||||||
|
mainLayout->addWidget(PlainButton,5,2,1,1);
|
||||||
|
mainLayout->addWidget(PolygonButton,6,2,1,1);
|
||||||
|
mainLayout->addWidget(RectangleButton,7,2,1,1);
|
||||||
|
mainLayout->addWidget(WidthLine,8,2,1,1);
|
||||||
|
mainLayout->addWidget(EditLineWidth,9,2,1,1);
|
||||||
|
mainLayout->addWidget(innerAlphaLine,10,2,1,1);
|
||||||
|
mainLayout->addWidget(EditLineInnerAlpha,11,2,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntelliPhotoGui::setIntelliStyle(){
|
void IntelliPhotoGui::setIntelliStyle(){
|
||||||
@@ -499,3 +574,7 @@ bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat){
|
|||||||
return paintingArea->save(fileName, fileFormat.constData());
|
return paintingArea->save(fileName, fileFormat.constData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IntelliPhotoGui::setDefaultToolValue(){
|
||||||
|
slotEnterPressed();
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#ifndef IntelliPhotoGui_H
|
#ifndef IntelliPhotoGui_H
|
||||||
#define IntelliPhotoGui_H
|
#define IntelliPhotoGui_H
|
||||||
|
|
||||||
|
#include <QtWidgets>
|
||||||
|
#include <QPixmap>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
@@ -69,6 +71,8 @@ void slotCreateFloodFillTool();
|
|||||||
// slots for dialogs
|
// slots for dialogs
|
||||||
void slotAboutDialog();
|
void slotAboutDialog();
|
||||||
|
|
||||||
|
void slotEnterPressed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Will tie user actions to functions
|
// Will tie user actions to functions
|
||||||
void createActions();
|
void createActions();
|
||||||
@@ -83,10 +87,25 @@ bool maybeSave();
|
|||||||
// Opens the Save dialog and saves
|
// Opens the Save dialog and saves
|
||||||
bool saveFile(const QByteArray &fileFormat);
|
bool saveFile(const QByteArray &fileFormat);
|
||||||
|
|
||||||
|
void setDefaultToolValue();
|
||||||
|
|
||||||
// What we'll draw on
|
// What we'll draw on
|
||||||
PaintingArea* paintingArea;
|
PaintingArea* paintingArea;
|
||||||
|
|
||||||
QPushButton* PushButton;
|
const QSize Buttonsize = QSize(50,50);
|
||||||
|
QPushButton* CircleButton;
|
||||||
|
QPushButton* FloodFillButton;
|
||||||
|
QPushButton* LineButton;
|
||||||
|
QPushButton* PenButton;
|
||||||
|
QPushButton* PlainButton;
|
||||||
|
QPushButton* PolygonButton;
|
||||||
|
QPushButton* RectangleButton;
|
||||||
|
QLabel* WidthLine;
|
||||||
|
QLabel* innerAlphaLine;
|
||||||
|
QLineEdit* EditLineWidth;
|
||||||
|
QLineEdit* EditLineInnerAlpha;
|
||||||
|
QIntValidator* ValidatorLineWidth;
|
||||||
|
QIntValidator* ValidatorInnerAlpha;
|
||||||
|
|
||||||
// The menu widgets
|
// The menu widgets
|
||||||
QMenu*saveAsMenu;
|
QMenu*saveAsMenu;
|
||||||
@@ -116,6 +135,8 @@ QAction*actionCreateCircleTool;
|
|||||||
QAction*actionCreatePolygonTool;
|
QAction*actionCreatePolygonTool;
|
||||||
QAction*actionCreateFloodFillTool;
|
QAction*actionCreateFloodFillTool;
|
||||||
|
|
||||||
|
QAction*actionPressEnter;
|
||||||
|
|
||||||
// dialog actions
|
// dialog actions
|
||||||
QAction*actionAboutDialog;
|
QAction*actionAboutDialog;
|
||||||
QAction*actionAboutQtDialog;
|
QAction*actionAboutQtDialog;
|
||||||
|
|||||||
@@ -65,3 +65,6 @@ ICON = icon.icns
|
|||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
|
RESOURCES += \
|
||||||
|
Bilder.qrc
|
||||||
|
|||||||
@@ -165,6 +165,8 @@ public:
|
|||||||
|
|
||||||
std::vector<QPoint> getPolygonDataOfRealLayer();
|
std::vector<QPoint> getPolygonDataOfRealLayer();
|
||||||
|
|
||||||
|
IntelliToolsettings Toolsettings;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// Events to handle
|
// Events to handle
|
||||||
/*!
|
/*!
|
||||||
@@ -202,7 +204,6 @@ private:
|
|||||||
|
|
||||||
IntelliTool* Tool;
|
IntelliTool* Tool;
|
||||||
IntelliColorPicker colorPicker;
|
IntelliColorPicker colorPicker;
|
||||||
IntelliToolsettings Toolsettings;
|
|
||||||
|
|
||||||
std::vector<LayerObject> layerBundle;
|
std::vector<LayerObject> layerBundle;
|
||||||
int activeLayer=-1;
|
int activeLayer=-1;
|
||||||
|
|||||||
Reference in New Issue
Block a user