[view] improvement: some components' width reduced (settings)

This commit is contained in:
Vinicius Moreira
2022-04-12 09:54:44 -03:00
parent 2f68095e9b
commit f3514b91e1
6 changed files with 23 additions and 24 deletions

View File

@@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- displaying a '+' for positive sizes (previously the sign was only displayed for negative numbers) [#250](https://github.com/vinifmor/bauh/issues/250) - displaying a '+' for positive sizes (previously the sign was only displayed for negative numbers) [#250](https://github.com/vinifmor/bauh/issues/250)
- changing some words and symbols to improve readability and cohesion [#250](https://github.com/vinifmor/bauh/issues/250) - changing some words and symbols to improve readability and cohesion [#250](https://github.com/vinifmor/bauh/issues/250)
- displaying update sizes as localized numbers [#250](https://github.com/vinifmor/bauh/issues/250) - displaying update sizes as localized numbers [#250](https://github.com/vinifmor/bauh/issues/250)
- settings: some components' width reduced
### Fixes ### Fixes

View File

@@ -852,7 +852,7 @@ class AppImageManager(SoftwareManager, SettingsController):
def get_settings(self) -> Optional[Generator[SettingsView, None, None]]: def get_settings(self) -> Optional[Generator[SettingsView, None, None]]:
config_ = self.configman.get_config() config_ = self.configman.get_config()
max_width = floor(self.context.screen_width * 0.15) max_width = 50
comps = [ comps = [
TextInputComponent(label=self.i18n['appimage.config.database.expiration'], TextInputComponent(label=self.i18n['appimage.config.database.expiration'],

View File

@@ -622,8 +622,8 @@ class FlatpakManager(SoftwareManager, SettingsController):
options=install_opts, options=install_opts,
default_option=[o for o in install_opts if o.value == flatpak_config['installation_level']][0], default_option=[o for o in install_opts if o.value == flatpak_config['installation_level']][0],
max_per_line=len(install_opts), max_per_line=len(install_opts),
max_width=floor(self.context.screen_width * 0.22), max_width=160,
type_=SelectViewType.RADIO, type_=SelectViewType.COMBO,
id_='install')) id_='install'))
yield SettingsView(self, PanelComponent([FormComponent(fields, self.i18n['installation'].capitalize())])) yield SettingsView(self, PanelComponent([FormComponent(fields, self.i18n['installation'].capitalize())]))

View File

@@ -429,20 +429,19 @@ class SnapManager(SoftwareManager, SettingsController):
def get_settings(self) -> Optional[Generator[SettingsView, None, None]]: def get_settings(self) -> Optional[Generator[SettingsView, None, None]]:
snap_config = self.configman.get_config() snap_config = self.configman.get_config()
max_width = 200
install_channel = new_select(label=self.i18n['snap.config.install_channel'], install_channel = new_select(label=self.i18n['snap.config.install_channel'],
opts=[(self.i18n['yes'].capitalize(), True, None), opts=[(self.i18n['yes'].capitalize(), True, None),
(self.i18n['no'].capitalize(), False, None)], (self.i18n['no'].capitalize(), False, None)],
value=bool(snap_config['install_channel']), value=bool(snap_config['install_channel']),
id_='snap_install_channel', id_='snap_install_channel',
max_width=max_width, max_width=200,
tip=self.i18n['snap.config.install_channel.tip']) tip=self.i18n['snap.config.install_channel.tip'])
cat_exp_val = snap_config['categories_exp'] if isinstance(snap_config['categories_exp'], int) else '' cat_exp_val = snap_config['categories_exp'] if isinstance(snap_config['categories_exp'], int) else ''
categories_exp = TextInputComponent(id_='snap_cat_exp', categories_exp = TextInputComponent(id_='snap_cat_exp',
value=cat_exp_val, value=cat_exp_val,
max_width=max_width, max_width=60,
only_int=True, only_int=True,
label=self.i18n['snap.config.categories_exp'], label=self.i18n['snap.config.categories_exp'],
tooltip=self.i18n['snap.config.categories_exp.tip']) tooltip=self.i18n['snap.config.categories_exp.tip'])

View File

@@ -1107,13 +1107,12 @@ class WebApplicationManager(SoftwareManager, SettingsController):
def get_settings(self) -> Optional[Generator[SettingsView, None, None]]: def get_settings(self) -> Optional[Generator[SettingsView, None, None]]:
web_config = self.configman.get_config() web_config = self.configman.get_config()
max_width = floor(self.context.screen_width * 0.15)
input_electron = TextInputComponent(label=self.i18n['web.settings.electron.version.label'], input_electron = TextInputComponent(label=self.i18n['web.settings.electron.version.label'],
value=web_config['environment']['electron']['version'], value=web_config['environment']['electron']['version'],
tooltip=self.i18n['web.settings.electron.version.tooltip'], tooltip=self.i18n['web.settings.electron.version.tooltip'],
placeholder='{}: 7.1.0'.format(self.i18n['example.short']), placeholder='{}: 7.1.0'.format(self.i18n['example.short']),
max_width=max_width, max_width=150,
id_='electron_branch') id_='electron_branch')
native_opts = [ native_opts = [
@@ -1126,7 +1125,7 @@ class WebApplicationManager(SoftwareManager, SettingsController):
default_option=[o for o in native_opts if o.value == web_config['environment']['system']][0], default_option=[o for o in native_opts if o.value == web_config['environment']['system']][0],
type_=SelectViewType.COMBO, type_=SelectViewType.COMBO,
tooltip=self.i18n['web.settings.nativefier.tip'], tooltip=self.i18n['web.settings.nativefier.tip'],
max_width=max_width, max_width=150,
id_='nativefier') id_='nativefier')
env_settings_exp = TextInputComponent(label=self.i18n['web.settings.cache_exp'], env_settings_exp = TextInputComponent(label=self.i18n['web.settings.cache_exp'],
@@ -1134,7 +1133,7 @@ class WebApplicationManager(SoftwareManager, SettingsController):
capitalize_label=False, capitalize_label=False,
value=int(web_config['environment']['cache_exp']) if isinstance(web_config['environment']['cache_exp'], int) else '', value=int(web_config['environment']['cache_exp']) if isinstance(web_config['environment']['cache_exp'], int) else '',
only_int=True, only_int=True,
max_width=max_width, max_width=60,
id_='web_cache_exp') id_='web_cache_exp')
sugs_exp = TextInputComponent(label=self.i18n['web.settings.suggestions.cache_exp'], sugs_exp = TextInputComponent(label=self.i18n['web.settings.suggestions.cache_exp'],
@@ -1143,11 +1142,11 @@ class WebApplicationManager(SoftwareManager, SettingsController):
value=int(web_config['suggestions']['cache_exp']) if isinstance( value=int(web_config['suggestions']['cache_exp']) if isinstance(
web_config['suggestions']['cache_exp'], int) else '', web_config['suggestions']['cache_exp'], int) else '',
only_int=True, only_int=True,
max_width=max_width, max_width=60,
id_='web_sugs_exp') id_='web_sugs_exp')
form_env = FormComponent(label=self.i18n['web.settings.nativefier.env'].capitalize(), form_env = FormComponent(label=self.i18n['web.settings.nativefier.env'].capitalize(),
components=[input_electron, select_nativefier, env_settings_exp, sugs_exp]) components=[select_nativefier, input_electron, env_settings_exp, sugs_exp])
yield SettingsView(self, PanelComponent([form_env])) yield SettingsView(self, PanelComponent([form_env]))

View File

@@ -102,20 +102,20 @@ class GenericSettingsManager(SettingsController):
return TabGroupComponent(tabs) return TabGroupComponent(tabs)
def _gen_adv_settings(self, core_config: dict) -> TabComponent: def _gen_adv_settings(self, core_config: dict) -> TabComponent:
default_width = floor(0.22 * self.context.screen_width) default_width = 300
input_data_exp = TextInputComponent(label=self.i18n['core.config.mem_cache.data_exp'], input_data_exp = TextInputComponent(label=self.i18n['core.config.mem_cache.data_exp'],
tooltip=self.i18n['core.config.mem_cache.data_exp.tip'], tooltip=self.i18n['core.config.mem_cache.data_exp.tip'],
value=str(core_config['memory_cache']['data_expiration']), value=str(core_config['memory_cache']['data_expiration']),
only_int=True, only_int=True,
max_width=default_width, max_width=60,
id_="data_exp") id_="data_exp")
input_icon_exp = TextInputComponent(label=self.i18n['core.config.mem_cache.icon_exp'], input_icon_exp = TextInputComponent(label=self.i18n['core.config.mem_cache.icon_exp'],
tooltip=self.i18n['core.config.mem_cache.icon_exp.tip'], tooltip=self.i18n['core.config.mem_cache.icon_exp.tip'],
value=str(core_config['memory_cache']['icon_expiration']), value=str(core_config['memory_cache']['icon_expiration']),
only_int=True, only_int=True,
max_width=default_width, max_width=60,
id_="icon_exp") id_="icon_exp")
select_trim = new_select(label=self.i18n['core.config.trim.after_upgrade'], select_trim = new_select(label=self.i18n['core.config.trim.after_upgrade'],
@@ -168,13 +168,13 @@ class GenericSettingsManager(SettingsController):
value=current_mthread_client) value=current_mthread_client)
def _gen_tray_settings(self, core_config: dict) -> TabComponent: def _gen_tray_settings(self, core_config: dict) -> TabComponent:
default_width = floor(0.22 * self.context.screen_width) default_width = 350
input_update_interval = TextInputComponent(label=self.i18n['core.config.updates.interval'].capitalize(), input_update_interval = TextInputComponent(label=self.i18n['core.config.updates.interval'].capitalize(),
tooltip=self.i18n['core.config.updates.interval.tip'], tooltip=self.i18n['core.config.updates.interval.tip'],
only_int=True, only_int=True,
value=str(core_config['updates']['check_interval']), value=str(core_config['updates']['check_interval']),
max_width=default_width, max_width=60,
id_="updates_interval") id_="updates_interval")
allowed_exts = {'png', 'svg', 'jpg', 'jpeg', 'ico', 'xpm'} allowed_exts = {'png', 'svg', 'jpg', 'jpeg', 'ico', 'xpm'}
@@ -194,12 +194,12 @@ class GenericSettingsManager(SettingsController):
max_width=default_width, max_width=default_width,
allowed_extensions=allowed_exts) allowed_extensions=allowed_exts)
sub_comps = [FormComponent([input_update_interval, select_def_icon, select_up_icon], spaces=False)] sub_comps = [FormComponent([select_def_icon, select_up_icon, input_update_interval], spaces=False)]
return TabComponent(self.i18n['core.config.tab.tray'].capitalize(), return TabComponent(self.i18n['core.config.tab.tray'].capitalize(),
PanelComponent(sub_comps), None, 'core.tray') PanelComponent(sub_comps), None, 'core.tray')
def _gen_ui_settings(self, core_config: dict) -> TabComponent: def _gen_ui_settings(self, core_config: dict) -> TabComponent:
default_width = floor(0.15 * self.context.screen_width) default_width = 200
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'], tooltip=self.i18n['core.config.ui.hdpi.tip'],
@@ -225,7 +225,7 @@ class GenericSettingsManager(SettingsController):
select_scale = RangeInputComponent(id_="scalef", label=self.i18n['core.config.ui.scale_factor'] + ' (%)', select_scale = RangeInputComponent(id_="scalef", label=self.i18n['core.config.ui.scale_factor'] + ' (%)',
tooltip=self.i18n['core.config.ui.scale_factor.tip'], tooltip=self.i18n['core.config.ui.scale_factor.tip'],
min_value=100, max_value=400, step_value=5, value=int(scale * 100), min_value=100, max_value=400, step_value=5, value=int(scale * 100),
max_width=default_width) max_width=60)
if not core_config['ui']['qt_style']: if not core_config['ui']['qt_style']:
cur_style = QApplication.instance().property('qt_style') cur_style = QApplication.instance().property('qt_style')
@@ -264,7 +264,7 @@ class GenericSettingsManager(SettingsController):
tooltip=self.i18n['core.config.ui.max_displayed.tip'], tooltip=self.i18n['core.config.ui.max_displayed.tip'],
only_int=True, only_int=True,
id_="table_max", id_="table_max",
max_width=default_width, max_width=50,
value=str(core_config['ui']['table']['max_displayed'])) value=str(core_config['ui']['table']['max_displayed']))
select_dicons = self._gen_bool_component(label=self.i18n['core.config.download.icons'], select_dicons = self._gen_bool_component(label=self.i18n['core.config.download.icons'],
@@ -335,7 +335,7 @@ class GenericSettingsManager(SettingsController):
tooltip=self.i18n['core.config.suggestions.by_type.tip'], tooltip=self.i18n['core.config.suggestions.by_type.tip'],
value=str(core_config['suggestions']['by_type']), value=str(core_config['suggestions']['by_type']),
only_int=True, only_int=True,
max_width=default_width, max_width=50,
id_="sugs_by_type") id_="sugs_by_type")
inp_reboot = new_select(label=self.i18n['core.config.updates.reboot'], inp_reboot = new_select(label=self.i18n['core.config.updates.reboot'],
@@ -346,7 +346,7 @@ class GenericSettingsManager(SettingsController):
opts=[(self.i18n['ask'].capitalize(), True, None), opts=[(self.i18n['ask'].capitalize(), True, None),
(self.i18n['no'].capitalize(), False, None)]) (self.i18n['no'].capitalize(), False, None)])
inputs = [sel_locale, sel_store_pwd, sel_sys_notify, sel_load_apps, sel_sugs, inp_sugs, inp_reboot] inputs = [sel_locale, sel_store_pwd, sel_sys_notify, sel_load_apps, inp_reboot, sel_sugs, inp_sugs]
panel = PanelComponent([FormComponent(inputs, spaces=False)]) panel = PanelComponent([FormComponent(inputs, spaces=False)])
return TabComponent(self.i18n['core.config.tab.general'].capitalize(), panel, None, 'core.gen') return TabComponent(self.i18n['core.config.tab.general'].capitalize(), panel, None, 'core.gen')
@@ -572,7 +572,7 @@ class GenericSettingsManager(SettingsController):
def _gen_backup_settings(self, core_config: dict) -> TabComponent: def _gen_backup_settings(self, core_config: dict) -> TabComponent:
if timeshift.is_available(): if timeshift.is_available():
default_width = floor(0.22 * self.context.screen_width) default_width = 350
enabled_opt = self._gen_bool_component(label=self.i18n['core.config.backup'], enabled_opt = self._gen_bool_component(label=self.i18n['core.config.backup'],
tooltip=None, tooltip=None,