feat(geometrySpreadsheet): update styling
This commit is contained in:
@@ -81,6 +81,9 @@ GeoSheetMenuBarModeSelection::GeoSheetMenuBarModeSelection(QWidget *parent, Qt::
|
|||||||
: QWidget(parent, f)
|
: QWidget(parent, f)
|
||||||
{
|
{
|
||||||
mainLayout_ = new QHBoxLayout();
|
mainLayout_ = new QHBoxLayout();
|
||||||
|
constexpr int mainMargin = 0;
|
||||||
|
mainLayout_->setContentsMargins(mainMargin,mainMargin,mainMargin,mainMargin);
|
||||||
|
|
||||||
QWidget* buttonBg = new QWidget();
|
QWidget* buttonBg = new QWidget();
|
||||||
buttonBg->setObjectName("GeoSheetMenuBarButtonBg");
|
buttonBg->setObjectName("GeoSheetMenuBarButtonBg");
|
||||||
buttonBg->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
buttonBg->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||||
@@ -90,7 +93,7 @@ GeoSheetMenuBarModeSelection::GeoSheetMenuBarModeSelection(QWidget *parent, Qt::
|
|||||||
R"(
|
R"(
|
||||||
#GeoSheetMenuBarButtonBg
|
#GeoSheetMenuBarButtonBg
|
||||||
{
|
{
|
||||||
background-color: #383838;
|
background-color: #242424;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,12 +134,22 @@ GeometrySpreadsheetMenuBar::GeometrySpreadsheetMenuBar(QWidget *parent, Qt::Wind
|
|||||||
{
|
{
|
||||||
mainLayout_ = new QHBoxLayout();
|
mainLayout_ = new QHBoxLayout();
|
||||||
nodeLabel_ = new QLabel();
|
nodeLabel_ = new QLabel();
|
||||||
mainLayout_->addWidget(nodeLabel_);
|
|
||||||
modeSelection = new GeoSheetMenuBarModeSelection();
|
modeSelection = new GeoSheetMenuBarModeSelection();
|
||||||
|
|
||||||
|
mainLayout_->addWidget(nodeLabel_);
|
||||||
mainLayout_->addStretch();
|
mainLayout_->addStretch();
|
||||||
mainLayout_->addWidget(modeSelection);
|
mainLayout_->addWidget(modeSelection);
|
||||||
|
setProperty("class", "GeometrySpreadsheetMenuBar");
|
||||||
|
setStyleSheet(
|
||||||
|
R"(
|
||||||
|
.GeometrySpreadsheetMenuBar,
|
||||||
|
.GeometrySpreadsheetMenuBar *
|
||||||
|
{
|
||||||
|
background-color: #1B1B1B;
|
||||||
|
}
|
||||||
|
)");
|
||||||
|
|
||||||
const int margins = 0;
|
constexpr int margins = 5;
|
||||||
mainLayout_->setContentsMargins(margins, margins, margins, margins);
|
mainLayout_->setContentsMargins(margins, margins, margins, margins);
|
||||||
|
|
||||||
setLayout(mainLayout_);
|
setLayout(mainLayout_);
|
||||||
@@ -145,5 +158,5 @@ GeometrySpreadsheetMenuBar::GeometrySpreadsheetMenuBar(QWidget *parent, Qt::Wind
|
|||||||
void GeometrySpreadsheetMenuBar::setNode(enzo::nt::OpId opId)
|
void GeometrySpreadsheetMenuBar::setNode(enzo::nt::OpId opId)
|
||||||
{
|
{
|
||||||
enzo::nt::GeometryOperator& geoOp = enzo::nt::nm().getGeoOperator(opId);
|
enzo::nt::GeometryOperator& geoOp = enzo::nt::nm().getGeoOperator(opId);
|
||||||
nodeLabel_->setText("Node: " + QString::fromStdString(geoOp.getLabel()));
|
nodeLabel_->setText("<b>Node: </b>" + QString::fromStdString(geoOp.getLabel()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,10 @@
|
|||||||
#include "Engine/Types.h"
|
#include "Engine/Types.h"
|
||||||
#include <icecream.hpp>
|
#include <icecream.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <qnamespace.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <QBrush>
|
||||||
|
|
||||||
|
|
||||||
GeometrySpreadsheetModel::GeometrySpreadsheetModel(QObject *parent)
|
GeometrySpreadsheetModel::GeometrySpreadsheetModel(QObject *parent)
|
||||||
@@ -111,7 +113,12 @@ QVariant GeometrySpreadsheetModel::data(const QModelIndex &index, int role) cons
|
|||||||
// return QVariant();
|
// return QVariant();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (role == Qt::DisplayRole)
|
if(role == Qt::BackgroundRole && index.column()==0)
|
||||||
|
{
|
||||||
|
return QBrush("#1B1B1B");
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (role == Qt::DisplayRole)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(index.column()==0)
|
if(index.column()==0)
|
||||||
|
|||||||
@@ -14,17 +14,42 @@ GeometrySpreadsheetPanel::GeometrySpreadsheetPanel(QWidget *parent, Qt::WindowFl
|
|||||||
: QWidget(parent, f)
|
: QWidget(parent, f)
|
||||||
{
|
{
|
||||||
mainLayout_ = new QVBoxLayout();
|
mainLayout_ = new QVBoxLayout();
|
||||||
|
mainLayout_->setSpacing(0);
|
||||||
|
|
||||||
|
|
||||||
view_ = new QTreeView(parent);
|
view_ = new QTreeView(parent);
|
||||||
view_->setRootIsDecorated(false);
|
view_->setRootIsDecorated(false);
|
||||||
view_->setAlternatingRowColors(true);
|
view_->setAlternatingRowColors(true);
|
||||||
|
view_->setUniformRowHeights(true); // improves performance
|
||||||
view_->setStyleSheet(R"(
|
view_->setStyleSheet(R"(
|
||||||
QTreeView {
|
QTreeView {
|
||||||
background-color: #282828;
|
background-color: #282828;
|
||||||
alternate-background-color: #242424;
|
alternate-background-color: #242424;
|
||||||
paint-alternating-row-colors-for-empty-area: 1;
|
paint-alternating-row-colors-for-empty-area: 1;
|
||||||
}
|
}
|
||||||
|
QTreeView QScrollBar {
|
||||||
|
background: #1B1B1B;
|
||||||
|
width: 15px;
|
||||||
|
}
|
||||||
|
QTreeView QScrollBar::handle:vertical {
|
||||||
|
background: #282828;
|
||||||
|
min-height: 50px;
|
||||||
|
border-radius: 5px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #2D2D2D;
|
||||||
|
border-style: solid;
|
||||||
|
margin:2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTreeView QScrollBar::add-page:vertical,
|
||||||
|
QTreeView QScrollBar::sub-page:vertical,
|
||||||
|
QTreeView QScrollBar::add-line:vertical,
|
||||||
|
QTreeView QScrollBar::sub-line:vertical
|
||||||
|
{ height: 0px; }
|
||||||
|
|
||||||
|
QHeaderView::section {
|
||||||
|
background-color: #1B1B1B;
|
||||||
|
}
|
||||||
)");
|
)");
|
||||||
view_->setFrameStyle(QFrame::NoFrame);
|
view_->setFrameStyle(QFrame::NoFrame);
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ EnzoUI::EnzoUI()
|
|||||||
|
|
||||||
viewportSplitter_->addWidget(spreadsheetSplitter_);
|
viewportSplitter_->addWidget(spreadsheetSplitter_);
|
||||||
viewportSplitter_->addWidget(networkSplitter_);
|
viewportSplitter_->addWidget(networkSplitter_);
|
||||||
viewportSplitter_->setSizes({100,300});
|
viewportSplitter_->setSizes({100,200});
|
||||||
|
|
||||||
networkSplitter_->addWidget(parametersPanel);
|
networkSplitter_->addWidget(parametersPanel);
|
||||||
networkSplitter_->addWidget(network);
|
networkSplitter_->addWidget(network);
|
||||||
|
|||||||
Reference in New Issue
Block a user