[ui][settings] settings icon

This commit is contained in:
Vinícius Moreira
2020-01-27 19:26:37 -03:00
parent ab8b7d5f0b
commit c31769705c
11 changed files with 106 additions and 23 deletions

View File

@@ -167,11 +167,12 @@ class FileChooserComponent(ViewComponent):
class TabComponent(ViewComponent):
def __init__(self, label: str, content: ViewComponent, icon_path: str = None, id_: str = None):
def __init__(self, label: str, content: ViewComponent, icon_path: str = None, tooltip: str = None, id_: str = None):
super(TabComponent, self).__init__(id_=id_)
self.label = label
self.content = content
self.icon_path = icon_path
self.tooltip = tooltip
class TabGroupComponent(ViewComponent):

View File

@@ -609,7 +609,8 @@ class GenericSoftwareManager(SoftwareManager):
if man_comp:
modname = man.__module__.split('.')[-2]
icon_path = "{r}/gems/{n}/resources/img/{n}.svg".format(r=ROOT_DIR, n=modname)
tabs.append(TabComponent(None, man_comp, icon_path, modname))
tabs.append(TabComponent(label=None, content=man_comp, icon_path=icon_path,
tooltip=modname.capitalize(), id_=modname))
return TabGroupComponent(tabs)

View File

@@ -12,13 +12,14 @@ from bauh.view.util.translation import I18n
class SettingsWindow(QWidget):
def __init__(self, manager: SoftwareManager, i18n: I18n, screen_size: QSize, parent: QWidget = None):
def __init__(self, manager: SoftwareManager, i18n: I18n, screen_size: QSize, tray: bool, parent: QWidget = None):
super(SettingsWindow, self).__init__(parent=parent)
self.setWindowTitle(i18n['settings'].capitalize())
self.setLayout(QVBoxLayout())
self.manager = manager
self.i18n = i18n
self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
self.tray = tray
self.settings_model = self.manager.get_settings()

View File

@@ -316,10 +316,6 @@ class ManageWindow(QWidget):
self.toolbar_bottom.addWidget(new_spacer())
self.combo_styles = StylesComboBox(parent=self, i18n=i18n, show_panel_after_restart=bool(tray_icon))
self.combo_styles.setStyleSheet('QComboBox {font-size: 12px;}')
self.ref_combo_styles = self.toolbar_bottom.addWidget(self.combo_styles)
bt_settings = IconButton(QIcon(resource.get_path('img/app_settings.svg')),
action=self._show_settings_menu,
background='#12ABAB',
@@ -350,7 +346,7 @@ class ManageWindow(QWidget):
def set_tray_icon(self, tray_icon):
self.tray_icon = tray_icon
self.combo_styles.show_panel_after_restart = bool(tray_icon)
# self.combo_styles.show_panel_after_restart = bool(tray_icon)
def _update_process_progress(self, val: int):
if self.progress_controll_enabled:
@@ -913,7 +909,6 @@ class ManageWindow(QWidget):
self.thread_animate_progress.stop = False
self.thread_animate_progress.start()
self.ref_progress_bar.setVisible(True)
self.ref_combo_styles.setVisible(False)
self.label_status.setText(action_label + "...")
self.ref_bt_upgrade.setVisible(False)
@@ -943,7 +938,6 @@ class ManageWindow(QWidget):
self.combo_filter_type.setEnabled(False)
def finish_action(self, keep_filters: bool = False):
self.ref_combo_styles.setVisible(True)
self.thread_animate_progress.stop = True
self.thread_animate_progress.wait(msecs=1000)
self.ref_progress_bar.setVisible(False)
@@ -1166,7 +1160,7 @@ class ManageWindow(QWidget):
gem_panel.show()
def show_settings_window(self):
self.settings_window = SettingsWindow(self.manager, self.i18n, self.screen_size)
self.settings_window = SettingsWindow(self.manager, self.i18n, self.screen_size, bool(self.tray_icon))
self.settings_window.setMinimumWidth(int(self.screen_size.width() / 4))
self.settings_window.resize(self.size())
self.settings_window.adjustSize()
@@ -1185,6 +1179,7 @@ class ManageWindow(QWidget):
action_settings = QAction(self.i18n['settings'].capitalize())
action_settings.triggered.connect(self.show_settings_window)
action_settings.setIcon(QIcon(resource.get_path('img/tools.svg')))
menu_row.addAction(action_settings)
action_about = QAction(self.i18n['manage_window.settings.about'])

View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="512.00006"
viewBox="0 0 383.99996 384.37057"
width="511.99994"
version="1.1"
id="svg4610"
sodipodi:docname="customer-support_2.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<metadata
id="metadata4616">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4614" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1360"
inkscape:window-height="703"
id="namedview4612"
showgrid="false"
showborder="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
units="px"
inkscape:zoom="0.16904657"
inkscape:cx="1544.1159"
inkscape:cy="-68.837126"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4610" />
<g
id="g4636"
transform="matrix(0.71430651,0,0,0.75810267,1364.318,373.14432)">
<ellipse
ry="253.1329"
rx="268.67615"
cy="-238.69989"
cx="-1641.1974"
id="path4620"
style="fill:#b3b3b3;fill-opacity:1;stroke:#ffffff;stroke-width:0.75072366" />
<g
transform="matrix(0.86135478,0,0,0.86135478,-1800.0393,-561.71381)"
id="g4627">
<path
d="m 1.1190198,220.85955 25.6150732,44.82226 c 0.864022,1.51463 2.310204,2.61043 4.001367,3.03452 l 23.897568,5.97419 81.963492,81.9608 9.05642,-9.05349 -83.246353,-83.24098 c -0.81924,-0.82185 -1.846583,-1.40399 -2.971391,-1.68584 l -22.962422,-5.76083 -21.808639,-38.18427 18.697635,-18.69702 38.201336,21.82899 5.763655,22.96167 c 0.279227,1.1274 0.864022,2.15735 1.683262,2.97656 l 83.246357,83.24361 9.05378,-9.05612 -81.963491,-81.96079 -5.974392,-23.88361 c -0.424108,-1.69374 -1.51994,-3.14251 -3.034612,-4.00914 L 35.511286,186.51847 c -2.499867,-1.42243 -5.645115,-1.00097 -7.683995,1.02994 L 2.2148518,213.16264 c -2.05995369,2.02564 -2.50776946,5.17605 -1.095832,7.69691 z m 0,0"
id="path4600"
inkscape:connector-curvature="0"
style="stroke-width:0.67434704" />
<path
d="M 267.34562,311.82641 126.47061,452.6994 117.41419,443.64328 258.29183,302.77293 Z m 0,0"
id="path4602"
inkscape:connector-curvature="0"
style="stroke-width:0.67434704" />
<path
d="m 101.81439,457.68317 c -1.15905,-1.92818 -3.240078,-3.10563 -5.489695,-3.10563 H 57.904719 c -2.246982,0 -4.330644,1.17745 -5.487063,3.10563 l -19.211305,32.01515 c -1.21964,2.02827 -1.21964,4.56494 0,6.59585 l 19.211305,32.01515 c 1.156419,1.92554 3.240081,3.10563 5.487063,3.10563 h 38.419976 c 2.249617,0 4.330645,-1.18009 5.489695,-3.10563 l 19.20867,-32.01515 c 1.21964,-2.03091 1.21964,-4.56758 0,-6.59585 z m -9.111735,60.92467 H 61.529394 l -15.367991,-25.6116 15.367991,-25.61422 h 31.173261 l 15.367985,25.61422 z m 0,0"
id="path4604"
inkscape:connector-curvature="0"
style="stroke-width:0.67434704" />
<path
d="m 307.63852,339.31877 c 42.29226,0.14225 76.69507,-34.02762 76.83731,-76.31849 0.0211,-6.4378 -0.76919,-12.84926 -2.35235,-19.0895 -0.85348,-3.43227 -4.32801,-5.52113 -7.76038,-4.66767 -1.12745,0.28185 -2.15479,0.86399 -2.97666,1.6832 l -39.86089,39.83324 -31.62635,-10.53914 -10.54738,-31.6174 39.86089,-39.86747 c 2.49987,-2.50242 2.49723,-6.55634 -0.005,-9.05612 -0.82451,-0.82449 -1.86239,-1.40926 -2.99773,-1.68848 -41.01468,-10.38635 -82.68,14.44027 -93.0667,55.45096 -1.57789,6.2218 -2.36552,12.61746 -2.34445,19.03682 0.0158,5.04172 0.53475,10.06762 1.55682,15.00397 L 92.117859,417.71296 c -4.936512,-1.01941 -9.962588,-1.53833 -15.001835,-1.55677 -42.439783,0 -76.842586,34.40167 -76.842586,76.84005 0,42.43575 34.402803,76.83742 76.842586,76.83742 42.437146,0 76.839956,-34.40167 76.839956,-76.83742 -0.0158,-5.04171 -0.53738,-10.06762 -1.55682,-15.00397 l 33.57302,-33.57192 14.6831,14.68261 c 2.5025,2.49979 6.55392,2.49979 9.05642,0 l 3.20057,-3.2031 c 2.80807,-2.78953 7.34681,-2.78953 10.15488,0 2.80544,2.79744 2.81071,7.33868 0.0132,10.14402 -0.003,0.003 -0.008,0.008 -0.0132,0.0131 l -3.20056,3.20046 c -2.49987,2.49979 -2.49987,6.5537 0,9.05349 l 76.38686,76.38435 c 20.09114,20.27485 52.81331,20.42236 73.08884,0.33189 20.27289,-20.09046 20.42041,-52.8142 0.32927,-73.08642 -0.108,-0.11063 -0.21863,-0.22126 -0.32927,-0.3319 l -76.38687,-76.3817 c -2.49987,-2.49978 -6.55392,-2.49978 -9.05378,0 l -3.20057,3.20047 c -2.81071,2.79217 -7.34682,2.79217 -10.15752,0 -2.8028,-2.79744 -2.81071,-7.33868 -0.0132,-10.14138 0.005,-0.005 0.0105,-0.008 0.0132,-0.0131 l 3.2032,-3.2031 c 2.49987,-2.49978 2.49987,-6.5537 0,-9.05349 l -14.6831,-14.68261 33.57303,-33.57191 c 4.93651,1.0194 9.96259,1.54095 15.00184,1.55676 z m 25.15935,217.71041 c -4.65202,-0.008 -9.26452,-0.84819 -13.61887,-2.48398 l 50.0105,-50.01149 c 7.54702,20.07466 -2.60787,42.46472 -22.68319,50.01149 -4.3807,1.64633 -9.02481,2.48925 -13.70844,2.48398 z M 260.25432,390.60782 c -7.0913,8.45817 -5.97966,21.06509 2.47879,28.15352 7.43375,6.22971 18.26826,6.22443 25.6941,-0.0185 l 71.86129,71.92214 c 0.77973,0.78233 1.50941,1.60681 2.21538,2.44447 l -54.74946,54.74764 c -0.84031,-0.70331 -1.66482,-1.43296 -2.44718,-2.21529 l -71.91661,-71.91948 c 7.0913,-8.45817 5.97966,-21.06509 -2.4788,-28.15352 -7.43374,-6.23234 -18.27089,-6.22444 -25.69673,0.0158 l -10.24445,-10.24412 55.03658,-54.9531 z m 25.85742,-64.40172 -145.2636,145.22983 c -1.5937,1.59101 -2.23381,3.90114 -1.69116,6.08483 8.78509,34.49913 -12.06206,69.58831 -46.564962,78.37048 -34.50027,8.78481 -69.590603,-12.06166 -78.375698,-46.56343 -8.782462,-34.49912 12.064689,-69.5883 46.567592,-78.3731 10.436747,-2.6552 21.371359,-2.6552 31.808106,0 2.183761,0.53472 4.488696,-0.10537 6.085028,-1.68848 L 243.9064,284.03376 c 1.59106,-1.59101 2.23118,-3.90114 1.68326,-6.08219 -8.72451,-34.09611 11.84342,-68.80861 45.94065,-77.53546 6.44328,-1.64633 13.10784,-2.27852 19.74605,-1.86496 l -33.77849,33.79055 c -1.71487,1.71218 -2.31547,4.24884 -1.54892,6.54843 l 12.8049,38.42135 c 0.64012,1.90974 2.14162,3.41119 4.05405,4.04601 l 38.42262,12.80711 c 2.29703,0.76653 4.83377,0.16859 6.54864,-1.54359 l 33.7785,-33.77738 c 0.0764,1.22223 0.11591,2.4313 0.11591,3.63509 0.17912,35.184 -28.19661,63.85118 -63.38177,64.03294 -5.43965,0.0264 -10.86085,-0.64273 -16.12928,-1.9914 -2.18376,-0.54526 -4.49396,0.0922 -6.08503,1.6832 h 0.0342 z m 0,0"
id="path4606"
inkscape:connector-curvature="0"
style="stroke-width:0.67434704" />
<path
d="m 331.3833,507.67622 -9.05642,9.05612 -64.03242,-64.0303 9.05379,-9.05612 z m 0,0"
id="path4608"
inkscape:connector-curvature="0"
style="stroke-width:0.67434704" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@@ -122,8 +122,6 @@ change=modifica
exit=surt
manage_window.settings.gems=Tipus daplicacions
style=estil
style.change.title=Canvi destil
style.change.question=Cal reiniciar el {} per a canviar-ne lestil. Voleu continuar?
manage_window.bt_settings.tooltip=Feu clic aquí per a obrir accions addicionals
downloading=Sestà baixant
console.install_logs.path=Trobareu registres dinstal·lació a {}

View File

@@ -122,8 +122,6 @@ change=Verändern
exit=Beenden
manage_window.settings.gems=Anwendungsarten
style=Stil
style.change.title=Stil ändern
style.change.question=Um den aktuellen Stil zu ändern ist ein Neustart von {} nötig. Fortfahren?
manage_window.bt_settings.tooltip=Für mehr Optionen hier klicken
downloading=Herunterladen
console.install_logs.path=Logs der Installationen können unter {} gefunden werden

View File

@@ -122,8 +122,6 @@ change=change
exit=exit
manage_window.settings.gems=Application types
style=style
style.change.title=Style change
style.change.question=To change the current style is necessary to restart {}. Proceed ?
manage_window.bt_settings.tooltip=Click here to open extra actions
downloading=Downloading
console.install_logs.path=Installation logs can be found at {}

View File

@@ -122,8 +122,6 @@ change=cambiar
exit=salir
manage_window.settings.gems=Tipos de aplicaciones
style=estilo
style.change.title=Cambio de estilo
style.change.question=Para cambiar el estilo actual es necesario reiniciar {}. ¿Quiere proceder?
manage_window.bt_settings.tooltip=Pulse aquí para abrir acciones adicionales
downloading=Descargando
console.install_logs.path=Los registros de instalación pueden encontrarse en {}

View File

@@ -122,8 +122,6 @@ change=Cambia
exit=esci
manage_window.settings.gems=Tipi di applicazione
style=stile
style.change.title=Cambia stile
style.change.question=Per modificare lo stile corrente è necessario riavviare {}. Procedere ?
manage_window.bt_settings.tooltip=Fai clic qui per aprire ulteriori azioni
downloading=Scaricamento
console.install_logs.path=I registri di installazione sono disponibili all'indirizzo {}

View File

@@ -122,8 +122,6 @@ change=alterar
exit=sair
manage_window.settings.gems=Tipos de aplicativos
style=estilo
style.change.title=Mudança de estilo
style.change.question=Para alterar o estilo atual é necessário reiniciar o {}. Continuar ?
manage_window.bt_settings.tooltip=Clique aqui para abrir ações adicionais
downloading=Baixando
console.install_logs.path=Os registros de instalação podem ser encontrados em {}