diff --git a/src/sas/system/themes/__init__.py b/src/sas/system/themes/__init__.py index a6e6207637..b6be112b73 100644 --- a/src/sas/system/themes/__init__.py +++ b/src/sas/system/themes/__init__.py @@ -10,10 +10,11 @@ # The base dictionary mapping theme names to their location on disk. OPTIONS = { - 'Default': Path(os.path.join(os.path.dirname(__file__), 'default.css')), + 'Light': Path(os.path.join(os.path.dirname(__file__), 'default.css')), 'Dark': Path(os.path.join(os.path.dirname(__file__), 'dark.css')), 'Classic': Path(os.path.join(os.path.dirname(__file__), 'classic.css')), } +USES_STYLE_BASE = ['Light', 'Dark'] # A template string for setting the font size FONT = "* {{font-size: {}pt; font-family: Helvetica, Arial, Verdana, sans-serif}}\n" @@ -25,10 +26,10 @@ def load_theme(theme: str = None) -> str: :return: The CSS string loaded from file """ themes = find_available_themes() - css = "" if not theme or theme not in find_available_themes(): logger.warning(f"Invalid theme name provided: {theme}") - theme = 'Default' + theme = 'Light' + css = "" if theme not in USES_STYLE_BASE else STYLE_BASE # User themes should use the classic theme as a basis and build on it from there if theme.startswith('User:'): with open(themes.get('Classic').absolute()) as fd: @@ -60,3 +61,141 @@ def format_font_size(font_size: float) -> str: :param font_size: The font size, in pt units, to use. :return: FONT.format(font_size)""" return FONT.format(font_size) + + +STYLE_BASE = """ +/* QWidget Properties */ +QWidget:focus {outline: none;} + +/* QMainWindow Properties */ +QMainWindow::separator {width: 4px; height: 4px;} + +/* QCheckBox and QRadioButton Properties */ +QCheckBox, QRadioButton {border-top: 2px solid transparent; border-bottom: 2px solid transparent;} +QCheckBox::indicator:enabled, QRadioButton::indicator:enabled {height: 14px; width: 14px;} +QCheckBox::indicator:hover, QRadioButton::indicator:hover {height: 14px; width: 14px;} + +/* QGroupBox Properties */ +QGroupBox {font-weight: bold; margin-top: 8px; padding: 2px 1px 1px 1px; border-radius: 4px;} +QGroupBox::title {subcontrol-origin: margin; subcontrol-position: top left; left: 7px; margin: 0 2px 0 3px;} +QGroupBox:flat {border-color: transparent;} + +/* QToolTip Properties */ +QToolTip {font-size: 80%;} + +/* QMenuBar Properties */ +QMenuBar {padding: 2px;} +QMenuBar::item {background: transparent; padding: 4px;} +QMenuBar::item:selected {padding: 4px; border-radius: 4px;} +QMenuBar::item:pressed {padding: 4px; margin-bottom: 0; padding-bottom: 0;} + +/* QToolBar */ +/* QToolBar must override `border-style` to set the style. */ +QToolBar { padding: 1px; font-weight: bold; spacing: 2px; margin: 1px; border-style: none;} +QToolBar::separator:horizontal {width: 2px; margin: 0 6px;} +QToolBar::separator:vertical {height: 2px; margin: 6px 0;} +QToolBar > QToolButton {background: transparent; padding: 3px; border-radius: 4px;} +QToolBar > QToolButton::menu-button {border-top-right-radius: 4px; border-bottom-right-radius: 4px;} +QToolBar > QWidget {background: transparent;} + +/* Qmenu Properties */ +QMenu {padding: 8px 0; border-radius: 4px;} +QMenu::separator {margin: 4px 0; height: 1px;} +QMenu::item {background: transparent; padding: 4px 19px;} +QMenu::icon {padding-left: 10px; width: 14px; height: 14px;} + +/* QScrollBar */ +QScrollBar {border-radius: 4px;} +QScrollBar:horizontal {height: 14px;} +QScrollBar::handle {border-radius: 3px;} +QScrollBar::handle:horizontal {min-width: 8px; margin: 4px 14px;} +QScrollBar::handle:horizontal:hover {margin: 2px 14px;} +QScrollBar::handle:vertical {min-height: 8px; margin: 14px 4px;} +QScrollBar::handle:vertical:hover {margin: 14px 2px;} +/* +Hide QScrollBar background. +The `sub-page` and `add-page` are not colored by default on most OS, but are colored on Windows. +*/ +QScrollBar::sub-page, QScrollBar::add-page {background: transparent;} +QScrollBar::sub-line, QScrollBar::add-line {background: transparent;} +QPushButton, QToolButton {padding: 4px 8px; border-radius: 4px;} + +/* QDialogButtonBox */ +QDialogButtonBox {dialogbuttonbox-buttons-have-icons: 0;} +QDialogButtonBox QPushButton {min-width: 65px;} + +/* QComboBox */ +QComboBox {min-height: 1.5em; padding: 0 8px 0 4px; border-radius: 4px;} +QComboBox::drop-down {margin: 2px 2px 2px -6px; border-radius: 4px; /* This remove default style. */} +/* Setting background color of selected item when editable is false. */ +QComboBox::item:selected {border: none; /* This remove the border of indicator. */ border-radius: 4px;} + +/* QAbstractItemView in QComboBox is NoFrame. Override default settings and show border. */ +QComboBox QListView {margin: 0; padding: 4px; border-radius: 4px;} +QComboBox QListView::item {border-radius: 4px;} + +/* QListView QTreeView */ +QListView {padding: 1px} +QTreeView::branch:open:has-children:!has-siblings, QTreeView::branch:open:has-children:has-siblings {border-image: unset;} + +/* +Following arrow settings are for QColumnView. +QColumnView::left-arrow and QColumnView::right-arrow are not working. +*/ +QListView::left-arrow {margin: -2px;} +QListView::right-arrow {margin: -2px;} + +/* QTabWidget QTabBar */ +QTabWidget::pane {border-radius: 4px;} +QTabBar {qproperty-drawBase: 0;} +QTabBar::close-button:hover {border-radius: 4px;} +QTabBar::tab {padding: 3px; border-style: solid;} +QTabBar::tab:top { + border-bottom-width: 2px; + margin: 3px 6px 0 0; + border-top-left-radius: 2px; + border-top-right-radius: 2px; +} +QTabBar::tab:bottom {border-top-width: 2px; margin: 0 6px 3px 0; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px;} +QTabBar::tab:left {border-right-width: 2px; margin: 0 0 6px 3px; border-top-left-radius: 2px; border-bottom-left-radius: 2px;} +QTabBar::tab:right {border-left-width: 2px; margin-bottom: 6px; margin: 0 3px 6px 0; border-top-right-radius: 2px; border-bottom-right-radius: 2px;} +QTabBar::tab:top:first, QTabBar::tab:top:only-one, QTabBar::tab:bottom:first, QTabBar::tab:bottom:only-one {margin-left: 2px;} +QTabBar::tab:top:last, QTabBar::tab:top:only-one, QTabBar::tab:bottom:last, QTabBar::tab:bottom:only-one {margin-right: 2px;} +QTabBar::tab:left:first, QTabBar::tab:left:only-one, QTabBar::tab:right:first, QTabBar::tab:right:only-one {margin-top: 2px;} +QTabBar::tab:left:last, QTabBar::tab:left:only-one, QTabBar::tab:right:last, QTabBar::tab:right:only-one {margin-bottom: 2px;} + +/* QColumnView */ +QColumnViewGrip {margin: -4px;} + +/* QTableView */ +QTableView QTableCornerButton::section {margin: 0 1px 1px 0; border-top-left-radius: 2px;} +QTableView > QHeaderView {border-radius: 3px;} + +/* QLineEdit */ +/* Adjust the min-height of QLineEdit to the height of the characters. */ +QLineEdit {padding: 3px 4px; min-height: 1em; border-radius: 4px;} + +/* QFileDialog */ +QFileDialog QFrame {border: none;} + +/* Check */ +QComboBox::indicator, +QMenu::indicator {width: 18px; height: 18px;} +QMenu::indicator {margin-left: 3px; border-radius: 4px;} + +/* Check indicator */ +QCheckBox, QRadioButton {spacing: 8px;} +QGroupBox::title, QAbstractItemView::item {spacing: 6px;} +QCheckBox::indicator, QGroupBox::indicator, QAbstractItemView::indicator, QRadioButton::indicator {height: 18px; width: 18px;} +QCheckBox::indicator:checked, QGroupBox::indicator:checked, QAbstractItemView::indicator:checked, QRadioButton::indicator:checked {height: 14px; width: 14px;} + +QProgressBar {border: 2px solid grey; border-radius: 5px; text-align: center} +QProgressBar::chunk {background-color: #b1daf9; width: 10px; margin: 1px;} +QTextBrowser[warning=true] {border: 5px solid red; background-color: lightyellow} +QCodeEditor {font-family: 'monospace, monospace'} +QCodeEditor[warning=true] {border: 5px solid red; background-color: lightyellow} +QLabel[bold=true] {font-weight: bold;} +QTreeView::item[base=true] {color: rgb(77,81,87); font-style: normal; font-weight: normal;} +QTreeView::item[disabled=true] {font-style: italic;} +QTreeView::item[constrained=true] {font-style: italic; color: blue;} +QHeaderView {font-weight: bold}""" \ No newline at end of file diff --git a/src/sas/system/themes/dark.css b/src/sas/system/themes/dark.css index ea5aed416e..d372c1bd1d 100644 --- a/src/sas/system/themes/dark.css +++ b/src/sas/system/themes/dark.css @@ -11,14 +11,9 @@ QWidget:disabled { selection-background-color: rgba(228,231,235,0.25); selection-color: rgba(228,231,235,0.4); } -QWidget:focus { - outline: none; -} /* QMainWindow Properties */ QMainWindow::separator { - width: 4px; - height: 4px; background: rgb(42,43,66); } QMainWindow::separator:hover, @@ -27,21 +22,12 @@ QMainWindow::separator:pressed { } /* QCheckBox and QRadioButton Properties */ -QCheckBox, -QRadioButton { - border-top: 2px solid transparent; - border-bottom: 2px solid transparent; -} QCheckBox::indicator:enabled, QRadioButton::indicator:enabled { - height: 14px; - width: 14px; border: 2px solid rgb(0,0,0); } QCheckBox::indicator:hover, QRadioButton::indicator:hover { - height: 14px; - width: 14px; border: 2px solid rgb(26,115,178); } QCheckBox::indicator:checked { @@ -55,130 +41,57 @@ QCheckBox:checked { /* QGroupBox Properties */ QGroupBox { - font-weight: bold; - margin-top: 8px; - padding: 2px 1px 1px 1px; - border-radius: 4px; border: 1px solid rgb(42,43,66); } -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top left; - left: 7px; - margin: 0 2px 0 3px; -} -QGroupBox:flat { - border-color: transparent; -} - /* QToolTip Properties */ QToolTip { - font-size: 80%; background: rgba(63,64,66,0.2); color: rgb(228,231,235); } /* QMenuBar Properties */ QMenuBar { - padding: 2px; border-bottom: 1px solid rgb(42,43,66); background: rgb(63,64,66); } -QMenuBar::item { - background: transparent; - padding: 4px; -} QMenuBar::item:selected { - padding: 4px; - border-radius: 4px; background: rgba(255,255,255,0.20); } -QMenuBar::item:pressed { - padding: 4px; - margin-bottom: 0; - padding-bottom: 0; -} /* QToolBar */ QToolBar { - padding: 1px; - font-weight: bold; - spacing: 2px; - margin: 1px; background: rgb(51,51,51); - /* QToolBar must override `border-style` to set the style. */ - border-style: none; } QToolBar::separator { background: rgb(42,43,66); } -QToolBar::separator:horizontal { - width: 2px; - margin: 0 6px; -} -QToolBar::separator:vertical { - height: 2px; - margin: 6px 0; -} -QToolBar > QToolButton { - background: transparent; - padding: 3px; - border-radius: 4px; -} QToolBar > QToolButton:hover, QToolBar > QToolButton::menu-button:hover { background: rgba(255,255,255,0.15); } -QToolBar > QToolButton::menu-button { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; -} QToolBar > QToolButton:pressed, QToolBar > QToolButton::menu-button:pressed:enabled, QToolBar > QToolButton:checked:enabled { background: rgba(255,255,255,0.24); } -QToolBar > QWidget { - background: transparent; -} /* Qmenu Properties */ QMenu { background: rgba(63,64,66,0.20); - padding: 8px 0; - border-radius: 4px; } QMenu::separator { - margin: 4px 0; - height: 1px; background: rgb(42,43,66); } -QMenu::item { - background: transparent; - padding: 4px 19px; -} QMenu::item:selected { background: rgba(255,255,255,0.12); } -QMenu::icon { - padding-left: 10px; - width: 14px; - height: 14px; -} /* QScrollBar */ QScrollBar { - background: rgba(255,255,255,0.40); - border-radius: 4px; -} -QScrollBar:horizontal { - height: 14px; -} -QScrollBar:vertical { + background: rgba(255, 255, 255, 0.40); } QScrollBar::handle { background: rgba(255,255,255,0.40); - border-radius: 3px; } QScrollBar::handle:hover { background: rgba(255,255,255,0.50); @@ -189,38 +102,9 @@ QScrollBar::handle:pressed { QScrollBar::handle:disabled { background: rgba(255,255,255,0.15); } -QScrollBar::handle:horizontal { - min-width: 8px; - margin: 4px 14px; -} -QScrollBar::handle:horizontal:hover { - margin: 2px 14px; -} -QScrollBar::handle:vertical { - min-height: 8px; - margin: 14px 4px; -} -QScrollBar::handle:vertical:hover { - margin: 14px 2px; -} -/* -Hide QScrollBar background. -The `sub-page` and `add-page` are not colored by default on most OS, but are colored on Windows. -*/ -QScrollBar::sub-page, -QScrollBar::add-page { - background: transparent; -} -QScrollBar::sub-line, -QScrollBar::add-line { - background: transparent; -} - QPushButton, QToolButton { color: rgb(26,115,178); border: 1px solid rgb(42,43,66); - padding: 4px 8px; - border-radius: 4px; } QPushButton:hover, QPushButton:pressed, QPushButton:checked:enabled, QToolButton:hover, QToolButton:pressed, QToolButton:checked:enabled { @@ -228,54 +112,22 @@ QToolButton:hover, QToolButton:pressed, QToolButton:checked:enabled { background: rgba(26,115,178,0.3); } -/* QDialogButtonBox */ -QDialogButtonBox { - dialogbuttonbox-buttons-have-icons: 0; -} -QDialogButtonBox QPushButton { - min-width: 65px; -} - /* QComboBox */ QComboBox { - min-height: 1.5em; - padding: 0 8px 0 4px; background: rgb(63,64,66); border: 1px solid rgb(42,43,66); - border-radius: 4px; } QComboBox:hover, QComboBox::item:hover, QComboBox:focus, QComboBox:open { border-color: rgb(138,180,247); } -QComboBox::drop-down { - margin: 2px 2px 2px -6px; - border-radius: 4px; /* This remove default style. */ -} QComboBox::drop-down:editable:hover { background: rgba(255,255,255,0.13); } -/* Setting background color of selected item when editable is false. */ QComboBox::item:selected { - border: none; /* This remove the border of indicator. */ background: rgba(26,115,178,0.35); - border-radius: 4px; -} - -/* QAbstractItemView in QComboBox is NoFrame. Override default settings and show border. */ -QComboBox QListView { - margin: 0; - padding: 4px; - background: rgba(63,64,66,0.25); - border-radius: 4px; -} -QComboBox QListView::item { - border-radius: 4px; } /* QListView QTreeView */ -QListView { - padding: 1px -} QListView, QTreeView { background: rgb(63,64,66); @@ -301,36 +153,12 @@ QTreeView > QHeaderView::section { background: rgb(42,43,66); } -/* -Following arrow settings are for QColumnView. -QColumnView::left-arrow and QColumnView::right-arrow are not working. -*/ -QListView::left-arrow { - margin: -2px; -} -QListView::right-arrow { - margin: -2px; -} - /* QTabWidget QTabBar */ QTabWidget::pane { border: 1px solid rgb(42,43,66); - border-radius: 4px; -} -QTabBar { - /* - Not filling background color when drawBase property is true. So need to set drawBase to false. - Default QTabBar is no need following declaration, but QMdiArea is need. - */ - qproperty-drawBase: 0; } QTabBar::close-button:hover { background: rgba(255,255,255,0.20); - border-radius: 4px; -} -QTabBar::tab { - padding: 3px; - border-style: solid; } QTabBar::tab:hover, QTabBar::tab:selected:hover:enabled { @@ -344,55 +172,6 @@ QTabBar::tab:selected:disabled, QTabBar::tab:only-one:selected:enabled { border-color: rgb(42,43,66); } -QTabBar::tab:top { - border-bottom-width: 2px; - margin: 3px 6px 0 0; - border-top-left-radius: 2px; - border-top-right-radius: 2px; -} -QTabBar::tab:bottom { - border-top-width: 2px; - margin: 0 6px 3px 0; - border-bottom-left-radius: 2px; - border-bottom-right-radius: 2px; -} -QTabBar::tab:left { - border-right-width: 2px; - margin: 0 0 6px 3px; - border-top-left-radius: 2px; - border-bottom-left-radius: 2px; -} -QTabBar::tab:right { - border-left-width: 2px; - margin-bottom: 6px; - margin: 0 3px 6px 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; -} -QTabBar::tab:top:first, -QTabBar::tab:top:only-one, -QTabBar::tab:bottom:first, -QTabBar::tab:bottom:only-one { - margin-left: 2px; -} -QTabBar::tab:top:last, -QTabBar::tab:top:only-one, -QTabBar::tab:bottom:last, -QTabBar::tab:bottom:only-one { - margin-right: 2px; -} -QTabBar::tab:left:first, -QTabBar::tab:left:only-one, -QTabBar::tab:right:first, -QTabBar::tab:right:only-one { - margin-top: 2px; -} -QTabBar::tab:left:last, -QTabBar::tab:left:only-one, -QTabBar::tab:right:last, -QTabBar::tab:right:only-one { - margin-bottom: 2px; -} /* QColumnView */ QColumnView { @@ -418,16 +197,13 @@ QTableView::item:selected { background: rgba(63,64,66,0.5); } QTableView QTableCornerButton::section { - margin: 0 1px 1px 0; background: rgb(42,43,66); - border-top-left-radius: 2px; } QTableView QTableCornerButton::section:pressed { background: rgba(26,115,178,0.35); } QTableView > QHeaderView { background: rgba(63,64,66,0.50); - border-radius: 3px; } QTableView > QHeaderView::section { background: rgb(42,43,66); @@ -435,67 +211,28 @@ QTableView > QHeaderView::section { /* QLineEdit */ QLineEdit { - padding: 3px 4px; - /* Adjust the min-height of QLineEdit to the height of the characters. */ - min-height: 1em; border: 1px solid rgb(42,43,66); background: rgb(63,64,66); - border-radius: 4px; } QLineEdit:focus { border-color: rgb(26,115,178); } -/* QFileDialog */ -QFileDialog QFrame { - border: none; -} - /* Check */ -QComboBox::indicator, -QMenu::indicator { - width: 18px; - height: 18px; -} QMenu::indicator { background: rgba(255,255,255,0.19); - margin-left: 3px; - border-radius: 4px; } /* Check indicator */ -QCheckBox, -QRadioButton { - spacing: 8px; -} -QGroupBox::title, -QAbstractItemView::item { - spacing: 6px; -} QCheckBox::indicator, QGroupBox::indicator, QAbstractItemView::indicator, QRadioButton::indicator { - height: 18px; - width: 18px; background: rgba(245,245,245,0.6); } QCheckBox::indicator:checked, QGroupBox::indicator:checked, QAbstractItemView::indicator:checked, QRadioButton::indicator:checked { - height: 14px; - width: 14px; background: rgb(26,115,178); -} - -QProgressBar {border: 2px solid grey; border-radius: 5px; text-align: center} -QProgressBar::chunk {background-color: #b1daf9; width: 10px; margin: 1px;} -QTextBrowser[warning=true] {border: 5px solid red; background-color: lightyellow} -QCodeEditor {font-family: 'monospace, monospace'} -QCodeEditor[warning=true] {border: 5px solid red; background-color: lightyellow} -QLabel[bold=true] {font-weight: bold;} -QTreeView::item[base=true] {color: rgb(77,81,87); font-style: normal; font-weight: normal;} -QTreeView::item[disabled=true] {font-style: italic;} -QTreeView::item[constrained=true] {font-style: italic; color: blue;} -QHeaderView {font-weight: bold} \ No newline at end of file +} \ No newline at end of file diff --git a/src/sas/system/themes/default.css b/src/sas/system/themes/default.css index 202cb98321..a9b20761c9 100644 --- a/src/sas/system/themes/default.css +++ b/src/sas/system/themes/default.css @@ -11,14 +11,9 @@ QWidget:disabled { selection-background-color: rgba(77,81,87,0.25); selection-color: rgba(77,81,87,0.4); } -QWidget:focus { - outline: none; -} /* QMainWindow Properties */ QMainWindow::separator { - width: 4px; - height: 4px; background: rgb(218,220,224); } QMainWindow::separator:hover, @@ -27,21 +22,12 @@ QMainWindow::separator:pressed { } /* QCheckBox and QRadioButton Properties */ -QCheckBox, -QRadioButton { - border-top: 2px solid transparent; - border-bottom: 2px solid transparent; -} QCheckBox::indicator:enabled, QRadioButton::indicator:enabled { - height: 14px; - width: 14px; border: 2px solid rgba(0,0,0,0.25); } QCheckBox::indicator:hover, QRadioButton::indicator:hover { - height: 14px; - width: 14px; border: 2px solid rgb(26,115,178); } QCheckBox::indicator:checked { @@ -55,130 +41,58 @@ QCheckBox:checked { /* QGroupBox Properties */ QGroupBox { - font-weight: bold; - margin-top: 8px; - padding: 2px 1px 1px 1px; - border-radius: 4px; border: 1px solid rgb(218,220,224); } -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top left; - left: 7px; - margin: 0 2px 0 3px; -} -QGroupBox:flat { - border-color: transparent; -} /* QToolTip Properties */ QToolTip { - font-size: 80%; background: rgba(248,249,250,0.2); color: rgb(77,81,87); } /* QMenuBar Properties */ QMenuBar { - padding: 2px; border-bottom: 1px solid rgb(218,220,224); background: rgb(248,249,250); } -QMenuBar::item { - background: transparent; - padding: 4px; -} QMenuBar::item:selected { - padding: 4px; - border-radius: 4px; background: rgba(0,0,0,0.20); } -QMenuBar::item:pressed { - padding: 4px; - margin-bottom: 0; - padding-bottom: 0; -} /* QToolBar */ QToolBar { - padding: 1px; - font-weight: bold; - spacing: 2px; - margin: 1px; background: rgb(235,235,235); - /* QToolBar must override `border-style` to set the style. */ - border-style: none; } QToolBar::separator { background: rgb(218,220,224); } -QToolBar::separator:horizontal { - width: 2px; - margin: 0 6px; -} -QToolBar::separator:vertical { - height: 2px; - margin: 6px 0; -} -QToolBar > QToolButton { - background: transparent; - padding: 3px; - border-radius: 4px; -} QToolBar > QToolButton:hover, QToolBar > QToolButton::menu-button:hover { background: rgba(0,0,0,0.15); } -QToolBar > QToolButton::menu-button { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; -} QToolBar > QToolButton:pressed, QToolBar > QToolButton::menu-button:pressed:enabled, QToolBar > QToolButton:checked:enabled { background: rgba(0,0,0,0.24); } -QToolBar > QWidget { - background: transparent; -} /* Qmenu Properties */ QMenu { background: rgba(248,249,250,0.70); - padding: 8px 0; - border-radius: 4px; } QMenu::separator { - margin: 4px 0; - height: 1px; background: rgb(218,220,224); } -QMenu::item { - background: transparent; - padding: 4px 19px; -} QMenu::item:selected { background: rgba(0,0,0,0.12); } -QMenu::icon { - padding-left: 10px; - width: 14px; - height: 14px; -} /* QScrollBar */ QScrollBar { background: rgba(0,0,0,0.40); - border-radius: 4px; -} -QScrollBar:horizontal { - height: 14px; -} -QScrollBar:vertical { } QScrollBar::handle { background: rgba(0,0,0,0.40); - border-radius: 3px; } QScrollBar::handle:hover { background: rgba(0,0,0,0.50); @@ -189,38 +103,10 @@ QScrollBar::handle:pressed { QScrollBar::handle:disabled { background: rgba(0,0,0,0.15); } -QScrollBar::handle:horizontal { - min-width: 8px; - margin: 4px 14px; -} -QScrollBar::handle:horizontal:hover { - margin: 2px 14px; -} -QScrollBar::handle:vertical { - min-height: 8px; - margin: 14px 4px; -} -QScrollBar::handle:vertical:hover { - margin: 14px 2px; -} -/* -Hide QScrollBar background. -The `sub-page` and `add-page` are not colored by default on most OS, but are colored on Windows. -*/ -QScrollBar::sub-page, -QScrollBar::add-page { - background: transparent; -} -QScrollBar::sub-line, -QScrollBar::add-line { - background: transparent; -} QPushButton, QToolButton { color: rgb(26,115,232); border: 1px solid rgb(218,220,224); - padding: 4px 8px; - border-radius: 4px; } QPushButton:hover, QPushButton:pressed, QPushButton:checked:enabled, QToolButton:hover, QToolButton:pressed, QToolButton:checked:enabled { @@ -228,54 +114,28 @@ QToolButton:hover, QToolButton:pressed, QToolButton:checked:enabled { background: rgba(26,115,232,0.3); } -/* QDialogButtonBox */ -QDialogButtonBox { - dialogbuttonbox-buttons-have-icons: 0; -} -QDialogButtonBox QPushButton { - min-width: 65px; -} - /* QComboBox */ QComboBox { - min-height: 1.5em; - padding: 0 8px 0 4px; background: rgb(248,249,250); border: 1px solid rgb(218,220,224); - border-radius: 4px; } QComboBox:hover, QComboBox::item:hover, QComboBox:focus, QComboBox:open { border-color: rgb(26,115,232); } -QComboBox::drop-down { - margin: 2px 2px 2px -6px; - border-radius: 4px; /* This remove default style. */ -} QComboBox::drop-down:editable:hover { background: rgba(0,0,0,0.13); } /* Setting background color of selected item when editable is false. */ QComboBox::item:selected { - border: none; /* This remove the border of indicator. */ background: rgba(26,115,278,0.35); - border-radius: 4px; } /* QAbstractItemView in QComboBox is NoFrame. Override default settings and show border. */ QComboBox QListView { - margin: 0; - padding: 4px; background: rgba(248,249,250,0.25); - border-radius: 4px; -} -QComboBox QListView::item { - border-radius: 4px; } /* QListView QTreeView */ -QListView { - padding: 1px -} QListView, QTreeView { background: rgb(248,249,250); @@ -301,36 +161,12 @@ QTreeView > QHeaderView::section { background: rgb(218,220,224); } -/* -Following arrow settings are for QColumnView. -QColumnView::left-arrow and QColumnView::right-arrow are not working. -*/ -QListView::left-arrow { - margin: -2px; -} -QListView::right-arrow { - margin: -2px; -} - /* QTabWidget QTabBar */ QTabWidget::pane { border: 1px solid rgb(218,220,224); - border-radius: 4px; -} -QTabBar { - /* - Not filling background color when drawBase property is true. So need to set drawBase to false. - Default QTabBar is no need following declaration, but QMdiArea is need. - */ - qproperty-drawBase: 0; } QTabBar::close-button:hover { background: rgba(0,0,0,0.20); - border-radius: 4px; -} -QTabBar::tab { - padding: 3px; - border-style: solid; } QTabBar::tab:hover, QTabBar::tab:selected:hover:enabled { @@ -344,62 +180,12 @@ QTabBar::tab:selected:disabled, QTabBar::tab:only-one:selected:enabled { border-color: rgb(218,220,224); } -QTabBar::tab:top { - border-bottom-width: 2px; - margin: 3px 6px 0 0; - border-top-left-radius: 2px; - border-top-right-radius: 2px; -} -QTabBar::tab:bottom { - border-top-width: 2px; - margin: 0 6px 3px 0; - border-bottom-left-radius: 2px; - border-bottom-right-radius: 2px; -} -QTabBar::tab:left { - border-right-width: 2px; - margin: 0 0 6px 3px; - border-top-left-radius: 2px; - border-bottom-left-radius: 2px; -} -QTabBar::tab:right { - border-left-width: 2px; - margin-bottom: 6px; - margin: 0 3px 6px 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; -} -QTabBar::tab:top:first, -QTabBar::tab:top:only-one, -QTabBar::tab:bottom:first, -QTabBar::tab:bottom:only-one { - margin-left: 2px; -} -QTabBar::tab:top:last, -QTabBar::tab:top:only-one, -QTabBar::tab:bottom:last, -QTabBar::tab:bottom:only-one { - margin-right: 2px; -} -QTabBar::tab:left:first, -QTabBar::tab:left:only-one, -QTabBar::tab:right:first, -QTabBar::tab:right:only-one { - margin-top: 2px; -} -QTabBar::tab:left:last, -QTabBar::tab:left:only-one, -QTabBar::tab:right:last, -QTabBar::tab:right:only-one { - margin-bottom: 2px; -} /* QColumnView */ QColumnView { background: rgb(248,249,250); } QColumnViewGrip { - margin: -4px; background: rgb(248,249,250); } @@ -411,28 +197,20 @@ QTableView { QTableView:!active { background: rgba(0,0,0,0.12); } -QTableView::item { - height: 125%; -} QTableView::item:alternate { - height: 200%; - margin: 4px; background: rgba(0,0,0,0.12); } QTableView::item:selected { background: rgba(248,249,250,0.5); } QTableView QTableCornerButton::section { - margin: 4px; background: rgb(218,220,224); - border-top-left-radius: 2px; } QTableView QTableCornerButton::section:pressed { background: rgba(26,115,232,0.35); } QTableView > QHeaderView { background: rgba(248,249,250,0.50); - border-radius: 3px; } QTableView > QHeaderView::section { background: rgb(218,220,224); @@ -440,67 +218,23 @@ QTableView > QHeaderView::section { /* QLineEdit */ QLineEdit { - padding: 3px 4px; - /* Adjust the min-height of QLineEdit to the height of the characters. */ - min-height: 1em; border: 1px solid rgb(218,220,224); background: rgb(248,249,250); - border-radius: 4px; } QLineEdit:focus { border-color: rgb(26,115,232); } -/* QFileDialog */ -QFileDialog QFrame { - border: none; -} - -/* Check */ -QComboBox::indicator, -QMenu::indicator { - width: 18px; - height: 18px; -} -QMenu::indicator { - background: rgba(0,0,0,0.19); - margin-left: 3px; - border-radius: 4px; -} - /* Check indicator */ -QCheckBox, -QRadioButton { - spacing: 8px; -} -QGroupBox::title, -QAbstractItemView::item { - spacing: 6px; -} QCheckBox::indicator, QGroupBox::indicator, QAbstractItemView::indicator, QRadioButton::indicator { - height: 18px; - width: 18px; background: rgba(245,245,245,0.6); } QCheckBox::indicator:checked, QGroupBox::indicator:checked, QAbstractItemView::indicator:checked, QRadioButton::indicator:checked { - height: 14px; - width: 14px; background: rgb(26,115,178); -} - -QProgressBar {border: 2px solid grey; border-radius: 5px; text-align: center} -QProgressBar::chunk {background-color: #b1daf9; width: 10px; margin: 1px;} -QTextBrowser[warning=true] {border: 5px solid red; background-color: lightyellow} -QCodeEditor {font-family: 'monospace, monospace'} -QCodeEditor[warning=true] {border: 5px solid red; background-color: lightyellow} -QLabel[bold=true] {font-weight: bold;} -QTreeView::item[base=true] {color: rgb(77,81,87); font-style: normal; font-weight: normal;} -QTreeView::item[disabled=true] {font-style: italic;} -QTreeView::item[constrained=true] {font-style: italic; color: blue;} -QHeaderView {font-weight: bold} \ No newline at end of file +} \ No newline at end of file