From 1ab16b8ae5e25379b99291683ec1e24328bb348d Mon Sep 17 00:00:00 2001 From: tarapn79 Date: Fri, 5 Jul 2024 01:21:50 +0200 Subject: [PATCH] Edited style files for light theme --- .../gatelibrary_pages/bool_wizardpage.h | 1 + .../gatelibrary_wizard.h | 2 - plugins/gui/resources/stylesheet/light.qss | 47 ++++++++++++++++++- .../gatelibrary_pages/bool_wizardpage.cpp | 10 ++-- .../gatelibrary_wizard.cpp | 27 +++-------- 5 files changed, 58 insertions(+), 29 deletions(-) diff --git a/plugins/gui/include/gui/gatelibrary_management/gatelibrary_pages/bool_wizardpage.h b/plugins/gui/include/gui/gatelibrary_management/gatelibrary_pages/bool_wizardpage.h index 914d7fbe88e..45509c6f2b7 100644 --- a/plugins/gui/include/gui/gatelibrary_management/gatelibrary_pages/bool_wizardpage.h +++ b/plugins/gui/include/gui/gatelibrary_management/gatelibrary_pages/bool_wizardpage.h @@ -85,6 +85,7 @@ namespace hal { QGridLayout* mLayout; GateLibraryWizard* mWizard; QList mEditFunctions; + QList mOutputPins; GateType* mGate = nullptr; }; } diff --git a/plugins/gui/include/gui/gatelibrary_management/gatelibrary_wizard.h b/plugins/gui/include/gui/gatelibrary_management/gatelibrary_wizard.h index 2f9f07955b4..bc6fcdd8cf0 100644 --- a/plugins/gui/include/gui/gatelibrary_management/gatelibrary_wizard.h +++ b/plugins/gui/include/gui/gatelibrary_management/gatelibrary_wizard.h @@ -65,8 +65,6 @@ namespace hal GateLibraryWizard(GateLibrary* gateLibrary, GateType* gateType = nullptr, QWidget* parent = nullptr); - void editGate(); - GateType* addGate(); void setData(GateLibrary* gateLibrary, GateType* gateType); QList getPingroups(); std::unique_ptr setComponents(); diff --git a/plugins/gui/resources/stylesheet/light.qss b/plugins/gui/resources/stylesheet/light.qss index ff0f462ef39..9f4b3e0b391 100755 --- a/plugins/gui/resources/stylesheet/light.qss +++ b/plugins/gui/resources/stylesheet/light.qss @@ -278,7 +278,7 @@ QAbstractScrollArea::corner QListWidget { - background-color : rgb(14, 17, 20); + background-color : rgb(224, 240, 255); min-width : 200px; max-width : 200px; } @@ -913,6 +913,27 @@ hal--OpenFileWidget #icon-label margin-top : 220px; } +hal--GateLibraryLabel +{ + background : #E0F0FF; +} + +hal--GateLibraryLabel[isValue="false"] +{ + background : white; + color : #171e22; +} + +hal--GateLibraryLabel[isValue="true"] +{ + background : #E0F0FF; + color : #171e22; + font-family : "Iosevka"; + font-size : 15px; + font-style : "Heavy"; + font-weight : 700; +} + hal--GateLibrarySelection { qproperty-saveIconStyle: "all->#3192C5"; @@ -921,7 +942,7 @@ hal--GateLibrarySelection hal--GateLibrarySelection QLabel { - background: white; + background: #E0F0FF; } hal--GateLibrarySelection QLabel#warningMsg @@ -1467,6 +1488,28 @@ hal--DetailsFrameWidget QPushButton:hover background-color : rgba(220, 220, 220, 1); } +hal--BooleanFunctionEdit +{ + background : #E0F0FF; + color : #222222; + font-family : "Iosevka"; + font-size : 15px; + font-style : "Heavy"; + font-weight : 700; +} + +hal--BooleanFunctionEdit[state="Empty"] +{ + background : #909090; + color : #171e22; +} + +hal--BooleanFunctionEdit[state="Invalid"] +{ + background: #F0C8C0; + color : #802010; +} + hal--GuiPluginManager { qproperty-loadIconPath : ":/icons/insert-plugin"; diff --git a/plugins/gui/src/gatelibrary_management/gatelibrary_pages/bool_wizardpage.cpp b/plugins/gui/src/gatelibrary_management/gatelibrary_pages/bool_wizardpage.cpp index e3398eb795f..972f908f4ba 100644 --- a/plugins/gui/src/gatelibrary_management/gatelibrary_pages/bool_wizardpage.cpp +++ b/plugins/gui/src/gatelibrary_management/gatelibrary_pages/bool_wizardpage.cpp @@ -95,6 +95,7 @@ namespace hal lineEdit->setText(QString::fromStdString(bf.second.to_string())); connect(lineEdit,&BooleanFunctionEdit::stateChanged,this,&BoolWizardPage::handleStateChanged); mEditFunctions.append(lineEdit); + mOutputPins.append(label->text()); boolFuncCnt++; } } @@ -115,6 +116,7 @@ namespace hal mLayout->addWidget(lineEdit, rowCount, 1); connect(lineEdit,&BooleanFunctionEdit::stateChanged,this,&BoolWizardPage::handleStateChanged); mEditFunctions.append(lineEdit); + mOutputPins.append(label->text()); rowCount++; } } @@ -151,15 +153,13 @@ namespace hal std::unordered_map BoolWizardPage::getBoolFunctions(){ std::unordered_map retval; - for(int i = 0; irowCount(); i++) + for(int i = 0; i(mLayout->itemAtPosition(i, 0)->widget()); - BooleanFunctionEdit* lineEdit = static_cast(mLayout->itemAtPosition(i, 1)->widget()); - auto bfres = BooleanFunction::from_string(lineEdit->text().toStdString()); + auto bfres = BooleanFunction::from_string(mEditFunctions[i]->text().toStdString()); if(bfres.is_error()) continue; else - retval.insert({label->text().toStdString(), bfres.get()}); + retval.insert({mOutputPins[i].toStdString(), bfres.get()}); } return retval; } diff --git a/plugins/gui/src/gatelibrary_management/gatelibrary_wizard.cpp b/plugins/gui/src/gatelibrary_management/gatelibrary_wizard.cpp index 49af89eea04..6a864625b67 100644 --- a/plugins/gui/src/gatelibrary_management/gatelibrary_wizard.cpp +++ b/plugins/gui/src/gatelibrary_management/gatelibrary_wizard.cpp @@ -68,17 +68,6 @@ namespace hal } } - void GateLibraryWizard::editGate() - { - - } - - GateType* GateLibraryWizard::addGate() - { - - - } - void GateLibraryWizard::setData(GateLibrary *gateLibrary, GateType* gateType) { mGateLibrary = gateLibrary; @@ -87,9 +76,6 @@ namespace hal void GateLibraryWizard::accept() { - /*if(generalInfoPage->isEdit()) editGate(); - else addGate();*/ - //Convert QStringList to std::set std::set properties_set; for(QString prop : generalInfoPage->getProperties()) @@ -285,28 +271,29 @@ namespace hal else if(properties.contains("latch")) return Latch; else if(properties.contains("c_lut")) return LUT; else if(properties.contains("ram")) return RAM; - else return BoolFunc; + return BoolFunc; case FlipFlop: if(properties.contains("latch")) return Latch; else if(properties.contains("c_lut")) return LUT; else if(properties.contains("ram")) return RAM; - else return State; + return State; case Latch: if(properties.contains("c_lut")) return LUT; else if(properties.contains("ram")) return RAM; - else return State; + return State; case LUT: if(properties.contains("ram")) return RAM; - else return Init; + return Init; case RAM: return RAMPort; case RAMPort: if(properties.contains("ff") || properties.contains("latch")) return State; - else return BoolFunc; + return BoolFunc; case State: if(properties.contains("ff") || properties.contains("latch") || properties.contains("c_lut") || properties.contains("ram")) return Init; - else return BoolFunc; + return BoolFunc; case Init: + if(properties.contains("c_lut")) return -1; return BoolFunc; case BoolFunc: default: