Fix most config changed handlers
This commit is contained in:
parent
c25022f549
commit
e828f5b812
@ -260,9 +260,9 @@ class AbstractZoom(QObject):
|
|||||||
# self.destroyed.connect(functools.partial(
|
# self.destroyed.connect(functools.partial(
|
||||||
# cfg.changed.disconnect, self.init_neighborlist))
|
# cfg.changed.disconnect, self.init_neighborlist))
|
||||||
|
|
||||||
@pyqtSlot(str, str)
|
@pyqtSlot(str)
|
||||||
def _on_config_changed(self, section, option):
|
def _on_config_changed(self, option):
|
||||||
if section == 'ui' and option in ['zoom-levels', 'default-zoom']:
|
if option in ['zoom.levels', 'zoom.default']:
|
||||||
if not self._default_zoom_changed:
|
if not self._default_zoom_changed:
|
||||||
factor = float(config.val.zoom.default) / 100
|
factor = float(config.val.zoom.default) / 100
|
||||||
self._set_factor_internal(factor)
|
self._set_factor_internal(factor)
|
||||||
|
@ -141,11 +141,9 @@ class CompletionView(QTreeView):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return utils.get_repr(self)
|
return utils.get_repr(self)
|
||||||
|
|
||||||
@pyqtSlot(str, str)
|
@pyqtSlot(str)
|
||||||
def _on_config_changed(self, section, option):
|
def _on_config_changed(self, option):
|
||||||
if section != 'completion':
|
if option in ['completion.height', 'completion.shrink']:
|
||||||
return
|
|
||||||
if option in ['height', 'shrink']:
|
|
||||||
self.update_geometry.emit()
|
self.update_geometry.emit()
|
||||||
|
|
||||||
def _resize_columns(self):
|
def _resize_columns(self):
|
||||||
|
@ -323,16 +323,14 @@ class MainWindow(QWidget):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return utils.get_repr(self)
|
return utils.get_repr(self)
|
||||||
|
|
||||||
@pyqtSlot(str, str)
|
@pyqtSlot(str)
|
||||||
def on_config_changed(self, section, option):
|
def on_config_changed(self, option):
|
||||||
"""Resize the completion if related config options changed."""
|
"""Resize the completion if related config options changed."""
|
||||||
if section != 'ui':
|
if option == 'statusbar.padding':
|
||||||
return
|
|
||||||
if option == 'statusbar-padding':
|
|
||||||
self._update_overlay_geometries()
|
self._update_overlay_geometries()
|
||||||
elif option == 'downloads-position':
|
elif option == 'downloads.position':
|
||||||
self._add_widgets()
|
self._add_widgets()
|
||||||
elif option == 'status-position':
|
elif option == 'statusbar.position':
|
||||||
self._add_widgets()
|
self._add_widgets()
|
||||||
self._update_overlay_geometries()
|
self._update_overlay_geometries()
|
||||||
|
|
||||||
|
@ -199,13 +199,11 @@ class StatusBar(QWidget):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return utils.get_repr(self)
|
return utils.get_repr(self)
|
||||||
|
|
||||||
@pyqtSlot(str, str)
|
@pyqtSlot(str)
|
||||||
def _on_config_changed(self, section, option):
|
def _on_config_changed(self, option):
|
||||||
if section != 'ui':
|
if option == 'statusbar.hide':
|
||||||
return
|
|
||||||
if option == 'hide-statusbar':
|
|
||||||
self.maybe_hide()
|
self.maybe_hide()
|
||||||
elif option == 'statusbar-pdading':
|
elif option == 'statusbar.padding':
|
||||||
self._set_hbox_padding()
|
self._set_hbox_padding()
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
|
@ -189,10 +189,9 @@ class TabWidget(QTabWidget):
|
|||||||
fields['scroll_pos'] = scroll_pos
|
fields['scroll_pos'] = scroll_pos
|
||||||
return fields
|
return fields
|
||||||
|
|
||||||
def update_tab_titles(self, section='tabs', option='title-format'):
|
def update_tab_titles(self, option='tabs.title.format'):
|
||||||
"""Update all texts."""
|
"""Update all texts."""
|
||||||
if section == 'tabs' and option in ['title-format',
|
if option in ['tabs.title.format', 'tabs.title.format_pinned']:
|
||||||
'title-format-pinned']:
|
|
||||||
for idx in range(self.count()):
|
for idx in range(self.count()):
|
||||||
self.update_tab_title(idx)
|
self.update_tab_title(idx)
|
||||||
|
|
||||||
@ -426,10 +425,10 @@ class TabBar(QTabBar):
|
|||||||
p.setColor(QPalette.Window, config.val.colors.tabs.bar.bg)
|
p.setColor(QPalette.Window, config.val.colors.tabs.bar.bg)
|
||||||
self.setPalette(p)
|
self.setPalette(p)
|
||||||
|
|
||||||
@pyqtSlot(str, str)
|
@pyqtSlot(str)
|
||||||
def on_tab_colors_changed(self, section, option):
|
def on_tab_colors_changed(self, option):
|
||||||
"""Set the tab colors."""
|
"""Set the tab colors."""
|
||||||
if section == 'colors' and option.startswith('tabs.'):
|
if option.startswith('colors.tabs.'):
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
def mousePressEvent(self, e):
|
def mousePressEvent(self, e):
|
||||||
|
Loading…
Reference in New Issue
Block a user