diff --git a/src/GUI/IntelliInputDialog.cpp b/src/GUI/IntelliInputDialog.cpp new file mode 100644 index 0000000..1e35545 --- /dev/null +++ b/src/GUI/IntelliInputDialog.cpp @@ -0,0 +1,45 @@ +#include "IntelliInputDialog.h" + +IntelliInputDialog::IntelliInputDialog() +{ + setValuesOfPalette(); +} + +void IntelliInputDialog::Input(){ + QDialog* Dialog = new QDialog(); + QGridLayout* Layout = new QGridLayout(); + QDialogButtonBox* ButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + + QPushButton* Button = new QPushButton(); + Button->setFixedSize(Buttonsize); + + QPushButton* okButton = ButtonBox->button(QDialogButtonBox::Ok); + okButton->setAutoDefault(false); + okButton->setDefault(false); + + QPushButton* cancelButton = ButtonBox->button(QDialogButtonBox::Cancel); + cancelButton->setAutoDefault(false); + cancelButton->setDefault(false); + + Button->setPalette(Palette); + okButton->setPalette(Palette); + cancelButton->setPalette(Palette); + + Layout->addWidget(Button); + Layout->addWidget(ButtonBox); + Dialog->setLayout(Layout); + Dialog->setStyleSheet("background-color:rgb(64,64,64)"); + connect(okButton, SIGNAL(clicked()),Dialog,SLOT(slotCloseEvent())); +} + +void IntelliInputDialog::setValuesOfPalette(){ + Palette.setBrush(QPalette::HighlightedText, QColor(200, 10, 10)); + Palette.setBrush(QPalette::Highlight, QColor(100, 5, 5)); + Palette.setBrush(QPalette::ButtonText, QColor(255, 255, 255)); + Palette.setBrush(QPalette::Button, QColor(64, 64, 64)); + Palette.setBrush(QPalette::Window, QColor(64, 64, 64)); + Palette.setBrush(QPalette::WindowText, QColor(255, 255, 255)); + Palette.setBrush(QPalette::PlaceholderText, QColor(255, 255, 255)); + Palette.setBrush(QPalette::ToolTipText, QColor(255, 255, 255)); + Palette.setBrush(QPalette::Text, QColor(255, 255, 255)); +} diff --git a/src/GUI/IntelliInputDialog.h b/src/GUI/IntelliInputDialog.h new file mode 100644 index 0000000..49af2b5 --- /dev/null +++ b/src/GUI/IntelliInputDialog.h @@ -0,0 +1,25 @@ +#ifndef INTELLIINPUTDIALOG_H +#define INTELLIINPUTDIALOG_H + +#include + +#include "IntelliPhotoGui.h" + +class IntelliInputDialog +{ +public: + IntelliInputDialog(); + + void Input(); + +private slots: + void slotCloseEvent(); + +private: + IntelliPhotoGui* DummyGui; + const QSize Buttonsize = QSize(35,35); + QPalette Palette; + void setValuesOfPalette(); +}; + +#endif // INTELLIINPUTDIALOG_H diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index 17b02c1..9f3b4b4 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -73,10 +73,9 @@ void IntelliPhotoGui::slotCreateNewLayer(){ // "New Layer" is the title of the window // the next tr is the text to display // Define the standard Value, min, max, step and ok button - QInputDialog Input; - Input.setPalette(Palette); - int width = Input.getInt(this, tr("New Layer"), + + /*int width = QInputDialog::getInt(this, tr("New Layer"), tr("Width:"), 200,1, 500, 1, &ok1); @@ -87,7 +86,7 @@ void IntelliPhotoGui::slotCreateNewLayer(){ if (ok1&&ok2){ paintingArea->addLayer(width,height,0,0); UpdateGui(); - } + }*/ } // Opens a dialog that allows the user to delete a Layer @@ -689,7 +688,6 @@ void IntelliPhotoGui::createGui(){ ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize*2)); // set gui elements - mainLayout->addWidget(paintingArea,1,1,20,1); mainLayout->addWidget(CircleButton,1,2,1,1); mainLayout->addWidget(FloodFillButton,1,3,1,1); @@ -717,7 +715,7 @@ void IntelliPhotoGui::setIntelliStyle(){ Palette.setBrush(QPalette::Highlight, QColor(100, 5, 5)); Palette.setBrush(QPalette::ButtonText, QColor(255, 255, 255)); Palette.setBrush(QPalette::Button, QColor(64, 64, 64)); - Palette.setBrush(QPalette::Window, QColor(0, 0, 0)); + Palette.setBrush(QPalette::Window, QColor(64, 64, 64)); Palette.setBrush(QPalette::WindowText, QColor(255, 255, 255)); Palette.setBrush(QPalette::PlaceholderText, QColor(255, 255, 255)); Palette.setBrush(QPalette::ToolTipText, QColor(255, 255, 255)); diff --git a/src/IntelliPhoto.pro b/src/IntelliPhoto.pro index 13b6975..f3c669a 100644 --- a/src/IntelliPhoto.pro +++ b/src/IntelliPhoto.pro @@ -16,6 +16,7 @@ DEFINES += QT_DEPRECATED_WARNINGS #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ + GUI/IntelliInputDialog.cpp \ GUI/IntelliPhotoGui.cpp \ Image/IntelliImage.cpp \ Image/IntelliRasterImage.cpp \ @@ -36,6 +37,7 @@ SOURCES += \ main.cpp HEADERS += \ + GUI/IntelliInputDialog.h \ GUI/IntelliPhotoGui.h \ Image/IntelliImage.h \ Image/IntelliRasterImage.h \