Skip to content

Commit

Permalink
regmap: style updates
Browse files Browse the repository at this point in the history
Signed-off-by: IonutMuthi <[email protected]>
  • Loading branch information
IonutMuthi authored and AlexandraTrifan committed Nov 8, 2024
1 parent c415ef8 commit 657278a
Show file tree
Hide file tree
Showing 20 changed files with 183 additions and 403 deletions.
7 changes: 7 additions & 0 deletions gui/style/qss/properties/label/menuBig.qss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
QLabel[&&property&&=true] {
font-weight: 700;
font-size: &font_size_2&;
}
QLabel[&&property&&=true]:disabled {
color: grey;
}
2 changes: 2 additions & 0 deletions plugins/pqm/src/pqmdatalogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,5 @@ void PqmDataLogger::createHeader()
qWarning(CAT_PQMLOG) << m_filePath << "cannot be opened!";
}
}

#include "moc_pqmdatalogger.cpp"
12 changes: 9 additions & 3 deletions plugins/regmap/src/deviceregistermap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@
#include <QPushButton>
#include <qboxlayout.h>
#include <qcheckbox.h>
#include <style.h>

#include <src/readwrite/fileregisterwritestrategy.hpp>
#include <src/recyclerview/registermaptable.hpp>
#include <utils.h>

#include "style_properties.h"

using namespace scopy;
using namespace regmap;

Expand All @@ -74,11 +77,12 @@ DeviceRegisterMap::DeviceRegisterMap(RegisterMapTemplate *registerMapTemplate, R
tool->bottomCentral()->setVisible(true);
layout->addWidget(tool);

RegmapStyleHelper::DeviceRegisterMap(this);
Style::setBackgroundColor(this, Style::getAttribute(json::theme::interactive_primary_disabled));

initSettings();

registerController = new RegisterController(this);
Style::setStyle(registerController, style::properties::regmap::registercontroller, true, true);

QWidget *controllerWidget = new QWidget(this);
QHBoxLayout *controllerLayout = new QHBoxLayout(controllerWidget);
Expand All @@ -103,7 +107,8 @@ DeviceRegisterMap::DeviceRegisterMap(RegisterMapTemplate *registerMapTemplate, R
tableHeadWidget->setLayout(tableHeadWidgetLayout);

QWidget *registerTableHead = new QWidget(tableHeadWidget);
registerTableHead->setStyleSheet(RegmapStyleHelper::FrameWidgetStyle());
Style::setBackgroundColor(registerTableHead,
Style::getAttribute(json::theme::interactive_subtle_disabled));

QHBoxLayout *registerTableHeadLayout = new QHBoxLayout(registerTableHead);
registerTableHeadLayout->setSpacing(0);
Expand All @@ -114,7 +119,8 @@ DeviceRegisterMap::DeviceRegisterMap(RegisterMapTemplate *registerMapTemplate, R
registerTableHead->setFixedWidth(180);

QWidget *colBitCount = new QWidget(tableHeadWidget);
colBitCount->setStyleSheet(RegmapStyleHelper::FrameWidgetStyle());
Style::setBackgroundColor(colBitCount, Style::getAttribute(json::theme::interactive_subtle_disabled));

QHBoxLayout *tableHead = new QHBoxLayout(colBitCount);
colBitCount->setLayout(tableHead);

Expand Down
4 changes: 3 additions & 1 deletion plugins/regmap/src/recyclerview/recyclerview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <regmapstylehelper.hpp>

#include <src/verticalscrollarea.hpp>
#include "style_properties.h"
#include <style.h>

using namespace scopy::regmap;

Expand Down Expand Up @@ -60,7 +62,7 @@ RecyclerView::RecyclerView(QList<int> *widgets, QWidget *parent)
slider->setInvertedAppearance(true);
slider->setInvertedControls(true);
slider->setFixedWidth(8);
slider->setStyleSheet(RegmapStyleHelper::sliderStyle());
Style::setStyle(slider, style::properties::regmap::regmapSlider);

QObject::connect(m_scrollArea->verticalScrollBar(), &QAbstractSlider::valueChanged, this, [=](int value) {
if(value == m_scrollArea->verticalScrollBar()->minimum()) {
Expand Down
3 changes: 2 additions & 1 deletion plugins/regmap/src/register/registerdetailedwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <QtMath>
#include <menucollapsesection.h>
#include <style.h>
#include <style_properties.h>

using namespace scopy;
using namespace regmap;
Expand All @@ -53,7 +54,7 @@ RegisterDetailedWidget::RegisterDetailedWidget(RegisterModel *regModel, QWidget
regWidth = regModel->getWidth();

QWidget *nameDescriptionWidget = new QWidget(this);
Style::setStyle(nameDescriptionWidget, style::properties::widget::basicComponent, true, true);
Style::setBackgroundColor(nameDescriptionWidget, Style::getAttribute(json::theme::interactive_subtle_disabled));
QHBoxLayout *nameDescriptionLayout = new QHBoxLayout(nameDescriptionWidget);
nameDescriptionWidget->setLayout(nameDescriptionLayout);
QLabel *nameLabel = new QLabel("Name: " + regModel->getName(), this);
Expand Down
11 changes: 8 additions & 3 deletions plugins/regmap/src/registercontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <titlespinbox.hpp>
#include <utils.h>
#include <style.h>
#include "style_properties.h"

using namespace scopy;
using namespace regmap;
Expand Down Expand Up @@ -82,6 +83,7 @@ RegisterController::RegisterController(QWidget *parent)

readWidgetLayout->addWidget(readButton, 1, Qt::AlignRight);

Style::setStyle(readWidget, style::properties::regmap::registercontroller);
QWidget *writeWidget = new QWidget(this);
writeWidget->setFixedHeight(72);
mainLayout->addWidget(writeWidget);
Expand All @@ -104,6 +106,8 @@ RegisterController::RegisterController(QWidget *parent)
writeWidgetLeftLayout->addWidget(regValue);
writeWidgetLayout->addLayout(writeWidgetLeftLayout, 3);

Style::setStyle(regValue, style::properties::regmap::lineEdit);
Style::setStyle(writeWidget, style::properties::regmap::registercontroller);
writeButton = new QPushButton("Write", writeWidget);
// request write on register
QObject::connect(writeButton, &QPushButton::clicked, this, [=]() {
Expand Down Expand Up @@ -158,7 +162,8 @@ void RegisterController::setHasMap(bool hasMap)
QObject::connect(detailedRegisterToggle, &QPushButton::toggled, this,
&RegisterController::toggleDetailedMenu);
writeWidgetLayout->addWidget(detailedRegisterToggle, 0.5, Qt::AlignRight);
RegmapStyleHelper::iconBlueButton(detailedRegisterToggle);
Style::setStyle(detailedRegisterToggle, style::properties::button::squareIconButton, true, true);
detailedRegisterToggle->setFixedSize(32, 32);
}
}

Expand All @@ -170,7 +175,7 @@ void RegisterController::applyStyle()
readButton->setFixedHeight(40);
Style::setStyle(writeButton, style::properties::button::basicButton, true, true);
writeButton->setFixedHeight(40);
valueLabel->setStyleSheet(RegmapStyleHelper::grayLabelStyle());
Style::setStyle(valueLabel, style::properties::label::menuSmall);

setStyleSheet(RegmapStyleHelper::regmapControllerStyle(nullptr));
// setStyleSheet(RegmapStyleHelper::regmapControllerStyle(nullptr));
}
4 changes: 3 additions & 1 deletion plugins/regmap/src/registermapsettingsmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <src/readwrite/fileregisterreadstrategy.hpp>

#include <menusectionwidget.h>
#include <style.h>

using namespace scopy;
using namespace regmap;
Expand All @@ -48,7 +49,8 @@ RegisterMapSettingsMenu::RegisterMapSettingsMenu(QWidget *parent)
layout->setSpacing(10);
setLayout(layout);

header = new MenuHeaderWidget("Settings", QPen(RegmapStyleHelper::getColor("ScopyBlue")), this);
header = new MenuHeaderWidget("Settings", QPen(Style::getAttribute(json::theme::interactive_primary_idle)),
this);

layout->addWidget(header);

Expand Down
4 changes: 3 additions & 1 deletion plugins/regmap/src/registermaptool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <readwrite/fileregisterwritestrategy.hpp>
#include <readwrite/iioregisterreadstrategy.hpp>
#include <readwrite/iioregisterwritestrategy.hpp>
#include <style_properties.h>

using namespace scopy;
using namespace regmap;
Expand Down Expand Up @@ -89,7 +90,8 @@ RegisterMapTool::RegisterMapTool(QWidget *parent)
tool->addWidgetToTopContainerMenuControlHelper(settingsMenu, TTA_RIGHT);

registerDeviceList = new QComboBox(tool->topContainer());
RegmapStyleHelper::comboboxStyle(registerDeviceList);
Style::setStyle(registerDeviceList, style::properties::regmap::deviceComboBox, true, true);
Style::setStyle(registerDeviceList, style::properties::regmap::simpleWidget);
registerDeviceList->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
QObject::connect(registerDeviceList, &QComboBox::currentTextChanged, this,
&RegisterMapTool::updateActiveRegisterMap);
Expand Down
Loading

0 comments on commit 657278a

Please sign in to comment.