mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-17 05:40:31 +02:00
GUI Update 2
This commit is contained in:
@@ -112,12 +112,14 @@ void IntelliPhotoGui::slotChangeDim(){
|
|||||||
// the next tr is the text to display
|
// the next tr is the text to display
|
||||||
// Define the standard Value, min, step and ok button
|
// Define the standard Value, min, step and ok button
|
||||||
int width = IntelliInputDialog::getInt("New Canvas Size", "Width:", 600, 1, 50000 , 1, &ok1);
|
int width = IntelliInputDialog::getInt("New Canvas Size", "Width:", 600, 1, 50000 , 1, &ok1);
|
||||||
|
maxWidth = width;
|
||||||
|
|
||||||
int height = IntelliInputDialog::getInt("New Canvas Size", "Height:", 600, 1, 50000, 1, &ok2);
|
int height = IntelliInputDialog::getInt("New Canvas Size", "Height:", 600, 1, 50000, 1, &ok2);
|
||||||
|
maxHeight = height;
|
||||||
|
|
||||||
// Change dimension
|
// Change dimension
|
||||||
if (ok1&&ok2) {
|
if (ok1&&ok2) {
|
||||||
paintingArea->setLayerDimensions(height,width);
|
paintingArea->setLayerDimensions(width,height);
|
||||||
UpdateGui();
|
UpdateGui();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -381,6 +383,7 @@ void IntelliPhotoGui::createActions(){
|
|||||||
actionChangeDim = new QAction(tr("&Change Dimension"), this);
|
actionChangeDim = new QAction(tr("&Change Dimension"), this);
|
||||||
actionChangeDim->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_X));
|
actionChangeDim->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_X));
|
||||||
connect(actionChangeDim, SIGNAL(triggered()), this, SLOT(slotChangeDim()));
|
connect(actionChangeDim, SIGNAL(triggered()), this, SLOT(slotChangeDim()));
|
||||||
|
connect(dimCanvas, SIGNAL(clicked()), this, SLOT(slotChangeDim()));
|
||||||
|
|
||||||
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));
|
||||||
@@ -598,7 +601,6 @@ void IntelliPhotoGui::createMenus(){
|
|||||||
optionMenu->addSeparator();
|
optionMenu->addSeparator();
|
||||||
optionMenu->addMenu(renderMenu);
|
optionMenu->addMenu(renderMenu);
|
||||||
optionMenu->addAction(actionChangeDim);
|
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);
|
||||||
@@ -622,8 +624,8 @@ void IntelliPhotoGui::createGui(){
|
|||||||
|
|
||||||
// create Gui elements
|
// create Gui elements
|
||||||
// get and set max width and height
|
// get and set max width and height
|
||||||
int maxHeight = IntelliInputDialog::getInt("New Layer", "Height:", 600, 1);
|
maxHeight = IntelliInputDialog::getInt("New Layer", "Height:", 600, 1);
|
||||||
int maxWidth = IntelliInputDialog::getInt("New Layer", "Width:", 600, 1);
|
maxWidth = IntelliInputDialog::getInt("New Layer", "Width:", 600, 1);
|
||||||
paintingArea = new PaintingArea(maxWidth, maxHeight);
|
paintingArea = new PaintingArea(maxWidth, maxHeight);
|
||||||
paintingArea->DummyGui = this;
|
paintingArea->DummyGui = this;
|
||||||
|
|
||||||
@@ -853,4 +855,7 @@ void IntelliPhotoGui::UpdateGui(){
|
|||||||
FirstColorButton->setStyleSheet(string);
|
FirstColorButton->setStyleSheet(string);
|
||||||
string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
|
string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
|
||||||
SecondColorButton->setStyleSheet(string);
|
SecondColorButton->setStyleSheet(string);
|
||||||
|
|
||||||
|
string = QString("%1x%2").arg(maxWidth).arg(maxHeight);
|
||||||
|
dimCanvas->setText(string);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ void slotCreateFloodFillTool();
|
|||||||
void slotAboutDialog();
|
void slotAboutDialog();
|
||||||
|
|
||||||
void slotChangeDim();
|
void slotChangeDim();
|
||||||
void slotGetDim();
|
|
||||||
|
|
||||||
void slotEnterPressed();
|
void slotEnterPressed();
|
||||||
|
|
||||||
@@ -112,6 +111,8 @@ void setDefaultToolValue();
|
|||||||
|
|
||||||
// What we'll draw on
|
// What we'll draw on
|
||||||
PaintingArea* paintingArea;
|
PaintingArea* paintingArea;
|
||||||
|
int maxHeight;
|
||||||
|
int maxWidth;
|
||||||
|
|
||||||
const QSize Buttonsize = QSize(35,35);
|
const QSize Buttonsize = QSize(35,35);
|
||||||
QPixmap preview;
|
QPixmap preview;
|
||||||
@@ -177,7 +178,6 @@ QAction* actionCreateFloodFillTool;
|
|||||||
|
|
||||||
// dimension actions
|
// dimension actions
|
||||||
QAction*actionChangeDim;
|
QAction*actionChangeDim;
|
||||||
QAction*actionGetDim;
|
|
||||||
|
|
||||||
// dialog actions
|
// dialog actions
|
||||||
QAction* actionAboutDialog;
|
QAction* actionAboutDialog;
|
||||||
|
|||||||
Reference in New Issue
Block a user