gui: add general config
This commit is contained in:
@@ -19,11 +19,9 @@ NAME = 'Alacritty Config'
|
||||
|
||||
|
||||
# TODO
|
||||
# General
|
||||
# visual bell
|
||||
# cursor
|
||||
# mouse
|
||||
# mouse_bindings
|
||||
|
||||
|
||||
def delete_layout_items(layout):
|
||||
@@ -489,6 +487,46 @@ class ConfigWidget(QtWidgets.QWidget):
|
||||
return self.widgets_to_state(self.widgets)
|
||||
|
||||
|
||||
class General(ConfigWidget):
|
||||
cursor_style_options = ['Block', 'Underline', 'Beam']
|
||||
|
||||
def __init__(self, config):
|
||||
super().__init__()
|
||||
self.widgets['background_opacity'] = QtWidgets.QDoubleSpinBox()
|
||||
self.widgets['background_opacity'].setValue(config.get('background_opacity'))
|
||||
self.widgets['cursor_style'] = QtWidgets.QComboBox()
|
||||
for option in self.cursor_style_options:
|
||||
self.widgets['cursor_style'].addItem(option)
|
||||
self.widgets['cursor_style'] = config.get('cursor_style')
|
||||
self.widgets['custom_cursor_colors'] = QtWidgets.QCheckBox()
|
||||
self.widgets['custom_cursor_colors'].setChecked(
|
||||
config.get('custom_cursor_colors', False)
|
||||
)
|
||||
self.widgets['draw_bold_text_with_bright_colors'] = QtWidgets.QCheckBox()
|
||||
self.widgets['draw_bold_text_with_bright_colors'].setChecked(
|
||||
config.get('draw_bold_text_with_bright_colors', False)
|
||||
)
|
||||
self.widgets['dynamic_title'] = QtWidgets.QCheckBox()
|
||||
self.widgets['dynamic_title'].setChecked(
|
||||
config.get('dynamic_title', False)
|
||||
)
|
||||
self.widgets['hide_cursor_when_typing'] = QtWidgets.QCheckBox()
|
||||
self.widgets['hide_cursor_when_typing'].setChecked(
|
||||
config.get('hide_cursor_when_typing', False)
|
||||
)
|
||||
self.widgets['live_config_reload'] = QtWidgets.QCheckBox()
|
||||
self.widgets['live_config_reload'].setChecked(
|
||||
config.get('live_config_reload', False)
|
||||
)
|
||||
self.widgets['tabspaces'] = QtWidgets.QSpinBox()
|
||||
self.widgets['tabspaces'].setValue(config.get('tabspaces'))
|
||||
self.widgets['unfocused_hollow_cursor'] = QtWidgets.QCheckBox()
|
||||
self.widgets['unfocused_hollow_cursor'].setChecked(
|
||||
config.get('unfocused_hollow_cursor', False)
|
||||
)
|
||||
self.render_state()
|
||||
|
||||
|
||||
class Debug(ConfigWidget):
|
||||
log_levels = ['None', 'Error', 'Warn', 'Info', 'Debug', 'Trace']
|
||||
def __init__(self, config):
|
||||
@@ -821,6 +859,7 @@ class Config(QtWidgets.QWidget):
|
||||
def add_tabs(self):
|
||||
self.tabs = QtWidgets.QTabWidget()
|
||||
|
||||
self.tabs.addTab(General(self.config), "General")
|
||||
self.tabs.addTab(Window(self.config.get('window', {})), "Window")
|
||||
self.tabs.setTabToolTip(0, "Window")
|
||||
self.tabs.addTab(Font(self.config.get('font', {})), "Font")
|
||||
@@ -865,6 +904,9 @@ class Config(QtWidgets.QWidget):
|
||||
old = state.get(title, {})
|
||||
if type(old) == list:
|
||||
state[title].extend(e for e in tab.gather_state() if e not in old)
|
||||
else:
|
||||
if title == 'general':
|
||||
state = {**state, **tab.gather_state()}
|
||||
else:
|
||||
state[title] = {**state.get(title, {}), **tab.gather_state()}
|
||||
|
||||
|
Reference in New Issue
Block a user