diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ad5de6f..ad53c304 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - configuration file ( **flatpak.yml** ) will be created during the initialization ( on 0.8.1 it would only be created during the first app installation ) - AUR: - downgrading time reduced due to the fix described in ***Fixes***. -- UI: - - it's possible to disabled the HDPI improvements via the main configuration file ( **~/.config/bauh/config.yml** ): +- Configuration ( **~/.config/bauh/config.yml** ) + - new property **hdpi** allowing to disable HDPI improvements ``` ui: - hdpi: true # 'false' will disable them + hdpi: true # enabled by default ``` + - new property **auto_scale** that activates Qt auto screen scale factor (QT_AUTO_SCREEN_SCALE_FACTOR). It fixes scaling issues + for some desktop environments ( like Gnome ) [#1](https://github.com/vinifmor/bauh/issues/1) + ``` + ui: + auto_scale: false # disabled by default ### Fixes - AUR: - not treating **makedepends** as a list during dependency checking ( **anbox-git** installation was crashing ) diff --git a/bauh/app.py b/bauh/app.py index a1f95bca..6b6b11e6 100755 --- a/bauh/app.py +++ b/bauh/app.py @@ -34,6 +34,10 @@ def main(): local_config = config.read_config(update_file=True) + if local_config['ui']['auto_scale']: + os.environ['QT_AUTO_SCREEN_SCALE_FACTOR'] = '1' + logger.info("Auto screen scale factor enabled") + i18n_key, current_i18n = translation.get_locale_keys(local_config['locale']) default_i18n = translation.get_locale_keys(DEFAULT_I18N_KEY)[1] if i18n_key != DEFAULT_I18N_KEY else {} i18n = I18n(i18n_key, current_i18n, DEFAULT_I18N_KEY, default_i18n) diff --git a/bauh/view/core/config.py b/bauh/view/core/config.py index 14716bc7..c8c1e8e1 100644 --- a/bauh/view/core/config.py +++ b/bauh/view/core/config.py @@ -44,7 +44,8 @@ def read_config(update_file: bool = False) -> dict: 'updates_icon': None }, 'style': None, - 'hdpi': True + 'hdpi': True, + "auto_scale": False }, 'download': { diff --git a/bauh/view/core/controller.py b/bauh/view/core/controller.py index 801f620b..d28b6c5f 100755 --- a/bauh/view/core/controller.py +++ b/bauh/view/core/controller.py @@ -535,12 +535,17 @@ class GenericSoftwareManager(SoftwareManager): default_width = floor(0.11 * screen_width) select_hdpi = self._gen_bool_component(label=self.i18n['core.config.ui.hdpi'], - tooltip=self.i18n['core.config.ui.hdpi.tip'].format( - app=self.context.app_name), + tooltip=self.i18n['core.config.ui.hdpi.tip'], value=bool(core_config['ui']['hdpi']), max_width=default_width, id_='hdpi') + select_ascale = self._gen_bool_component(label=self.i18n['core.config.ui.auto_scale'], + tooltip=self.i18n['core.config.ui.auto_scale.tip'].format('QT_AUTO_SCREEN_SCALE_FACTOR'), + value=bool(core_config['ui']['auto_scale']), + max_width=default_width, + id_='auto_scale') + cur_style = QApplication.instance().style().objectName().lower() if not core_config['ui']['style'] else core_config['ui']['style'] style_opts = [InputOption(label=s.capitalize(), value=s.lower()) for s in QStyleFactory.keys()] select_style = SingleSelectComponent(label=self.i18n['style'].capitalize(), @@ -563,7 +568,7 @@ class GenericSoftwareManager(SoftwareManager): max_width=default_width, value=core_config['download']['icons']) - sub_comps = [FormComponent([select_hdpi, select_dicons, select_style, input_maxd], spaces=False)] + sub_comps = [FormComponent([select_hdpi, select_ascale, select_dicons, select_style, input_maxd], spaces=False)] return TabComponent(self.i18n['core.config.tab.ui'].capitalize(), PanelComponent(sub_comps), None, 'core.ui') def _save_settings(self, general: PanelComponent, @@ -618,6 +623,7 @@ class GenericSoftwareManager(SoftwareManager): core_config['download']['icons'] = ui_form.get_component('down_icons').get_selected() core_config['ui']['hdpi'] = ui_form.get_component('hdpi').get_selected() + core_config['ui']['auto_scale'] = ui_form.get_component('auto_scale').get_selected() core_config['ui']['table']['max_displayed'] = ui_form.get_component('table_max').get_int_value() style = ui_form.get_component('style').get_selected() diff --git a/bauh/view/resources/locale/ca b/bauh/view/resources/locale/ca index 0839353f..328f2a2e 100644 --- a/bauh/view/resources/locale/ca +++ b/bauh/view/resources/locale/ca @@ -252,6 +252,8 @@ core.config.system.dep_checking.tip=If the availability checking of your system core.config.suggestions.by_type=Suggestions by type core.config.suggestions.by_type.tip=Maximum number of suggestions that should be displayed by application type core.config.types.tip=Check the application types you want to manage +core.config.ui.auto_scale=Auto scale +core.config.ui.auto_scale.tip=It activates the auto screen scale factor ( {} ). It fixes scaling issues for some desktop environments. settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after a restart. settings.changed.success.reboot=Restart now ? settings.error=It was not possible to properly change all the settings diff --git a/bauh/view/resources/locale/de b/bauh/view/resources/locale/de index 769fc17d..b595773c 100644 --- a/bauh/view/resources/locale/de +++ b/bauh/view/resources/locale/de @@ -207,6 +207,8 @@ core.config.system.dep_checking.tip=If the availability checking of your system core.config.suggestions.by_type=Suggestions by type core.config.suggestions.by_type.tip=Maximum number of suggestions that should be displayed by application type core.config.types.tip=Check the application types you want to manage +core.config.ui.auto_scale=Auto scale +core.config.ui.auto_scale.tip=It activates the auto screen scale factor ( {} ). It fixes scaling issues for some desktop environments. settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after a restart. settings.changed.success.reboot=Restart now ? settings.error=It was not possible to properly change all the settings diff --git a/bauh/view/resources/locale/en b/bauh/view/resources/locale/en index 817f32d5..a53d1d7e 100644 --- a/bauh/view/resources/locale/en +++ b/bauh/view/resources/locale/en @@ -214,6 +214,8 @@ core.config.system.dep_checking.tip=If the availability checking of your system core.config.suggestions.by_type=Suggestions by type core.config.suggestions.by_type.tip=Maximum number of suggestions that should be displayed by application type core.config.types.tip=Check the application types you want to manage +core.config.ui.auto_scale=Auto scale +core.config.ui.auto_scale.tip=It activates the auto screen scale factor ( {} ). It fixes scaling issues for some desktop environments. settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after a restart. settings.changed.success.reboot=Restart now ? settings.error=It was not possible to properly change all the settings diff --git a/bauh/view/resources/locale/es b/bauh/view/resources/locale/es index 7c0691f0..e6b9fc82 100644 --- a/bauh/view/resources/locale/es +++ b/bauh/view/resources/locale/es @@ -255,6 +255,8 @@ core.config.system.dep_checking.tip=Si la verificación de disponibilidad de las core.config.suggestions.by_type=Sugerencias por tipo core.config.suggestions.by_type.tip=Número máximo de sugerencias que deberían mostrarse por tipo de aplicación core.config.types.tip=Marque los tipos de aplicaciones que desea administrar +core.config.ui.auto_scale=Escala automática +core.config.ui.auto_scale.tip=Activa el factor de escala de pantalla automática ( {} ). Soluciona problemas de escala para algunos ambientes desktop. settings.changed.success.warning=Las configuraciones se cambiaron con éxito. Algunas solo tendrán efecto después del reinicio. settings.changed.success.reboot=¿Reiniciar ahora? settings.error=No fue posible cambiar correctamente todas las configuraciones diff --git a/bauh/view/resources/locale/it b/bauh/view/resources/locale/it index 96fafd9f..b12a1666 100644 --- a/bauh/view/resources/locale/it +++ b/bauh/view/resources/locale/it @@ -207,6 +207,8 @@ core.config.system.dep_checking.tip=If the availability checking of your system core.config.suggestions.by_type=Suggestions by type core.config.suggestions.by_type.tip=Maximum number of suggestions that should be displayed by application type core.config.types.tip=Check the application types you want to manage +core.config.ui.auto_scale=Auto scale +core.config.ui.auto_scale.tip=It activates the auto screen scale factor ( {} ). It fixes scaling issues for some desktop environments. settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after a restart. settings.changed.success.reboot=Restart now ? settings.error=It was not possible to properly change all the settings diff --git a/bauh/view/resources/locale/pt b/bauh/view/resources/locale/pt index 7954abc0..3a623d81 100644 --- a/bauh/view/resources/locale/pt +++ b/bauh/view/resources/locale/pt @@ -258,6 +258,8 @@ core.config.system.dep_checking.tip=Se a verificação da disponibilidade das te core.config.suggestions.by_type=Sugestões por tipo core.config.suggestions.by_type.tip=Número máximo de sugestões que devem ser exibidas por tipo de aplicativo core.config.types.tip=Marque os tipos de aplicativo que você quer gerenciar +core.config.ui.auto_scale=Escala automática +core.config.ui.auto_scale.tip=Ativa o fator de escala automático ( {} ). Corrige problemas de escala para alguns ambientes desktop. settings.changed.success.warning=Configurações alteradas com sucesso ! Algumas delas só surtirão após a reinicialização. settings.changed.success.reboot=Reiniciar agora ? settings.error=Não foi possível alterar todas as configurações adequadamente