diff --git a/dtt4all_data/icons/bt.png b/dtt4all_data/icons/bt.png index e82f889c..3d97a7cd 100644 Binary files a/dtt4all_data/icons/bt.png and b/dtt4all_data/icons/bt.png differ diff --git a/dtt4all_data/icons/expert-b.png b/dtt4all_data/icons/expert-b.png new file mode 100644 index 00000000..d6d926b9 Binary files /dev/null and b/dtt4all_data/icons/expert-b.png differ diff --git a/dtt4all_data/icons/wifi.png b/dtt4all_data/icons/wifi.png index 0d9e9314..3c408488 100644 Binary files a/dtt4all_data/icons/wifi.png and b/dtt4all_data/icons/wifi.png differ diff --git a/main.py b/main.py index 6dac5ac2..6265e025 100644 --- a/main.py +++ b/main.py @@ -401,8 +401,10 @@ def __init__(self, parent=None): self.log.setCheckable(True) self.log.setChecked(options.log_all) self.log.triggered.connect(self.changeLogMode) - - self.expert = widgets.QAction(gui.QIcon("dtt4all_data/icons/expert.png"), _("Expert mode (enable writing)"), self) + if options.dark_mode: + self.expert = widgets.QAction(gui.QIcon("dtt4all_data/icons/expert-b.png"), _("Expert mode (enable writing)"), self) + else: + self.expert = widgets.QAction(gui.QIcon("dtt4all_data/icons/expert.png"), _("Expert mode (enable writing)"), self) self.expert.setCheckable(True) self.expert.setChecked(options.promode) self.expert.triggered.connect(self.changeUserMode) @@ -443,9 +445,11 @@ def __init__(self, parent=None): self.toolbar.addSeparator() self.toolbar.addAction(self.log) + self.toolbar.addSeparator() self.toolbar.addAction(self.expert) self.toolbar.addSeparator() self.toolbar.addAction(self.autorefresh) + self.toolbar.addSeparator() self.toolbar.addAction(self.refresh) self.toolbar.addSeparator() self.toolbar.addAction(self.diagaction) @@ -453,6 +457,7 @@ def __init__(self, parent=None): self.toolbar.addAction(self.hexinput) self.toolbar.addSeparator() self.toolbar.addAction(self.cominput) + self.toolbar.addSeparator() self.toolbar.addAction(self.fctrigger) self.toolbar.addSeparator() self.toolbar.addWidget(self.canlinecombo) @@ -460,10 +465,10 @@ def __init__(self, parent=None): self.toolbar.addWidget(self.sdscombo) self.toolbar.addSeparator() self.toolbar.addWidget(self.zoominbutton) + self.toolbar.addSeparator() self.toolbar.addWidget(self.zoomoutbutton) if options.simulation_mode: - self.toolbar.addSeparator() self.ui_edit_button = widgets.QPushButton(_("UI Edit")) self.ui_edit_button.setCheckable(True) self.toolbar.addSeparator() @@ -1154,10 +1159,11 @@ def set_dark_style(onoff): if (onoff): stylefile = core.QFile("qstyle.qss") stylefile.open(core.QFile.ReadOnly) - + options.dark_mode = True StyleSheet = bytes(stylefile.readAll()).decode() else: StyleSheet = "" + options.dark_mode = False app.setStyleSheet(StyleSheet) @@ -1558,8 +1564,8 @@ def demoMode(self): options.simultation_mode = True app = widgets.QApplication(sys.argv) - fsize = 10 - fname = "Tahoma" + fsize = 9 + fname = "Segoe UI" if sys.platform[:3] == "dar": fsize = 12 diff --git a/options.py b/options.py index 08247428..c72e2745 100644 --- a/options.py +++ b/options.py @@ -21,6 +21,7 @@ # KWP2000 Slow init opt_si = False report_data = True +dark_mode = False ecus_dir = "ecus/" graphics_dir = "graphics/" last_error = "" diff --git a/qstyle.qss b/qstyle.qss index 10c2575a..e95ca015 100644 --- a/qstyle.qss +++ b/qstyle.qss @@ -1,484 +1,239 @@ -QToolTip -{ - border: 1px solid black; - background-color: #ffa02f; - padding: 1px; - border-radius: 3px; - opacity: 100; +/* Styles for tooltips */ +QToolTip { + border: 1px solid black; /* Tooltip border */ + background-color: #ffa02f; /* Tooltip background color */ + padding: 1px; /* Internal padding */ + border-radius: 3px; /* Rounded border */ } -QWidget -{ - color: #e1e1e1; - background-color: #323232; +/* Styles for widgets in general */ +QWidget { + color: #e1e1e1; /* Text color */ + background-color: #323232; /* Background color */ } -QWidget:item:hover -{ - background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #ca0619); - color: #000000; +/* Styles for widget items when hovered */ +QWidget:item:hover { + background-color: #ff7e00; /* Background color when hovered */ + color: #000000; /* Text color when hovered */ } -QWidget:item:selected -{ - background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); +/* Styles for selected widget items */ +QWidget:item:selected { + background-color: #ffa02f; /* Background color of selected item */ } -QMenuBar::item -{ - background: transparent; +/* Styles for menu items in menu bar */ +QMenuBar::item, +QMenuBar::item:selected { + background: transparent; /* Transparent background */ } -QMenuBar::item:selected -{ - background: transparent; - border: 1px solid #ffaa00; +/* Styles for selected menu items */ +QMenuBar::item:selected { + border: 1px solid #ffaa00; /* Border of selected item */ } -QMenuBar::item:pressed -{ - background: #444; - border: 1px solid #000; - background-color: QLinearGradient( - x1:0, y1:0, - x2:0, y2:1, - stop:1 #212121, - stop:0.4 #343434/*, - stop:0.2 #343434, - stop:0.1 #ffaa00*/ - ); - margin-bottom:-1px; - padding-bottom:1px; +/* Styles for menu items when pressed */ +QMenuBar::item:pressed { + background: #444; /* Background when pressed */ + border: 1px solid #000; /* Border when pressed */ } -QMenu -{ - border: 1px solid #000; +/* Styles for menus and their items */ +QMenu, +QMenu::item { + border: 1px solid #000; /* Menu and item border */ } -QMenu::item -{ - padding: 2px 20px 2px 20px; +/* Styles for menu items */ +QMenu::item { + padding: 2px 20px; /* Item padding */ } -QMenu::item:selected -{ - color: #000000; +/* Styles for selected menu items */ +QMenu::item:selected { + color: #000000; /* Text color of selected item */ } -QWidget:disabled -{ - color: #808080; - background-color: #323232; +/* Styles for disabled widgets */ +QWidget:disabled { + color: #808080; /* Text color of disabled widgets */ } -QAbstractItemView -{ - background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4d4d4d, stop: 0.1 #646464, stop: 1 #5d5d5d); +/* Styles for abstract item view */ +QAbstractItemView { + background-color: #4d4d4d; /* Background color */ } -QWidget:focus -{ - /*border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a);*/ +/* Styles for line edit fields */ +QLineEdit, +QPushButton, +QComboBox, +QScrollBar, +QTextEdit, +QPlainTextEdit, +QProgressBar, +QTabBar::tab, +QDockWidget::title { + background-color: #242424; /* Background color */ } -QLineEdit -{ - background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4d4d4d, stop: 0 #646464, stop: 1 #5d5d5d); - padding: 1px; - border-style: solid; - border: 1px solid #1e1e1e; - border-radius: 5; +/* Specific styles for QComboBox */ +QComboBox { + color: #e1e1e1; /* Text color */ + border: 1px solid #8e8e1e; /* Border */ + border-radius: 5px; /* Rounded border */ + padding: 1px; /* Internal padding */ } -QPushButton -{ - color: #e1e1e1; - background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #565656, stop: 0.1 #525252, stop: 0.5 #4e4e4e, stop: 0.9 #4a4a4a, stop: 1 #464646); - border-width: 1px; - border-color: #1e1e1e; - border-style: solid; - border-radius: 6; - padding: 3px; - font-size: 12px; - padding-left: 5px; - padding-right: 5px; +/* Styles for QComboBox drop-down arrow */ +QComboBox::down-arrow { + image: url("dtt4all_data/icons/down_arrow.png"); /* Arrow icon */ } -QPushButton:pressed -{ - background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d2d2d, stop: 0.1 #2b2b2b, stop: 0.5 #292929, stop: 0.9 #282828, stop: 1 #252525); +/* Styles for QComboBox when pressed */ +QComboBox::on { + padding-top: 3px; /* Top padding */ + padding-left: 4px; /* Left padding */ + background-color: #000000; /* Background color when pressed */ + selection-background-color: #ffaa00; /* Selection background color when pressed */ } -QComboBox -{ - selection-background-color: #ffaa00; - background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #565656, stop: 0.1 #525252, stop: 0.5 #4e4e4e, stop: 0.9 #4a4a4a, stop: 1 #464646); - border-style: solid; - border: 1px solid #8e8e1e; - border-radius: 5; - padding: 1px 1px 1px 1px; +/* Styles for QComboBox item view */ +QComboBox QAbstractItemView { + border: 2px solid darkgray; /* Item view border */ + selection-background-color: #ffaa00; /* Selection background color */ + background-color: #ffffff; /* Background color */ + color: #000000; /* Text color */ } -QComboBox:hover,QPushButton:hover -{ - border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); +/* Styles for focused group boxes and text areas */ +QGroupBox:focus, +QTextEdit:focus { + border: 2px solid #ffa02f; /* Border */ } -QComboBox:on -{ - padding-top: 3px; - padding-left: 4px; - background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d2d2d, stop: 0.1 #2b2b2b, stop: 0.5 #292929, stop: 0.9 #282828, stop: 1 #252525); - selection-background-color: #ffaa00; +/* Styles for horizontal and vertical scroll bars */ +QScrollBar:horizontal, +QScrollBar:vertical { + border: 1px solid #222222; /* Border */ + background: #484848; /* Background color */ } -QComboBox QAbstractItemView -{ - border: 2px solid darkgray; - selection-background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); +/* Styles for scroll bar handles */ +QScrollBar::handle:horizontal, +QScrollBar::handle:vertical { + background: #ffa02f; /* Scroll bar handle color */ + border-radius: 2px; /* Rounded border */ } -QComboBox::drop-down -{ - subcontrol-origin: padding; - subcontrol-position: top right; - width: 15px; - - border-left-width: 0px; - border-left-color: darkgray; - border-left-style: solid; /* just a single line */ - border-top-right-radius: 3px; /* same radius as the QComboBox */ - border-bottom-right-radius: 3px; - } - -QComboBox::down-arrow -{ - image: url("dtt4all_data/icons/down_arrow.png"); -} - -QGroupBox:focus -{ -border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); -} - -QTextEdit:focus -{ - border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); -} - -QScrollBar:horizontal { - border: 1px solid #222222; - background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); - height: 7px; - margin: 0px 16px 0 16px; -} - -QScrollBar::handle:horizontal -{ - background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 0.5 #d7801a, stop: 1 #ffa02f); - min-height: 20px; - border-radius: 2px; -} - -QScrollBar::add-line:horizontal { - border: 1px solid #1b1b19; - border-radius: 2px; - background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 1 #d7801a); - width: 14px; - subcontrol-position: right; - subcontrol-origin: margin; -} - -QScrollBar::sub-line:horizontal { - border: 1px solid #1b1b19; - border-radius: 2px; - background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 1 #d7801a); - width: 14px; - subcontrol-position: left; - subcontrol-origin: margin; -} - -QScrollBar::right-arrow:horizontal, QScrollBar::left-arrow:horizontal -{ - border: 1px solid black; - width: 1px; - height: 1px; - background: white; -} - -QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal -{ - background: none; +/* Styles for scroll bar arrows */ +QScrollBar::add-line:horizontal, +QScrollBar::sub-line:horizontal, +QScrollBar::add-line:vertical, +QScrollBar::sub-line:vertical { + border: 1px solid #1b1b19; /* Border */ + border-radius: 2px; /* Rounded border */ + background: #ffa02f; /* Background color */ + background-color: #000000; /* Background color */ } -QScrollBar:vertical -{ - background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); - width: 7px; - margin: 16px 0 16px 0; - border: 1px solid #222222; +/* Styles for scroll bar arrows */ +QScrollBar::right-arrow:horizontal, +QScrollBar::left-arrow:horizontal, +QScrollBar::up-arrow:vertical, +QScrollBar::down-arrow:vertical { + width: 3px; /* Width */ + height: 3px; /* Height */ + background: white; /* Background color */ } -QScrollBar::handle:vertical -{ - background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 0.5 #d7801a, stop: 1 #ffa02f); - min-height: 20px; - border-radius: 2px; +/* Styles for scroll bar page areas */ +QScrollBar::add-page:horizontal, +QScrollBar::sub-page:horizontal, +QScrollBar::add-page:vertical, +QScrollBar::sub-page:vertical { + background: transparent; /* Transparent background */ } -QScrollBar::add-line:vertical -{ - border: 1px solid #1b1b19; - border-radius: 2px; - background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); - height: 14px; - subcontrol-position: bottom; - subcontrol-origin: margin; -} - -QScrollBar::sub-line:vertical -{ - border: 1px solid #1b1b19; - border-radius: 2px; - background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #d7801a, stop: 1 #ffa02f); - height: 14px; - subcontrol-position: top; - subcontrol-origin: margin; -} - -QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical -{ - border: 1px solid black; - width: 1px; - height: 1px; - background: white; -} - - -QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical -{ - background: none; -} - -QTextEdit -{ - background-color: #242424; -} - -QPlainTextEdit -{ - background-color: #242424; -} - -QHeaderView::section -{ - background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #616161, stop: 0.5 #505050, stop: 0.6 #434343, stop:1 #656565); - color: white; - padding-left: 4px; - border: 1px solid #6c6c6c; -} - -QCheckBox:disabled -{ -color: #414141; -} - -QDockWidget::title -{ - text-align: center; - spacing: 3px; /* spacing between items in the tool bar */ - background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); -} - -QDockWidget::close-button, QDockWidget::float-button -{ - text-align: center; - spacing: 1px; /* spacing between items in the tool bar */ - background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); -} - -QDockWidget::close-button:hover, QDockWidget::float-button:hover -{ - background: #242424; -} - -QDockWidget::close-button:pressed, QDockWidget::float-button:pressed -{ - padding: 1px -1px -1px 1px; -} - -QMainWindow::separator -{ - background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); - color: white; - padding-left: 4px; - border: 1px solid #4c4c4c; - spacing: 3px; /* spacing between items in the tool bar */ -} - -QMainWindow::separator:hover -{ - - background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #d7801a, stop:0.5 #b56c17 stop:1 #ffa02f); - color: white; - padding-left: 4px; - border: 1px solid #6c6c6c; - spacing: 3px; /* spacing between items in the tool bar */ -} - -QToolBar::handle -{ - spacing: 3px; /* spacing between items in the tool bar */ - background: url("dtt4all_data/icons/handle.png"); -} - -QMenu::separator -{ - height: 2px; - background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); - color: white; - padding-left: 4px; - margin-left: 10px; - margin-right: 5px; -} - -QProgressBar -{ - border: 2px solid gray; - border-radius: 5px; - text-align: center; -} - -QProgressBar::chunk -{ - background-color: #d7801a; - width: 2.15px; - margin: 0.5px; -} - -QTabBar::tab { - color: #b1b1b1; - border: 1px solid #444; - border-bottom-style: none; - background-color: #323232; - padding-left: 10px; - padding-right: 10px; - padding-top: 3px; - padding-bottom: 2px; - margin-right: -1px; -} - -QTabWidget::pane { - border: 1px solid #444; - top: 1px; -} - -QTabBar::tab:last -{ - margin-right: 0; /* the last selected tab has nothing to overlap with on the right */ - border-top-right-radius: 3px; -} - -QTabBar::tab:first:!selected -{ - margin-left: 0px; /* the last selected tab has nothing to overlap with on the right */ - - - border-top-left-radius: 3px; -} - -QTabBar::tab:!selected -{ - color: #b1b1b1; - border-bottom-style: solid; - margin-top: 3px; - background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:.4 #343434); +/* Styles for header sections, main window separators, and toolbars */ +QHeaderView::section, +QMainWindow::separator, +QToolBar { + background-color: #656565; /* Background color */ + border: 1px solid #6c6c6c; /* Border */ } -QTabBar::tab:selected -{ - border-top-left-radius: 3px; - border-top-right-radius: 3px; - margin-bottom: 0px; +/* Styles for main window separators when hovered */ +QMainWindow::separator:hover { + background-color: #ffa02f; /* Background color when hovered */ + border: 1px solid #6c6c6c; /* Border when hovered */ } -QTabBar::tab:!selected:hover -{ - /*border-top: 2px solid #ffaa00; - padding-bottom: 3px;*/ - border-top-left-radius: 3px; - border-top-right-radius: 3px; - background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:0.4 #343434, stop:0.2 #343434, stop:0.1 #ffaa00); +/* Styles for toolbar handles */ +QToolBar::handle { + background: url("dtt4all_data/icons/handle.png"); /* Handle icon */ } -QRadioButton::indicator:checked, QRadioButton::indicator:unchecked{ - color: #b1b1b1; - background-color: #323232; - border: 1px solid #b1b1b1; - border-radius: 6px; +/* Styles for progress bar chunks */ +QProgressBar::chunk { + background-color: #d7801a; /* Chunk color */ } -QRadioButton::indicator:checked -{ - background-color: qradialgradient( - cx: 0.5, cy: 0.5, - fx: 0.5, fy: 0.5, - radius: 1.0, - stop: 0.25 #ffaa00, - stop: 0.3 #323232 - ); +/* Styles for QRadioButton, QCheckBox, QSpinBox, and QDoubleSpinBox indicators */ +QRadioButton::indicator, +QCheckBox::indicator, +QSpinBox, +QDoubleSpinBox { + background-color: #323232; /* Background color */ + border: 1px solid #b1b1b1; /* Border */ } -QCheckBox::indicator{ - color: #e1e1e1; - background-color: #323232; - border: 1px solid #b1b1b1; - width: 9px; - height: 9px; +/* Styles for checked and unchecked QRadioButton indicators */ +QRadioButton::indicator:checked, +QRadioButton::indicator:unchecked { + background-color: #323232; /* Background color */ + border-radius: 6px; /* Rounded border */ } -QSpinBox { - color: #e1e1e1; - background-color: #323232; - border: 1px solid #b1b1b1; +/* Styles for checked QRadioButton indicators */ +QRadioButton::indicator:checked { + background-color: #ffaa00; /* Background color when checked */ } -QDoubleSpinBox { - color: #e1e1e1; - background-color: #323232; - border: 1px solid #b1b1b1; +/* Styles for hovered QRadioButton and QCheckBox indicators */ +QRadioButton::indicator:hover, +QCheckBox::indicator:hover { + border: 1px solid #ffaa00; /* Border when hovered */ } -QRadioButton::indicator -{ - border-radius: 6px; +/* Styles for checked QCheckBox indicators */ +QCheckBox::indicator:checked { + image: url("dtt4all_data/icons/checkbox.png"); /* Checkbox icon */ } -QRadioButton::indicator:hover, QCheckBox::indicator:hover -{ - border: 1px solid #ffaa00; +/* Styles for disabled QRadioButton and QCheckBox indicators */ +QCheckBox::indicator:disabled, +QRadioButton::indicator:disabled { + border: 1px solid #444; /* Border */ } -QCheckBox::indicator:checked -{ - image:url("dtt4all_data/icons/checkbox.png"); +/* Styles for list views */ +QListView { + color: #e1e1e1; /* Text color */ } -QCheckBox::indicator:disabled, QRadioButton::indicator:disabled -{ - border: 1px solid #444; +/* Styles for progress bars */ +QProgressBar { + border: 2px solid gray; /* Border */ + border-radius: 5px; /* Rounded border */ + text-align: center; /* Text alignment */ } -QToolBar { - background-color: #323232; - border-bottom: 1px solid #19232D; - padding: 2px; - font-weight: bold; - spacing: 2px; +/* Styles for progress bar chunks */ +QProgressBar::chunk { + background-color: #ffaa00; /* Chunk color */ + width: 5px; /* Width */ + margin: 0.5px; /* Margin */ } - -QListView -{ - color: #e1e1e1; -} \ No newline at end of file