From d2c401cb53382e73a1ca081260cbae4db02b5be7 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 23 Jun 2020 18:13:26 -0300 Subject: [PATCH] [improvement][ui] some components compatibility with the system's color scheme --- CHANGELOG.md | 2 ++ bauh/view/qt/window.py | 36 +++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16b41964..6c78f93e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - displaying the "wait cursor" over some components while performing some actions - sorting installed packages by their names - big refactoring regarding the components states (now it is easier to maintain the code) + - some components compatibility with the system's color scheme ### Fixes - AppImage @@ -41,6 +42,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Regressions (from 0.9.5): - not displaying the default type icon besides the package when its icon path does not exist (Snap runtimes were rendered without icons) + ## [0.9.5] 2020-06-07 ### Features - new custom action (**+**) to open the system backups (snapshots). It is just a shortcut to Timeshift. diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index ded0ac0b..f2f890c4 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -137,25 +137,12 @@ class ManageWindow(QWidget): self.search_bar.setStyleSheet("spacing: 0px;") self.search_bar.setContentsMargins(0, 0, 0, 0) - label_pre_search = QLabel() - label_pre_search.setStyleSheet(""" - background: white; - border-top-left-radius: 5px; - border-bottom-left-radius: 5px; - border-left: 1px solid lightgrey; - border-top: 1px solid lightgrey; - border-bottom: 1px solid lightgrey; - """) - - self.search_bar.addWidget(label_pre_search) - self.inp_search = QLineEdit() self.inp_search.setFrame(False) self.inp_search.setPlaceholderText(self.i18n['window_manage.input_search.placeholder'] + "...") self.inp_search.setToolTip(self.i18n['window_manage.input_search.tooltip']) self.inp_search.setStyleSheet("""QLineEdit { - background-color: white; - color: grey; + color: grey; spacing: 0; height: 30px; font-size: 12px; @@ -165,18 +152,33 @@ class ManageWindow(QWidget): } """) self.inp_search.returnPressed.connect(self.search) + search_background_color = self.inp_search.palette().color(self.inp_search.backgroundRole()).name() + + label_pre_search = QLabel() + label_pre_search.setStyleSheet(""" + border-top-left-radius: 5px; + border-bottom-left-radius: 5px; + border-left: 1px solid lightgrey; + border-top: 1px solid lightgrey; + border-bottom: 1px solid lightgrey; + background: %s; + """ % search_background_color) + + self.search_bar.addWidget(label_pre_search) + self.search_bar.addWidget(self.inp_search) label_pos_search = QLabel() label_pos_search.setPixmap(QIcon(resource.get_path('img/search.svg')).pixmap(QSize(10, 10))) label_pos_search.setStyleSheet(""" - background: white; padding-right: 10px; + padding-right: 10px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-right: 1px solid lightgrey; border-top: 1px solid lightgrey; border-bottom: 1px solid lightgrey; - """) + background: %s; + """ % search_background_color) self.search_bar.addWidget(label_pos_search) @@ -237,7 +239,7 @@ class ManageWindow(QWidget): self.input_name = InputFilter(self.begin_apply_filters) self.input_name.setPlaceholderText(self.i18n['manage_window.name_filter.placeholder'] + '...') self.input_name.setToolTip(self.i18n['manage_window.name_filter.tooltip']) - self.input_name.setStyleSheet("QLineEdit { background-color: white; color: gray;}") + self.input_name.setStyleSheet("QLineEdit { color: grey; }") self.input_name.setFixedWidth(130) self.input_name.sizePolicy().setRetainSizeWhenHidden(True) self.comp_manager.register_component(INP_NAME, self.input_name, self.toolbar.addWidget(self.input_name))