From e561f9caa0cc4a74537d1002c4ed7bbb30376f12 Mon Sep 17 00:00:00 2001 From: Davide Faconti Date: Sun, 24 Jan 2021 20:52:59 +0100 Subject: [PATCH] Fix style in Windows (#390) --- src/mainwindow.ui | 41 ++++++++++++++++++++---------- src/resources/stylesheet_dark.qss | 9 ++++--- src/resources/stylesheet_light.qss | 16 +++++++----- src/stylesheet.h | 4 ++- 4 files changed, 45 insertions(+), 25 deletions(-) diff --git a/src/mainwindow.ui b/src/mainwindow.ui index bdebff54d..db1247183 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -114,6 +114,11 @@ 20 + + + 10 + + File @@ -440,6 +445,11 @@ 20 + + + 10 + + Streaming @@ -533,11 +543,11 @@ false - - - Ubuntu - 11 - + + + 0 + 22 + <html><head/><body><p>Select the streaming plugin.</p></body></html> @@ -620,9 +630,7 @@ - Ubuntu - 11 - PreferAntialias + 9 @@ -821,6 +829,11 @@ + + + 10 + + Publishers @@ -1311,7 +1324,7 @@ tt - + :/style_light/line_tracker_1.png:/style_light/line_tracker_1.png @@ -1736,7 +1749,7 @@ 0 0 1248 - 25 + 26 @@ -1810,7 +1823,7 @@ - + :/resources/github.png:/resources/github.png @@ -1871,7 +1884,7 @@ - + :/resources/twitter.png:/resources/twitter.png @@ -1897,6 +1910,8 @@
menubar.h
- + + + diff --git a/src/resources/stylesheet_dark.qss b/src/resources/stylesheet_dark.qss index 7da6ce388..6e5d14251 100644 --- a/src/resources/stylesheet_dark.qss +++ b/src/resources/stylesheet_dark.qss @@ -20,10 +20,11 @@ item_selection_background: #148CD2 //------- PALETTE END -------- QWidget { - background-color: transparent; + background: transparent; border: 0px solid ${border_default}; padding: 0px; color: ${default_text}; + font-size: 10pt; } @@ -33,7 +34,7 @@ QWidget:disabled{ } PlotWidget { - background: ${main_background}; + background: ${widget_background}; border: 0px solid white; } @@ -266,11 +267,11 @@ QMenu::icon { } QMenu::item { - background-color: transparent; + background: ${widget_background}; padding: 2px 25px 2px 25px; color: ${default_text}; border: 1px solid transparent; - margin: 2px; + margin: 0px; margin-left: 0px; margin-right: 0px; } diff --git a/src/resources/stylesheet_light.qss b/src/resources/stylesheet_light.qss index e12f25893..2fca034d9 100644 --- a/src/resources/stylesheet_light.qss +++ b/src/resources/stylesheet_light.qss @@ -11,7 +11,7 @@ disabled_text: #666666 widget_background_disabled: #eeeeee; -border_default: grey +border_default: #333333 border_hover: #62c5ff border_checked: #1177ff @@ -20,10 +20,11 @@ item_selection_background: #62c5ff //------- PALETTE END -------- QWidget { - background-color: transparent; + background: transparent; border: 0px solid ${border_default}; padding: 0px; color: ${default_text}; + font-size: 10pt; } @@ -33,7 +34,7 @@ QWidget:disabled{ } PlotWidget { - background: ${main_background}; + background: ${widget_background}; border: 0px solid white; } @@ -121,6 +122,7 @@ QToolTip { background: ${widget_background}; color: ${default_text}; } + /* QScrollArea ------------------------------------------------------------ --------------------------------------------------------------------------- */ @@ -262,7 +264,7 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { /* QMenu ----------------------------------------------------------- */ QMenu { - background-color: ${widget_background}; + background: ${widget_background}; border: 1px solid ${border_default}; } @@ -271,11 +273,11 @@ QMenu::icon { } QMenu::item { - background-color: transparent; + background: ${widget_background}; padding: 2px 25px 2px 25px; color: ${default_text}; border: 1px solid transparent; - margin: 2px; + margin: 0px; margin-left: 0px; margin-right: 0px; } @@ -567,7 +569,6 @@ QComboBox { } - /* QSlider ---------------------------------------------------------------- */ QSlider:disabled { @@ -756,6 +757,7 @@ QWidget#leftMainWindowFrame background-color: ${main_background}; } + QWidget#widgetLabelLoad, QWidget#widgetLabelStreaming, QWidget#widgetLabelPublishers, diff --git a/src/stylesheet.h b/src/stylesheet.h index 258776d06..ec30d87ce 100644 --- a/src/stylesheet.h +++ b/src/stylesheet.h @@ -29,7 +29,9 @@ inline QString SetApplicationStyleSheet(QString style) auto parts = lines[i].split(":"); if( parts.size() == 2 ) { - palette.insert( {parts[0].remove(" "), parts[1].remove(" ")} ); + QString value = parts[1].remove(" "); + value.remove("\r"); + palette.insert( {parts[0].remove(" ") ,value } ); } if( lines[i++].contains("PALETTE END") )