diff --git a/CHANGELOG.md b/CHANGELOG.md index 7066814d..89dea989 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [0.8.1] +### Improvements +- All icons are now SVG files + ## [0.8.0] 2019-12-24 ### Features - Native Web applications support: diff --git a/bauh/__init__.py b/bauh/__init__.py index 7289277f..e6a21914 100644 --- a/bauh/__init__.py +++ b/bauh/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.8.0' +__version__ = '0.8.1' __app_name__ = 'bauh' import os diff --git a/bauh/gems/appimage/model.py b/bauh/gems/appimage/model.py index e158ee81..50db2b2f 100644 --- a/bauh/gems/appimage/model.py +++ b/bauh/gems/appimage/model.py @@ -46,7 +46,7 @@ class AppImage(SoftwarePackage): return self.get_type_icon_path() def get_type_icon_path(self): - return resource.get_path('img/appimage.png', ROOT_DIR) + return resource.get_path('img/appimage.svg', ROOT_DIR) def is_application(self): return True diff --git a/bauh/gems/appimage/resources/img/appimage.png b/bauh/gems/appimage/resources/img/appimage.png deleted file mode 100755 index 059771a7..00000000 Binary files a/bauh/gems/appimage/resources/img/appimage.png and /dev/null differ diff --git a/bauh/gems/appimage/resources/img/appimage.svg b/bauh/gems/appimage/resources/img/appimage.svg new file mode 100644 index 00000000..f9cb7968 --- /dev/null +++ b/bauh/gems/appimage/resources/img/appimage.svg @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bauh/gems/arch/confirmation.py b/bauh/gems/arch/confirmation.py index 544c9ef3..9c53f7fb 100644 --- a/bauh/gems/arch/confirmation.py +++ b/bauh/gems/arch/confirmation.py @@ -9,7 +9,7 @@ from bauh.view.util.translation import I18n def _get_mirror_icon(mirror: str): - return resource.get_path('img/{}.png'.format('arch' if mirror == 'aur' else 'mirror'), ROOT_DIR) + return resource.get_path('img/{}.svg'.format('arch' if mirror == 'aur' else 'mirror'), ROOT_DIR) def request_optional_deps(pkgname: str, pkg_mirrors: dict, watcher: ProcessWatcher, i18n: I18n) -> Set[str]: diff --git a/bauh/gems/arch/model.py b/bauh/gems/arch/model.py index 62d6d5fb..70d02d62 100644 --- a/bauh/gems/arch/model.py +++ b/bauh/gems/arch/model.py @@ -61,7 +61,7 @@ class ArchPackage(SoftwarePackage): return self.icon_path def get_type_icon_path(self): - return resource.get_path('img/arch.png', ROOT_DIR) # TODO change icon when from mirrors + return resource.get_path('img/arch.svg', ROOT_DIR) # TODO change icon when from mirrors def is_application(self): return self.can_be_run() diff --git a/bauh/gems/arch/resources/img/arch.png b/bauh/gems/arch/resources/img/arch.png deleted file mode 100755 index c1e2fb1f..00000000 Binary files a/bauh/gems/arch/resources/img/arch.png and /dev/null differ diff --git a/bauh/gems/arch/resources/img/arch.svg b/bauh/gems/arch/resources/img/arch.svg new file mode 100644 index 00000000..69267f5c --- /dev/null +++ b/bauh/gems/arch/resources/img/arch.svg @@ -0,0 +1,57 @@ + +image/svg+xml \ No newline at end of file diff --git a/bauh/gems/arch/resources/img/mirror.png b/bauh/gems/arch/resources/img/mirror.png deleted file mode 100755 index b4d85c0d..00000000 Binary files a/bauh/gems/arch/resources/img/mirror.png and /dev/null differ diff --git a/bauh/gems/arch/resources/img/mirror.svg b/bauh/gems/arch/resources/img/mirror.svg new file mode 100644 index 00000000..74336f2b --- /dev/null +++ b/bauh/gems/arch/resources/img/mirror.svg @@ -0,0 +1,55 @@ + +image/svg+xml \ No newline at end of file diff --git a/bauh/gems/flatpak/model.py b/bauh/gems/flatpak/model.py index 50e70665..4a95c7ff 100644 --- a/bauh/gems/flatpak/model.py +++ b/bauh/gems/flatpak/model.py @@ -36,7 +36,7 @@ class FlatpakApplication(SoftwarePackage): return 'flatpak' def get_default_icon_path(self): - return resource.get_path('img/flathub.svg', ROOT_DIR) + return resource.get_path('img/flatpak.svg', ROOT_DIR) def get_type_icon_path(self): return self.get_default_icon_path() diff --git a/bauh/gems/flatpak/resources/img/flatpak.png b/bauh/gems/flatpak/resources/img/flatpak.png deleted file mode 100755 index 4fa5bb94..00000000 Binary files a/bauh/gems/flatpak/resources/img/flatpak.png and /dev/null differ diff --git a/bauh/gems/flatpak/resources/img/flathub.svg b/bauh/gems/flatpak/resources/img/flatpak.svg old mode 100755 new mode 100644 similarity index 97% rename from bauh/gems/flatpak/resources/img/flathub.svg rename to bauh/gems/flatpak/resources/img/flatpak.svg index 1b44a5d4..1a17bd92 --- a/bauh/gems/flatpak/resources/img/flathub.svg +++ b/bauh/gems/flatpak/resources/img/flatpak.svg @@ -9,13 +9,13 @@ 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" - width="47.919052" - height="48.110374" - viewBox="0 0 12.678582 12.729203" + width="24.007744" + height="23.836931" + viewBox="0 0 6.3520486 6.3068546" version="1.1" id="svg3871" - inkscape:version="0.92.3 (2405546, 2018-03-11)" - sodipodi:docname="flathub.svg"> + inkscape:version="0.92.4 5da689c313, 2019-01-14" + sodipodi:docname="flatpak.svg"> + transform="translate(-12.150001,-173.82134)"> + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/bauh/gems/web/controller.py b/bauh/gems/web/controller.py index 0a922658..435e0570 100644 --- a/bauh/gems/web/controller.py +++ b/bauh/gems/web/controller.py @@ -411,7 +411,7 @@ class WebApplicationManager(SoftwareManager): default_option=icon_op_disp if app.icon_url and app.save_icon else icon_op_ded, label=self.i18n['web.install.option.wicon.label']) - icon_chooser = FileChooserComponent(allowed_extensions={'png', 'svg', 'ico'}, label=self.i18n['web.install.option.icon.label']) + icon_chooser = FileChooserComponent(allowed_extensions={'png', 'svg', 'ico', 'xpm'}, label=self.i18n['web.install.option.icon.label']) form_1 = FormComponent(components=[inp_url, inp_name, inp_desc, inp_cat, inp_icon, icon_chooser, inp_tray], label=self.i18n['web.install.options.basic'].capitalize()) @@ -506,7 +506,7 @@ class WebApplicationManager(SoftwareManager): def _ask_update_permission(self, to_update: List[EnvironmentComponent], watcher: ProcessWatcher) -> bool: - icon = resource.get_path('img/web.png', ROOT_DIR) + icon = resource.get_path('img/web.svg', ROOT_DIR) opts = [InputOption(label='{} ( {} )'.format(f.name, f.size or '?'), tooltip=f.url, icon_path=icon, read_only=True, value=f.name) for f in to_update] diff --git a/bauh/gems/web/model.py b/bauh/gems/web/model.py index 46bd35df..be82babc 100644 --- a/bauh/gems/web/model.py +++ b/bauh/gems/web/model.py @@ -54,7 +54,7 @@ class WebApplication(SoftwarePackage): return self.get_default_icon_path() def get_default_icon_path(self) -> str: - return resource.get_path('img/web.png', ROOT_DIR) + return resource.get_path('img/web.svg', ROOT_DIR) def get_disk_data_path(self) -> str: return '{}/data.yml'.format(self.get_disk_cache_path()) diff --git a/bauh/gems/web/resources/img/web.png b/bauh/gems/web/resources/img/web.png deleted file mode 100644 index 2e6fb51c..00000000 Binary files a/bauh/gems/web/resources/img/web.png and /dev/null differ diff --git a/bauh/gems/web/resources/img/web.svg b/bauh/gems/web/resources/img/web.svg new file mode 100644 index 00000000..c6c54485 --- /dev/null +++ b/bauh/gems/web/resources/img/web.svg @@ -0,0 +1,112 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/bauh/view/qt/about.py b/bauh/view/qt/about.py index e553c1a0..abc2e3c1 100644 --- a/bauh/view/qt/about.py +++ b/bauh/view/qt/about.py @@ -55,7 +55,7 @@ class AboutDialog(QDialog): gems_widget.layout().addWidget(QLabel()) for gem_path in available_gems: icon = QLabel() - pxmap = QPixmap(gem_path + '/resources/img/{}.png'.format(gem_path.split('/')[-1])) + pxmap = QPixmap(gem_path + '/resources/img/{}.svg'.format(gem_path.split('/')[-1])) icon.setPixmap(pxmap.scaled(24, 24, Qt.KeepAspectRatio, Qt.SmoothTransformation)) gems_widget.layout().addWidget(icon) gems_widget.layout().addWidget(QLabel()) diff --git a/bauh/view/qt/apps_table.py b/bauh/view/qt/apps_table.py index 2a68cda1..1c727602 100644 --- a/bauh/view/qt/apps_table.py +++ b/bauh/view/qt/apps_table.py @@ -14,6 +14,7 @@ from bauh.commons.html import strip_html from bauh.view.qt import dialog from bauh.view.qt.components import IconButton from bauh.view.qt.view_model import PackageView, PackageViewStatus +from bauh.view.qt.view_utils import load_icon from bauh.view.util import resource from bauh.view.util.translation import I18n @@ -426,26 +427,26 @@ class AppsTable(QTableWidget): def run(): self.window.run_app(pkg) - item.addWidget(IconButton(icon_path=resource.get_path('img/app_play.png'), action=run, background='#088A08', tooltip=self.i18n['action.run.tooltip'])) + item.addWidget(IconButton(load_icon(resource.get_path('img/app_play.svg'), 12), action=run, background='#088A08', tooltip=self.i18n['action.run.tooltip'])) if pkg.model.has_info(): def get_info(): self.window.get_app_info(pkg) - item.addWidget(IconButton(icon_path=resource.get_path('img/app_info.svg'), action=get_info, background='#2E68D3', tooltip=self.i18n['action.info.tooltip'])) + item.addWidget(IconButton(QIcon(resource.get_path('img/app_info.svg')), action=get_info, background='#2E68D3', tooltip=self.i18n['action.info.tooltip'])) if pkg.model.has_screenshots(): def get_screenshots(): self.window.get_screenshots(pkg) - item.addWidget(IconButton(icon_path=resource.get_path('img/camera.svg'), action=get_screenshots, background='purple', tooltip=self.i18n['action.screenshots.tooltip'])) + item.addWidget(IconButton(QIcon(resource.get_path('img/camera.svg')), action=get_screenshots, background='purple', tooltip=self.i18n['action.screenshots.tooltip'])) def handle_click(): self.show_pkg_settings(pkg) if self.has_any_settings(pkg): - bt = IconButton(icon_path=resource.get_path('img/app_settings.svg'), action=handle_click, background='#12ABAB', tooltip=self.i18n['action.settings.tooltip']) + bt = IconButton(QIcon(resource.get_path('img/app_settings.svg')), action=handle_click, background='#12ABAB', tooltip=self.i18n['action.settings.tooltip']) item.addWidget(bt) self.setCellWidget(pkg.table_index, col, item) diff --git a/bauh/view/qt/components.py b/bauh/view/qt/components.py index 5f6e4e30..dd7b2da2 100644 --- a/bauh/view/qt/components.py +++ b/bauh/view/qt/components.py @@ -8,7 +8,7 @@ from PyQt5.QtWidgets import QRadioButton, QGroupBox, QCheckBox, QComboBox, QGrid from bauh.api.abstract.view import SingleSelectComponent, InputOption, MultipleSelectComponent, SelectViewType, \ TextInputComponent, FormComponent, FileChooserComponent -from bauh.view.qt import css +from bauh.view.qt import css, view_utils from bauh.view.util import resource from bauh.view.util.translation import I18n @@ -182,8 +182,9 @@ class MultipleSelectQt(QGroupBox): for op in model.options: # loads the help icon if at least one option has a tooltip if op.tooltip: - with open(resource.get_path('img/help.png'), 'rb') as f: + with open(resource.get_path('img/about.svg'), 'rb') as f: pixmap_help.loadFromData(f.read()) + pixmap_help = pixmap_help.scaled(16, 16, Qt.KeepAspectRatio, Qt.SmoothTransformation) break for op in model.options: @@ -240,10 +241,10 @@ class InputFilter(QLineEdit): class IconButton(QWidget): - def __init__(self, icon_path: str, action, background: str = None, align: int = Qt.AlignCenter, tooltip: str = None): + def __init__(self, icon: QIcon, action, background: str = None, align: int = Qt.AlignCenter, tooltip: str = None): super(IconButton, self).__init__() self.bt = QToolButton() - self.bt.setIcon(QIcon(icon_path)) + self.bt.setIcon(icon) self.bt.clicked.connect(action) if background: diff --git a/bauh/view/qt/gem_selector.py b/bauh/view/qt/gem_selector.py index e8bf9dae..15f4b5a3 100644 --- a/bauh/view/qt/gem_selector.py +++ b/bauh/view/qt/gem_selector.py @@ -49,7 +49,7 @@ class GemSelectorPanel(QWidget): op = InputOption(label=i18n.get('gem.{}.label'.format(modname), modname.capitalize()), tooltip=i18n.get('gem.{}.info'.format(modname)), value=modname, - icon_path='{r}/gems/{n}/resources/img/{n}.png'.format(r=ROOT_DIR, n=modname)) + icon_path='{r}/gems/{n}/resources/img/{n}.svg'.format(r=ROOT_DIR, n=modname)) gem_options.append(op) self.gem_map[modname] = m diff --git a/bauh/view/qt/root.py b/bauh/view/qt/root.py index 37d9c1e9..95459bf8 100644 --- a/bauh/view/qt/root.py +++ b/bauh/view/qt/root.py @@ -19,7 +19,7 @@ def ask_root_password(i18n: I18n): diag.setStyleSheet("""QLineEdit { border-radius: 5px; font-size: 16px; border: 1px solid lightblue }""") diag.setInputMode(QInputDialog.TextInput) diag.setTextEchoMode(QLineEdit.Password) - diag.setWindowIcon(QIcon(resource.get_path('img/lock.png'))) + diag.setWindowIcon(QIcon(resource.get_path('img/lock.svg'))) diag.setWindowTitle(i18n['popup.root.title']) diag.setLabelText('') diag.setOkButtonText(i18n['popup.root.continue'].capitalize()) diff --git a/bauh/view/qt/systray.py b/bauh/view/qt/systray.py index dfd986b0..74a10c6b 100755 --- a/bauh/view/qt/systray.py +++ b/bauh/view/qt/systray.py @@ -47,7 +47,7 @@ class TrayIcon(QSystemTrayIcon): self.icon_default = QIcon.fromTheme('bauh_tray_default') if self.icon_default.isNull(): - self.icon_default = QIcon(resource.get_path('img/logo.png')) + self.icon_default = QIcon(resource.get_path('img/logo.svg')) if config['ui']['tray']['updates_icon']: self.icon_updates = QIcon(config['ui']['tray']['updates_icon']) @@ -55,7 +55,7 @@ class TrayIcon(QSystemTrayIcon): self.icon_updates = QIcon.fromTheme('bauh_tray_updates') if self.icon_updates.isNull(): - self.icon_updates = QIcon(resource.get_path('img/logo_update.png')) + self.icon_updates = QIcon(resource.get_path('img/logo_update.svg')) self.setIcon(self.icon_default) diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index 3d89f659..1e9bbd40 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -185,7 +185,7 @@ class ManageWindow(QWidget): self.bt_installed = QPushButton() self.bt_installed.setToolTip(self.i18n['manage_window.bt.installed.tooltip']) - self.bt_installed.setIcon(QIcon(resource.get_path('img/disk.png'))) + self.bt_installed.setIcon(QIcon(resource.get_path('img/disk.svg'))) self.bt_installed.setText(self.i18n['manage_window.bt.installed.text'].capitalize()) self.bt_installed.clicked.connect(self._show_installed) self.bt_installed.setStyleSheet(toolbar_button_style('#A94E0A')) @@ -318,7 +318,7 @@ class ManageWindow(QWidget): self.combo_styles.setStyleSheet('QComboBox {font-size: 12px;}') self.ref_combo_styles = self.toolbar_bottom.addWidget(self.combo_styles) - bt_settings = IconButton(icon_path=resource.get_path('img/app_settings.svg'), + bt_settings = IconButton(QIcon(resource.get_path('img/app_settings.svg')), action=self._show_settings_menu, background='#12ABAB', tooltip=self.i18n['manage_window.bt_settings.tooltip']) diff --git a/bauh/view/resources/img/app_play.png b/bauh/view/resources/img/app_play.png deleted file mode 100755 index b98062b5..00000000 Binary files a/bauh/view/resources/img/app_play.png and /dev/null differ diff --git a/bauh/view/resources/img/app_play.svg b/bauh/view/resources/img/app_play.svg new file mode 100755 index 00000000..a46bfd74 --- /dev/null +++ b/bauh/view/resources/img/app_play.svg @@ -0,0 +1,120 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bauh/view/resources/img/disk.png b/bauh/view/resources/img/disk.png deleted file mode 100755 index c9c5d790..00000000 Binary files a/bauh/view/resources/img/disk.png and /dev/null differ diff --git a/bauh/view/resources/img/disc.svg b/bauh/view/resources/img/disk.svg similarity index 59% rename from bauh/view/resources/img/disc.svg rename to bauh/view/resources/img/disk.svg index f3ca7d18..a3fa07a0 100755 --- a/bauh/view/resources/img/disc.svg +++ b/bauh/view/resources/img/disk.svg @@ -13,13 +13,12 @@ id="Capa_1" x="0px" y="0px" - viewBox="0 0 24 24" + viewBox="0 0 24.000261 23.700262" xml:space="preserve" - sodipodi:docname="disc_2.svg" - width="24" - height="24" + sodipodi:docname="disc.svg" + width="24.000261" + height="23.700262" inkscape:version="0.92.4 5da689c313, 2019-01-14" - inkscape:export-filename="/home/vinicius.moreira/shared_vb/disk_2.png" inkscape:export-xdpi="96" inkscape:export-ydpi="96"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + transform="translate(-8.9953185,-22.380568)"> + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bauh/view/resources/img/logo.png b/bauh/view/resources/img/logo.png deleted file mode 100644 index c557b4c3..00000000 Binary files a/bauh/view/resources/img/logo.png and /dev/null differ diff --git a/bauh/view/resources/img/logo_update.png b/bauh/view/resources/img/logo_update.png deleted file mode 100644 index 6941519b..00000000 Binary files a/bauh/view/resources/img/logo_update.png and /dev/null differ