Skip to content

Commit

Permalink
Edited style files for light theme
Browse files Browse the repository at this point in the history
  • Loading branch information
neoneela committed Jul 4, 2024
1 parent fcc0cb0 commit 1ab16b8
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ namespace hal {
QGridLayout* mLayout;
GateLibraryWizard* mWizard;
QList<BooleanFunctionEdit*> mEditFunctions;
QList<QString> mOutputPins;
GateType* mGate = nullptr;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<PinItem*> getPingroups();
std::unique_ptr<GateTypeComponent> setComponents();
Expand Down
47 changes: 45 additions & 2 deletions plugins/gui/resources/stylesheet/light.qss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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";
Expand All @@ -921,7 +942,7 @@ hal--GateLibrarySelection

hal--GateLibrarySelection QLabel
{
background: white;
background: #E0F0FF;
}

hal--GateLibrarySelection QLabel#warningMsg
Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
}
Expand All @@ -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++;
}
}
Expand Down Expand Up @@ -151,15 +153,13 @@ namespace hal

std::unordered_map<std::string, BooleanFunction> BoolWizardPage::getBoolFunctions(){
std::unordered_map<std::string, BooleanFunction> retval;
for(int i = 0; i<mLayout->rowCount(); i++)
for(int i = 0; i<mEditFunctions.length(); i++)
{
QLabel* label = static_cast<QLabel*>(mLayout->itemAtPosition(i, 0)->widget());
BooleanFunctionEdit* lineEdit = static_cast<BooleanFunctionEdit*>(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;
}
Expand Down
27 changes: 7 additions & 20 deletions plugins/gui/src/gatelibrary_management/gatelibrary_wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,6 @@ namespace hal
}
}

void GateLibraryWizard::editGate()
{

}

GateType* GateLibraryWizard::addGate()
{


}

void GateLibraryWizard::setData(GateLibrary *gateLibrary, GateType* gateType)
{
mGateLibrary = gateLibrary;
Expand All @@ -87,9 +76,6 @@ namespace hal

void GateLibraryWizard::accept()
{
/*if(generalInfoPage->isEdit()) editGate();
else addGate();*/

//Convert QStringList to std::set
std::set<GateTypeProperty> properties_set;
for(QString prop : generalInfoPage->getProperties())
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 1ab16b8

Please sign in to comment.