mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
[ui][settings] auto screen scale factor
This commit is contained in:
11
CHANGELOG.md
11
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 )
|
- 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:
|
- AUR:
|
||||||
- downgrading time reduced due to the fix described in ***Fixes***.
|
- downgrading time reduced due to the fix described in ***Fixes***.
|
||||||
- UI:
|
- Configuration ( **~/.config/bauh/config.yml** )
|
||||||
- it's possible to disabled the HDPI improvements via the main configuration file ( **~/.config/bauh/config.yml** ):
|
- new property **hdpi** allowing to disable HDPI improvements
|
||||||
```
|
```
|
||||||
ui:
|
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
|
### Fixes
|
||||||
- AUR:
|
- AUR:
|
||||||
- not treating **makedepends** as a list during dependency checking ( **anbox-git** installation was crashing )
|
- not treating **makedepends** as a list during dependency checking ( **anbox-git** installation was crashing )
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ def main():
|
|||||||
|
|
||||||
local_config = config.read_config(update_file=True)
|
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'])
|
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 {}
|
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)
|
i18n = I18n(i18n_key, current_i18n, DEFAULT_I18N_KEY, default_i18n)
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ def read_config(update_file: bool = False) -> dict:
|
|||||||
'updates_icon': None
|
'updates_icon': None
|
||||||
},
|
},
|
||||||
'style': None,
|
'style': None,
|
||||||
'hdpi': True
|
'hdpi': True,
|
||||||
|
"auto_scale": False
|
||||||
|
|
||||||
},
|
},
|
||||||
'download': {
|
'download': {
|
||||||
|
|||||||
@@ -535,12 +535,17 @@ class GenericSoftwareManager(SoftwareManager):
|
|||||||
default_width = floor(0.11 * screen_width)
|
default_width = floor(0.11 * screen_width)
|
||||||
|
|
||||||
select_hdpi = self._gen_bool_component(label=self.i18n['core.config.ui.hdpi'],
|
select_hdpi = self._gen_bool_component(label=self.i18n['core.config.ui.hdpi'],
|
||||||
tooltip=self.i18n['core.config.ui.hdpi.tip'].format(
|
tooltip=self.i18n['core.config.ui.hdpi.tip'],
|
||||||
app=self.context.app_name),
|
|
||||||
value=bool(core_config['ui']['hdpi']),
|
value=bool(core_config['ui']['hdpi']),
|
||||||
max_width=default_width,
|
max_width=default_width,
|
||||||
id_='hdpi')
|
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']
|
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()]
|
style_opts = [InputOption(label=s.capitalize(), value=s.lower()) for s in QStyleFactory.keys()]
|
||||||
select_style = SingleSelectComponent(label=self.i18n['style'].capitalize(),
|
select_style = SingleSelectComponent(label=self.i18n['style'].capitalize(),
|
||||||
@@ -563,7 +568,7 @@ class GenericSoftwareManager(SoftwareManager):
|
|||||||
max_width=default_width,
|
max_width=default_width,
|
||||||
value=core_config['download']['icons'])
|
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')
|
return TabComponent(self.i18n['core.config.tab.ui'].capitalize(), PanelComponent(sub_comps), None, 'core.ui')
|
||||||
|
|
||||||
def _save_settings(self, general: PanelComponent,
|
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['download']['icons'] = ui_form.get_component('down_icons').get_selected()
|
||||||
core_config['ui']['hdpi'] = ui_form.get_component('hdpi').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()
|
core_config['ui']['table']['max_displayed'] = ui_form.get_component('table_max').get_int_value()
|
||||||
|
|
||||||
style = ui_form.get_component('style').get_selected()
|
style = ui_form.get_component('style').get_selected()
|
||||||
|
|||||||
@@ -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=Suggestions by type
|
||||||
core.config.suggestions.by_type.tip=Maximum number of suggestions that should be displayed by application 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.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.warning=Settings successfully changed. Some of them will only take effect after a restart.
|
||||||
settings.changed.success.reboot=Restart now ?
|
settings.changed.success.reboot=Restart now ?
|
||||||
settings.error=It was not possible to properly change all the settings
|
settings.error=It was not possible to properly change all the settings
|
||||||
|
|||||||
@@ -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=Suggestions by type
|
||||||
core.config.suggestions.by_type.tip=Maximum number of suggestions that should be displayed by application 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.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.warning=Settings successfully changed. Some of them will only take effect after a restart.
|
||||||
settings.changed.success.reboot=Restart now ?
|
settings.changed.success.reboot=Restart now ?
|
||||||
settings.error=It was not possible to properly change all the settings
|
settings.error=It was not possible to properly change all the settings
|
||||||
|
|||||||
@@ -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=Suggestions by type
|
||||||
core.config.suggestions.by_type.tip=Maximum number of suggestions that should be displayed by application 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.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.warning=Settings successfully changed. Some of them will only take effect after a restart.
|
||||||
settings.changed.success.reboot=Restart now ?
|
settings.changed.success.reboot=Restart now ?
|
||||||
settings.error=It was not possible to properly change all the settings
|
settings.error=It was not possible to properly change all the settings
|
||||||
|
|||||||
@@ -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=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.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.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.warning=Las configuraciones se cambiaron con éxito. Algunas solo tendrán efecto después del reinicio.
|
||||||
settings.changed.success.reboot=¿Reiniciar ahora?
|
settings.changed.success.reboot=¿Reiniciar ahora?
|
||||||
settings.error=No fue posible cambiar correctamente todas las configuraciones
|
settings.error=No fue posible cambiar correctamente todas las configuraciones
|
||||||
|
|||||||
@@ -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=Suggestions by type
|
||||||
core.config.suggestions.by_type.tip=Maximum number of suggestions that should be displayed by application 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.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.warning=Settings successfully changed. Some of them will only take effect after a restart.
|
||||||
settings.changed.success.reboot=Restart now ?
|
settings.changed.success.reboot=Restart now ?
|
||||||
settings.error=It was not possible to properly change all the settings
|
settings.error=It was not possible to properly change all the settings
|
||||||
|
|||||||
@@ -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=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.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.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.warning=Configurações alteradas com sucesso ! Algumas delas só surtirão após a reinicialização.
|
||||||
settings.changed.success.reboot=Reiniciar agora ?
|
settings.changed.success.reboot=Reiniciar agora ?
|
||||||
settings.error=Não foi possível alterar todas as configurações adequadamente
|
settings.error=Não foi possível alterar todas as configurações adequadamente
|
||||||
|
|||||||
Reference in New Issue
Block a user