[ui] improving style

This commit is contained in:
Vinicius Moreira
2020-04-28 17:51:45 -03:00
parent 6916e7d24d
commit 7c154c09ef
23 changed files with 527 additions and 274 deletions

View File

@@ -14,7 +14,7 @@ from bauh.api.abstract.cache import MemoryCache
from bauh.api.abstract.model import PackageStatus
from bauh.commons.html import strip_html
from bauh.view.qt import dialog
from bauh.view.qt.colors import DARK_GREEN, GREEN
from bauh.view.qt.colors import GREEN
from bauh.view.qt.components import IconButton
from bauh.view.qt.view_model import PackageView
from bauh.view.util import resource
@@ -301,7 +301,7 @@ class AppsTable(QTableWidget):
def uninstall():
self._uninstall_app(pkg)
style = 'color: {c}; font-size: 10px; font-weight: bold;'.format(c='#996633')
style = 'color: {c}; font-size: 10px; font-weight: bold;'.format(c='#c87137')
item = self._gen_row_button(self.i18n['uninstall'].capitalize(), style, uninstall)
else:
item = QLabel()
@@ -350,7 +350,7 @@ class AppsTable(QTableWidget):
tooltip = self.i18n['version.unknown']
if pkg.model.update:
label_version.setStyleSheet("color: {}; font-weight: bold".format(DARK_GREEN))
label_version.setStyleSheet("color: {}; font-weight: bold".format(GREEN))
tooltip = self.i18n['version.installed_outdated']
if pkg.model.installed and pkg.model.update and pkg.model.version and pkg.model.latest_version and pkg.model.version != pkg.model.latest_version:
@@ -468,27 +468,26 @@ class AppsTable(QTableWidget):
settings = self.has_any_settings(pkg)
if pkg.model.installed:
icon = QIcon(QIcon(resource.get_path('img/custom_actions.svg')).pixmap(12, 12))
bt = IconButton(icon, i18n=self.i18n, action=handle_click, tooltip=self.i18n['action.settings.tooltip'])
bt = IconButton(QIcon(resource.get_path('img/app_actions.svg')), i18n=self.i18n, action=handle_click, tooltip=self.i18n['action.settings.tooltip'])
bt.setEnabled(bool(settings))
item.addWidget(bt)
def get_info():
self.window.get_app_info(pkg)
icon = QIcon(QIcon(resource.get_path('img/app_info.svg')).pixmap(14, 14))
bt = IconButton(icon, i18n=self.i18n, action=get_info, tooltip=self.i18n['action.info.tooltip'])
bt.setEnabled(bool(pkg.model.has_info()))
item.addWidget(bt)
if not pkg.model.installed:
def get_screenshots():
self.window.get_screenshots(pkg)
bt = IconButton(QIcon(resource.get_path('img/camera.svg')), i18n=self.i18n, action=get_screenshots, tooltip=self.i18n['action.screenshots.tooltip'])
bt = IconButton(QIcon(resource.get_path('img/camera.svg')), i18n=self.i18n, action=get_screenshots,
tooltip=self.i18n['action.screenshots.tooltip'])
bt.setEnabled(bool(pkg.model.has_screenshots()))
item.addWidget(bt)
def get_info():
self.window.get_app_info(pkg)
bt = IconButton(QIcon(resource.get_path('img/app_info.svg')), i18n=self.i18n, action=get_info, tooltip=self.i18n['action.info.tooltip'])
bt.setEnabled(bool(pkg.model.has_info()))
item.addWidget(bt)
self.setCellWidget(pkg.table_index, col, item)
def change_headers_policy(self, policy: QHeaderView = QHeaderView.ResizeToContents):

View File

@@ -1,2 +1 @@
GREEN = '#68A92E'
DARK_GREEN = '#5EAA1A'
GREEN = '#91a069'

View File

@@ -14,6 +14,7 @@ from bauh.api.abstract.context import ApplicationContext
from bauh.api.abstract.controller import SoftwareManager
from bauh.api.abstract.handler import TaskManager
from bauh.view.qt import root, styles
from bauh.view.qt.colors import GREEN
from bauh.view.qt.components import new_spacer
from bauh.view.qt.qt_utils import centralize
from bauh.view.qt.thread import AnimateProgress
@@ -289,7 +290,7 @@ class PreparePanel(QWidget, TaskManager):
task['lb_sub'].setText('')
for key in ('lb_prog', 'lb_status'):
task[key].setStyleSheet('QLabel { color: #68A92E; text-decoration: line-through; }')
task[key].setStyleSheet('QLabel { color: %s; text-decoration: line-through; }' % GREEN)
task['finished'] = True
self._resize_columns()

View File

@@ -10,4 +10,3 @@ def load_icon(path: str, width: int, height: int = None) -> QIcon:
def load_resource_icon(path: str, width: int, height: int = None) -> QIcon:
return load_icon(resource.get_path(path), width, height)

View File

@@ -342,7 +342,7 @@ class ManageWindow(QWidget):
tooltip=self.i18n['manage_window.bt_settings.tooltip'])
self.ref_bt_settings = self.toolbar_bottom.addWidget(bt_settings)
bt_about = IconButton(QIcon(resource.get_path('img/app_info.svg')),
bt_about = IconButton(QIcon(resource.get_path('img/info.svg')),
action=self._show_about,
i18n=self.i18n,
tooltip=self.i18n['manage_window.settings.about'])
@@ -400,6 +400,7 @@ class ManageWindow(QWidget):
self.input_name_filter.setEnabled(False)
self.checkbox_updates.setEnabled(False)
self.table_apps.setEnabled(False)
self.setFocus(Qt.NoFocusReason)
def _update_table_and_upgrades(self, pkgs_info: dict):
self._update_table(pkgs_info=pkgs_info, signal=True)