mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-15 21:00:37 +02:00
Merge branch 'canvas' into 'dev'
Canvas See merge request creyd/intelliphoto!47
This commit is contained in:
@@ -14,7 +14,7 @@ IntelliPhotoGui::IntelliPhotoGui(){
|
|||||||
// set style of the gui
|
// set style of the gui
|
||||||
setIntelliStyle();
|
setIntelliStyle();
|
||||||
// Size the app
|
// Size the app
|
||||||
resize(600,600);
|
resize(600,600);
|
||||||
//showMaximized();
|
//showMaximized();
|
||||||
setDefaultToolValue();
|
setDefaultToolValue();
|
||||||
}
|
}
|
||||||
@@ -73,9 +73,9 @@ void IntelliPhotoGui::slotCreateNewRasterLayer(){
|
|||||||
// "New Layer" is the title of the window
|
// "New Layer" is the title of the window
|
||||||
// the next tr is the text to display
|
// the next tr is the text to display
|
||||||
// Define the standard Value, min, max, step and ok button
|
// Define the standard Value, min, max, step and ok button
|
||||||
int width = IntelliInputDialog::getInt("New Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
|
int width = IntelliInputDialog::getInt("New Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
|
||||||
|
|
||||||
int height = IntelliInputDialog::getInt("New Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
|
int height = IntelliInputDialog::getInt("New Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
|
||||||
|
|
||||||
// Create New Layer
|
// Create New Layer
|
||||||
if (ok1&&ok2) {
|
if (ok1&&ok2) {
|
||||||
@@ -103,6 +103,25 @@ void IntelliPhotoGui::slotCreateNewShapedLayer(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Opens a dialog that allows the user to change Dimension
|
||||||
|
void IntelliPhotoGui::slotChangeDim(){
|
||||||
|
// Stores button value
|
||||||
|
bool ok1, ok2;
|
||||||
|
|
||||||
|
// "change Dimension" is the title of the window
|
||||||
|
// the next tr is the text to display
|
||||||
|
// Define the standard Value, min, step and ok button
|
||||||
|
int width = IntelliInputDialog::getInt("New Canvas Size", "Width:", 600, 1, 50000 , 1, &ok1);
|
||||||
|
|
||||||
|
int height = IntelliInputDialog::getInt("New Canvas Size", "Height:", 600, 1, 50000, 1, &ok2);
|
||||||
|
|
||||||
|
// Change dimension
|
||||||
|
if (ok1&&ok2) {
|
||||||
|
paintingArea->setLayerDimensions(height,width);
|
||||||
|
UpdateGui();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Opens a dialog that allows the user to delete a Layer
|
// Opens a dialog that allows the user to delete a Layer
|
||||||
void IntelliPhotoGui::slotDeleteLayer(){
|
void IntelliPhotoGui::slotDeleteLayer(){
|
||||||
|
|
||||||
@@ -264,6 +283,15 @@ void IntelliPhotoGui::slotAboutDialog(){
|
|||||||
tr("<p><b>IntelliPhoto - </b>A Pretty basic editor.</p> <br>Developed by Team 7."));
|
tr("<p><b>IntelliPhoto - </b>A Pretty basic editor.</p> <br>Developed by Team 7."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Open an dialog about the dimensions
|
||||||
|
void IntelliPhotoGui::slotGetDim(){
|
||||||
|
|
||||||
|
// Window dimesnion display
|
||||||
|
QMessageBox::about(this, tr("Dimension"),
|
||||||
|
tr("Width: %1\nHeight: %2").arg(paintingArea->getMaxWidth()).arg(paintingArea->getMaxHeight()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void IntelliPhotoGui::slotEnterPressed(){
|
void IntelliPhotoGui::slotEnterPressed(){
|
||||||
QString string = EditLineWidth->text();
|
QString string = EditLineWidth->text();
|
||||||
if(string.toInt() > 50) {
|
if(string.toInt() > 50) {
|
||||||
@@ -298,7 +326,7 @@ void IntelliPhotoGui::slotSetWidth(){
|
|||||||
|
|
||||||
void IntelliPhotoGui::slotSetInnerAlpha(){
|
void IntelliPhotoGui::slotSetInnerAlpha(){
|
||||||
bool ok1;
|
bool ok1;
|
||||||
int temp = IntelliInputDialog::getInt("Toolsettings", "Width:", 5, 1, 50, 1, &ok1);
|
int temp = IntelliInputDialog::getInt("Toolsettings", "Alpha:", 5, 1, 50, 1, &ok1);
|
||||||
if(ok1) {
|
if(ok1) {
|
||||||
paintingArea->Toolsettings.setInnerAlpha(temp);
|
paintingArea->Toolsettings.setInnerAlpha(temp);
|
||||||
EditLineInnerAlpha->setText(QString("%1").arg(temp));
|
EditLineInnerAlpha->setText(QString("%1").arg(temp));
|
||||||
@@ -359,6 +387,14 @@ void IntelliPhotoGui::createActions(){
|
|||||||
actionDeleteLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_D));
|
actionDeleteLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_D));
|
||||||
connect(actionDeleteLayer, SIGNAL(triggered()), this, SLOT(slotDeleteLayer()));
|
connect(actionDeleteLayer, SIGNAL(triggered()), this, SLOT(slotDeleteLayer()));
|
||||||
|
|
||||||
|
actionChangeDim = new QAction(tr("&Change Dimension"), this);
|
||||||
|
actionChangeDim->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_X));
|
||||||
|
connect(actionChangeDim, SIGNAL(triggered()), this, SLOT(slotChangeDim()));
|
||||||
|
|
||||||
|
actionGetDim = new QAction(tr("&Get Dimension"), this);
|
||||||
|
actionGetDim->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Y));
|
||||||
|
connect(actionGetDim, SIGNAL(triggered()), this, SLOT(slotGetDim()));
|
||||||
|
|
||||||
actionSetActiveLayer = new QAction(tr("&set Active"), this);
|
actionSetActiveLayer = new QAction(tr("&set Active"), this);
|
||||||
actionSetActiveLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_A));
|
actionSetActiveLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_A));
|
||||||
connect(actionSetActiveLayer, SIGNAL(triggered()), this, SLOT(slotSetActiveLayer()));
|
connect(actionSetActiveLayer, SIGNAL(triggered()), this, SLOT(slotSetActiveLayer()));
|
||||||
@@ -515,9 +551,9 @@ void IntelliPhotoGui::createMenus(){
|
|||||||
fileMenu->addAction(actionExit);
|
fileMenu->addAction(actionExit);
|
||||||
|
|
||||||
//Attach all actions to Render Settings
|
//Attach all actions to Render Settings
|
||||||
renderMenu = new QMenu(tr("&Fast Renderer"), this);
|
renderMenu = new QMenu(tr("&Fast Renderer"), this);
|
||||||
renderMenu->addAction(actionUpdateRenderSettingsOn);
|
renderMenu->addAction(actionUpdateRenderSettingsOn);
|
||||||
renderMenu->addAction(actionUpdateRenderSettingsOff);
|
renderMenu->addAction(actionUpdateRenderSettingsOff);
|
||||||
|
|
||||||
//Attach all Layer Creations to Menu
|
//Attach all Layer Creations to Menu
|
||||||
layerCreationMenu = new QMenu(tr("&Create new Layer"), this);
|
layerCreationMenu = new QMenu(tr("&Create new Layer"), this);
|
||||||
@@ -574,6 +610,8 @@ void IntelliPhotoGui::createMenus(){
|
|||||||
optionMenu->addMenu(toolMenu);
|
optionMenu->addMenu(toolMenu);
|
||||||
optionMenu->addSeparator();
|
optionMenu->addSeparator();
|
||||||
optionMenu->addMenu(renderMenu);
|
optionMenu->addMenu(renderMenu);
|
||||||
|
optionMenu->addAction(actionChangeDim);
|
||||||
|
optionMenu->addAction(actionGetDim);
|
||||||
|
|
||||||
// Attach all actions to Help
|
// Attach all actions to Help
|
||||||
helpMenu = new QMenu(tr("&Help"), this);
|
helpMenu = new QMenu(tr("&Help"), this);
|
||||||
@@ -596,7 +634,10 @@ void IntelliPhotoGui::createGui(){
|
|||||||
centralGuiWidget->setLayout(mainLayout);
|
centralGuiWidget->setLayout(mainLayout);
|
||||||
|
|
||||||
// create Gui elements
|
// create Gui elements
|
||||||
paintingArea = new PaintingArea();
|
// get and set max width and height
|
||||||
|
int maxHeight = IntelliInputDialog::getInt("New Layer", "Height:", 600, 1);
|
||||||
|
int maxWidth = IntelliInputDialog::getInt("New Layer", "Width:", 600, 1);
|
||||||
|
paintingArea = new PaintingArea(maxWidth, maxHeight);
|
||||||
paintingArea->DummyGui = this;
|
paintingArea->DummyGui = this;
|
||||||
|
|
||||||
preview = QPixmap(":/Icons/Buttons/icons/circle-tool.svg");
|
preview = QPixmap(":/Icons/Buttons/icons/circle-tool.svg");
|
||||||
|
|||||||
@@ -82,6 +82,9 @@ void slotCreateFloodFillTool();
|
|||||||
|
|
||||||
void slotAboutDialog();
|
void slotAboutDialog();
|
||||||
|
|
||||||
|
void slotChangeDim();
|
||||||
|
void slotGetDim();
|
||||||
|
|
||||||
void slotEnterPressed();
|
void slotEnterPressed();
|
||||||
|
|
||||||
void slotSetWidth();
|
void slotSetWidth();
|
||||||
@@ -165,6 +168,10 @@ QAction* actionCreateCircleTool;
|
|||||||
QAction* actionCreatePolygonTool;
|
QAction* actionCreatePolygonTool;
|
||||||
QAction* actionCreateFloodFillTool;
|
QAction* actionCreateFloodFillTool;
|
||||||
|
|
||||||
|
// dimension actions
|
||||||
|
QAction*actionChangeDim;
|
||||||
|
QAction*actionGetDim;
|
||||||
|
|
||||||
// dialog actions
|
// dialog actions
|
||||||
QAction* actionAboutDialog;
|
QAction* actionAboutDialog;
|
||||||
QAction* actionAboutQtDialog;
|
QAction* actionAboutQtDialog;
|
||||||
|
|||||||
Reference in New Issue
Block a user