From b25966bac37d9c4d68428dd8ba6d489a647b45f6 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Tue, 23 Aug 2016 12:42:54 +0200 Subject: [PATCH] Disable QFrame borders in stylesheet --- src/blackgui/share/qss/stdwidget.old.qss | 555 +++++++++++++++++++++++ src/blackgui/share/qss/stdwidget.qss | 14 + 2 files changed, 569 insertions(+) create mode 100644 src/blackgui/share/qss/stdwidget.old.qss diff --git a/src/blackgui/share/qss/stdwidget.old.qss b/src/blackgui/share/qss/stdwidget.old.qss new file mode 100644 index 000000000..3c390a88b --- /dev/null +++ b/src/blackgui/share/qss/stdwidget.old.qss @@ -0,0 +1,555 @@ +/* +Resources: +http://qt-project.org/doc/qt-5.3/stylesheet-examples.html +http://web.forret.com/tools/color.asp?RGB=2F4F4F&name=Dark+slate+gray + +Remarks: +1) there is no opacity with background image, so we need semitransparent images +2) use -- instead of :: for namespaces + +Used dynamic properties +framelessMainWindow (infobar.qss , here) +*/ + +QCheckBox::indicator { + color: #b1b1b1; + border: 1px solid #7f7f7f; + width: 15px; + height: 15px; +} + +QCheckBox::indicator::checked { + image: url(:/diagona/icons/diagona/icons/tick.png); +} + +/* Main window */ +QMainWindow { + background-image: url(:/textures/icons/textures/texture-outer.jpg); + background-color: darkslategray; +} + +/* separator between info areas and rest */ +/* this hides them */ +QMainWindow::separator { + background: transparent; + width: 0px; /* when vertical */ + height: 0px; /* when horizontal */ +} + +QMainWindow::separator:hover { + background: transparent; +} + +/* Dialog, sometime main window */ +QDialog { + background-image: url(:/textures/icons/textures/texture-outer.jpg); + background-color: darkslategray; +} + +/* separator between info areas and rest */ +/* this hides them */ +QDialog::separator { + background: transparent; + width: 0px; /* when vertical */ + height: 0px; /* when horizontal */ +} + +QDialog::separator:hover { + background: transparent; +} + +QFileDialog #sidebar { + background: black; +} + +QFileDialog QToolButton { + background: inherit; +} + +/* + Required when dock widget is floating + 1) background-image not working on QDockWidget, so I use direct children for that + 2) seems to have only effect as normal (floating) window + 3) Borders between this widget and the inner child are the margins defined in dockwidget +*/ +BlackGui--CDockWidgetInfoArea { + background-color: green; /* Use green or red here to adjust the borders */ +} + +/* outer widget in dock widget */ +BlackGui--CDockWidgetInfoArea > QWidget[dockwidget="outerwidget"] { + background: black; /* background is background color here */ + background-image: url(:/textures/icons/textures/texture-inner.jpg); +} + +/* this is the first widget in the dock area */ +/* all dock widgets shall have this QWidget as container */ +BlackGui--CDockWidgetInfoArea[framelessDockWidget="true"] > QWidget > QFrame[dockwidget="innerwidget"] { + margin: 0px; + padding: 3px; + border: 2px solid green; + border-radius: 10px; +} + +BlackGui--CDockWidgetInfoArea[framelessDockWidget="false"] > QWidget > QFrame[dockwidget="innerwidget"] { + /* void */ +} + +/* required when info area is not floating */ +BlackGui--CInfoArea { + background: black; /* background is background color here */ + background-image: url(:/textures/icons/textures/texture-inner.jpg); +} + +BlackGui--COverlayMessages { + background: black; /* background is background color here */ + background-image: url(:/textures/icons/textures/texture-inner.jpg); + border: 2px solid yellow; + border-radius: 10px; +} + +BlackGui--CDropSite { + color: blue; + border: 2px solid green; + border-radius: 5px; + min-height: 20px; + max-height: 20px; + margin: 2px; +} + +/* Validator bar */ +BlackGui--Editors--CValidationIndicator { + background: black; /* background is background color here */ + background-image: url(:/textures/icons/textures/texture-inner.jpg); +} + +BlackGui--CPluginDetailsWindow, +BlackGui--CPluginConfigWindow { + background: black; +} + +/* default for buttons */ +QToolButton { + background-color: transparent; /* transparent tool buttons */ + border: 0px; +} + +QPushButton { + background-color: rgba(0, 0, 255, 128); + border-style: 1px solid yellow; + border-radius:3px; + color: yellow; /* font color */ + padding: 0px; + margin-right: 5px; + min-width:60px; + min-height:20px; +} + +QPushButton::disabled { + background-color: rgba(77, 88, 99, 128); /* slated gray if a channel) */ + border-style: none; + border-radius: 3px; + color: white; + padding: 0px; + margin-right: 5px; +} + +QProgressBar { + border: 1px solid green; + border-radius: 5px; + background-color: black; + text-align: center; + padding: 0px; + height: 16px; +} + +QProgressBar::chunk { + background-color: darkblue; + width: 10px; + margin: 0.5px; +} + +QTabWidget::pane { /* The tab widget frame */ + border: none; +} + +QTabWidget::tab-bar { + left: 5px; /* move to the right by 5px */ +} + +QTabBar::tab { + border: 1px solid green; + border-top-left-radius: 6px; + border-top-right-radius: 6px; + min-width: 30px; + padding: 2px; + padding-left: 4px; + padding-right: 4px; + margin-right: 3px; +} + +QTabBar::tab::selected { + background-color: rgba(0, 0, 255, 128); +} + +QTabBar::tear { + image: url(:/own/icons/own/transparent1px.png); + max-width: 1px; +} + +QTabBar QToolButton { /* the scroll buttons are tool buttons */ + background-color: rgba(0, 0, 255, 200); + border: 1px solid green; +} + +/* Splitter normally transparent +QSplitter { background-color: transparent; } +*/ + +QSplitter::handle { + background-color: rgba(0, 0, 255, 200); + margin-top: 1px; + margin-bottom: 1px; + height: 1px; +} + +QSplitter::handle:pressed { + background-color: rgba(0, 255, 255, 255); +} + +/* +QSplitter::handle:horizontal { + width: 1px; +} + +QSplitter::handle:vertical { + height: 1px; +} +*/ + +QLabel { + background: transparent; +} + +QLineEdit { + background: transparent; + border: 1px solid green; + border-radius: 5px; +} + +QLineEdit[readOnly="true"] { + background: transparent; +} + +QCheckBox { + border: 0px solid green; /* also borders label */ + background: transparent; +} + +QTextEdit { + border: 1px solid green; + background: transparent; + border-radius: 5px; +} + +QPlainTextEdit { + border: 1px solid green; + background: transparent; + border-radius: 5px; +} + +QGroupBox { + border: 1px solid green; + margin-top: 2.5ex; /* leave space at the top for the title */ + border-radius: 5px; +} + +QGroupBox::title { + subcontrol-origin: margin; + subcontrol-position: middle center; /* position at the top center */ + padding: 0 5px; +} + +QToolBox::tab { + border: 1px solid green; + border-radius: 6px; + min-width: 30px; + padding: 2px; + padding-left: 4px; + padding-right: 4px; +} + +QToolBox::tab::selected { + background-color: rgba(0, 0, 255, 128); +} + +QToolBox::tab::!selected { + background-color: rgba(0, 0, 255, 48); +} + +/* no border on page */ +QToolBox > QWidget { + border: 0px; +} + +QComboBox { + border: 1px solid green; + border-radius: 5px; + padding: 1px; + background: transparent; + selection-background-color: #3f98ff; +} + +/* drop down list */ +QComboBox QAbstractItemView { + background-color: black; + color: lightgray; + qproperty-textElideMode: ElideMiddle; +} + +QDoubleSpinBox { + border: 1px solid green; + border-radius: 5px; + padding: 1px; + background: transparent; +} + +QSpinBox { + border: 1px solid green; + border-radius: 5px; + padding: 1px; + background: transparent; +} + +QColorDialog { + background-image: url(:/textures/icons/textures/texture-outer.jpg); + background-color: darkslategray; +} + +QMenuBar { + background-image: url(:/textures/icons/textures/texture-outer.jpg); + background-color: darkslategray; + padding: 5px 0px 0px 10px; + margin: 0px 0px 30px 0px; /* removes overlapping bar in frameless mode, why bottom margin helps here, no idea, bug? */ +} + +QMenuBar::item { + spacing: 5px; /* spacing between menu bar items */ + padding: 3px 3px; + background: transparent; + border-radius: 4px; +} + +QMenuBar::item:selected { /* when selected using mouse or keyboard */ + background: black; +} + +QMenuBar::item:pressed { + background: black; +} + +BlackGui--CDockWidgetInfoArea > QMenu > QMenuWidget { + border: 0px; /* reserve space for selection border */ +} + +/* reset menu style */ +QMenu { + color: black; + font-style: normal; + font-weight: normal; + padding: 5px; +} + +QMenu::item { + padding: 4px 25px 4px 20px; +} + +/* fix margin style */ +QMenu > QFrame { + color: black; +} + +BlackGui--Components--CMarginsInput { + color: black; +} + +QRadioButton::indicator:checked, QRadioButton::indicator:unchecked { + color: #b1b1b1; + background-color: #000000; + border: 1px solid #b1b1b1; + border-radius: 7px; +} + +QRadioButton::indicator:checked { + background-color: qradialgradient( + cx: 0.5, cy: 0.5, + fx: 0.5, fy: 0.5, + radius: 1.0, + stop: 0.25 #32cd32, + stop: 0.3 #000000 + ); +} + +QScrollArea { + border: 1px solid green; + border-radius: 5px; +} + +/* have to set background on widget in scroll area, cannot set directly on scroll area */ +/* The inner widget I want to modify is on 2nd level. QScrollArea > QWidget selects too many */ +/* http://doc.qt.io/qt-4.8/stylesheet-syntax.html */ +QScrollArea > * > QWidget { + background: black; /* background is background color here */ + background-image: url(:/textures/icons/textures/texture-inner.jpg); +} + +QScrollArea QMenu { + border: 1px solid darkslategray; /* reserve space for selection border */ + background: lightgray; + color: black; + padding: 0px; +} + +QScrollBar:horizontal { + border: 2px solid gray; + background: slategray; + height: 10px; + margin: 0px 5px 0px 5px; +} + +QScrollBar:vertical { + border: 2px solid gray; + background: slategray; + width: 10px; + margin: 5px 0px 5px 0; +} + +QScrollBar::handle:horizontal { + background: black; + min-width: 15px; +} + +QScrollBar::handle:vertical { + background: black; + min-height: 15px; +} + +QScrollBar::add-line:horizontal { + border: 2px solid gray; + background: blue; + width: 5px; + subcontrol-position: right; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:horizontal { + border: 2px solid gray; + background: blue; + width: 5px; + subcontrol-position: left; + subcontrol-origin: margin; +} + +QScrollBar::add-line:vertical { + border: 2px solid gray; + background: blue; + height: 5px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:vertical { + border: 2px solid gray; + background: blue; + height: 5px; + subcontrol-position: top; + subcontrol-origin: margin; +} + +QHeaderView::section { + border: 1px solid black; + background-color: darkslategray; + color: white; /* font */ + padding: 1px; + margin: 0px; +} + +/* style the sort indicator */ +QHeaderView::down-arrow { + image: url(:/diagona/icons/diagona/icons/arrow-270-small.png); + subcontrol-position: bottom left; +} + +QHeaderView::up-arrow { + image: url(:/diagona/icons/diagona/icons/arrow-090-small.png); + subcontrol-position: bottom left; +} + +QTableView, QTreeView, QListView { + border: 1px solid green; + border-radius: 5px; + background-color: transparent; + alternate-background-color: darkslategray; + selection-background-color: blue; + margin-left: 2px; + margin-right: 2px; + margin-top: 2px; + margin-bottom: 2px; + padding:0px; +} + +QTreeView { + show-decoration-selected: 1; +} + +QTreeView::item { + border: 0px; + padding: 2px 2px 2px 2px; +} + +QTreeView::item:hover { + background: blue; + border: 1px solid #bfcde4; +} + +QTreeView::branch:open:has-children { + image: url(:/diagona/icons/diagona/icons/toggle.png); +} + +QTreeView::branch:closed:has-children { + image: url(:/diagona/icons/diagona/icons/toggle-expand.png); +} + +QSlider::groove:horizontal { + border: 1px solid gray; + height: 4px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */ + background: darkslategray; +} + +QSlider::handle:horizontal { + background: lightgray; + border: 1px solid darkslategray; + width: 18px; + margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */ + border-radius: 3px; +} + +QSizeGrip { + image: url(:/diagona/icons/diagona/icons/arrow-in-out.png); + padding: 0px 20px 0px 0px; + width: 16px; + height: 16px; +} + +QStatusBar { + background: transparent; +} + +QStatusBar::item { + border: none; +} + +QStatusBar QLabel { + border: none; + padding-left: 5px; +} diff --git a/src/blackgui/share/qss/stdwidget.qss b/src/blackgui/share/qss/stdwidget.qss index 3c390a88b..fbfc73063 100644 --- a/src/blackgui/share/qss/stdwidget.qss +++ b/src/blackgui/share/qss/stdwidget.qss @@ -11,6 +11,12 @@ Used dynamic properties framelessMainWindow (infobar.qss , here) */ +QFrame { + border-style: solid; + border-color: transparent; + border-width: 1px; +} + QCheckBox::indicator { color: #b1b1b1; border: 1px solid #7f7f7f; @@ -22,6 +28,10 @@ QCheckBox::indicator::checked { image: url(:/diagona/icons/diagona/icons/tick.png); } +QCheckBox::indicator:indeterminate { + image: url(:/diagona/icons/diagona/icons/question.png); +} + /* Main window */ QMainWindow { background-image: url(:/textures/icons/textures/texture-outer.jpg); @@ -474,6 +484,10 @@ QHeaderView::section { margin: 0px; } +QHeaderView { + border-width: 0px; +} + /* style the sort indicator */ QHeaderView::down-arrow { image: url(:/diagona/icons/diagona/icons/arrow-270-small.png);