diff --git a/src/Insight/Insight.cpp b/src/Insight/Insight.cpp index 315665b8..29cd07f4 100644 --- a/src/Insight/Insight.cpp +++ b/src/Insight/Insight.cpp @@ -55,6 +55,19 @@ void Insight::startup() { QApplication::setQuitOnLastWindowClosed(true); QApplication::setStyle(new BloomProxyStyle()); + + auto globalStylesheet = QFile( + QString::fromStdString( + Paths::compiledResourcesPath() + "/src/Insight/UserInterfaces/InsightWindow/Stylesheets/Global.qss" + ) + ); + + if (!globalStylesheet.open(QFile::ReadOnly)) { + throw Exception("Failed to open global stylesheet file"); + } + + this->application.setStyleSheet(globalStylesheet.readAll()); + qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); diff --git a/src/Insight/UserInterfaces/InsightWindow/Stylesheets/Global.qss b/src/Insight/UserInterfaces/InsightWindow/Stylesheets/Global.qss new file mode 100644 index 00000000..55a33d11 --- /dev/null +++ b/src/Insight/UserInterfaces/InsightWindow/Stylesheets/Global.qss @@ -0,0 +1,173 @@ +/* + This is an application-wide stylesheet. Common styles for common widgets should reside in here. + */ + +* { + color: #afb1b3; + font-family: 'Ubuntu', sans-serif; + font-size: 14px; +} + +#window-container { + background-color: #373835; +} + +QMenuBar::item { + position: relative; + margin: 0; + top: 0; + padding-top: 0; + padding-bottom: 1px; + padding-right: 4px; + padding-left: 4px; + background-color: transparent; + float: left; + font-size: 14px; + border: none; +} + +QMenuBar::item:pressed { + background-color: #355A80; +} + +QMenuBar { + border: none; + margin: 0; + padding: 0; + min-height: 24px; + background-color: transparent; + spacing: 0; + color: #afb1b3; + font-size: 14px; +} + +QMenu { + margin: 0; + padding: 0; + background-color: #373835; + color: #afb1b3; + border: 1px solid #41423f; + min-width: 200px; + font-size: 14px; +} + +QMenu::item { + padding: 4px 5px 4px 25px; + min-width: 200px; +} + +QMenu::item:selected { + background-color: #355A80; +} + +QMenu::item:disabled { + color: #808484; +} + +QMenu::separator { + border-top: 1px solid #41423f; + height: 1px; +} + +QMenu#help-menu::separator { + margin: 1px 0; +} + +QToolTip { + background-color: #474949; + border: 1px solid #616365; + color: #afb1b3; + padding: 1px 2px; + font-size: 13px; +} + +QScrollBar:vertical { + background-color: transparent; + width: 12px; + margin: 1px; +} + +QScrollBar:handle:vertical { + border: none; + background-color: rgba(69, 69, 66, 0.6); + min-height: 30px; +} + +QScrollBar:handle:vertical:hover { + background-color: rgba(69, 69, 66, 0.91); +} + +QScrollBar::add-line:vertical, +QScrollBar::sub-line:vertical { + border: none; + background: none; +} + +QComboBox, +QLineEdit { + background-color: #2F2F2D; + border: 1px solid #41423f; +} + +QLineEdit { + padding: 3px; +} + +QComboBox { + padding: 3px 5px; +} + +QComboBox::drop-down { + subcontrol-origin: padding; + subcontrol-position: top right; + width: 18px; + height: 26px; + padding-right: 4px; + border: none; + background-color: transparent; +} + +QComboBox::down-arrow { + image: url(":/compiled/src/Insight/UserInterfaces/InsightWindow/Images/down-arrow.svg") +} + +QComboBox QAbstractItemView { + border: 1px solid #41423f; + padding: 0; + margin: 0; + background-color: #373835; +} + +QComboBox QAbstractItemView:item { + color: #afb1b3; + padding: 5px; +} + +QComboBox QAbstractItemView::item:selected { + background-color: #355A80; + padding: 0; + border: 0; + margin: 0; + color: #afb1b3; +} + +QLineEdit:disabled { + font-style: italic; + color: #7d7d7d; +} + +QPushButton { + background-color: #373937; + border: 1px solid #484A49; + padding: 3px 25px; +} + +QPushButton:disabled { + background-color: #303230; + color: #8d8d90; +} + +Bloom--Widgets--LabeledSeparator { + qProperty-lineColor: #454545; + color: #a6a6a6; +} diff --git a/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss b/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss index 505402a5..0c803176 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss +++ b/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss @@ -1,9 +1,3 @@ -* { - color: #afb1b3; - font-family: 'Ubuntu', sans-serif; - font-size: 14px; -} - #main-window #window-container { background-color: #373835; } @@ -257,8 +251,8 @@ QScrollBar::sub-line:vertical { #target-registers-side-pane #search-input { background-color: transparent; - /*font-size: 13px;*/ color: #9b9b9e; + border: none; } #target-registers-side-pane QScrollArea { diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/Stylesheets/TargetRegisterInspectorWindow.qss b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/Stylesheets/TargetRegisterInspectorWindow.qss index 66c7a3e3..c7d1dd3d 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/Stylesheets/TargetRegisterInspectorWindow.qss +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/Stylesheets/TargetRegisterInspectorWindow.qss @@ -1,9 +1,3 @@ -* { - color: #afb1b3; - font-family: 'Ubuntu', sans-serif; - font-size: 14px; -} - #target-register-inspector-window { background-color: #373835; } @@ -21,33 +15,11 @@ border-top: 1px solid #41423f; } -QLineEdit { - background-color: #2F2F2D; - border: 1px solid #41423f; - padding: 3px; -} - -QLineEdit:disabled { - font-style: italic; - color: #7d7d7d; -} - -QPushButton { - background-color: #373937; - border: 1px solid #484A49; - padding: 3px 25px; -} - #apply-btn { background-color: #353C41; border: 1px solid #454C52; } -QPushButton:disabled { - background-color: #303230; - color: #8d8d90; -} - #register-bit-number-label { font-size: 12px; color: #a6a7aa; @@ -120,24 +92,3 @@ QPushButton:disabled { /*font-style: italic;*/ color: #8a8a8d; } - -QScrollBar:vertical { - background-color: transparent; - width: 15px; - margin: 1px 1px 1px 5px; -} - -QScrollBar:handle:vertical { - border: none; - background-color: rgba(69, 69, 66, 0.6); -} - -QScrollBar:handle:vertical:hover { - background-color: rgba(69, 69, 66, 0.91); -} - -QScrollBar::add-line:vertical, -QScrollBar::sub-line:vertical { - border: none; - background: none; -} diff --git a/src/resources.qrc b/src/resources.qrc index 47639eb5..d33224a5 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -17,6 +17,7 @@ ../resources/bloom.template.json + ./Insight/UserInterfaces/InsightWindow/Stylesheets/Global.qss ./Insight/UserInterfaces/InsightWindow/UiFiles/InsightWindow.ui ./Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss ./Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/UiFiles/TargetRegistersSidePane.ui