From b6593b41e26c83005bc3f63cc37bb6f1c25a9a6b Mon Sep 17 00:00:00 2001 From: David Robertson Date: Sat, 2 May 2020 03:08:42 +0100 Subject: [PATCH] translated the gui prefs group --- flatcamGUI/GUIElements.py | 3 ++- flatcamGUI/preferences/OptionUI.py | 3 ++- flatcamGUI/preferences/general/GeneralGUIPrefGroupUI.py | 6 ++++-- flatcamGUI/preferences/general/GeneralPreferencesUI.py | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/flatcamGUI/GUIElements.py b/flatcamGUI/GUIElements.py index 360165b5..9a6229c1 100644 --- a/flatcamGUI/GUIElements.py +++ b/flatcamGUI/GUIElements.py @@ -655,7 +655,7 @@ class EvalEntry2(QtWidgets.QLineEdit): return QtCore.QSize(EDIT_SIZE_HINT, default_hint_size.height()) -class FCColorEntry(QtWidgets.QWidget): +class FCColorEntry(QtWidgets.QFrame): def __init__(self, **kwargs): super().__init__(**kwargs) @@ -668,6 +668,7 @@ class FCColorEntry(QtWidgets.QWidget): self.layout = QtWidgets.QHBoxLayout() self.layout.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) + self.layout.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.entry) self.layout.addWidget(self.button) self.setLayout(self.layout) diff --git a/flatcamGUI/preferences/OptionUI.py b/flatcamGUI/preferences/OptionUI.py index 067e1aaf..0d52037a 100644 --- a/flatcamGUI/preferences/OptionUI.py +++ b/flatcamGUI/preferences/OptionUI.py @@ -102,7 +102,8 @@ class ComboboxOptionUI(BasicOptionUI): class ColorOptionUI(BasicOptionUI): def build_entry_widget(self) -> QtWidgets.QWidget: - return FCColorEntry() + entry = FCColorEntry() + return entry class HeadingOptionUI(OptionUI): diff --git a/flatcamGUI/preferences/general/GeneralGUIPrefGroupUI.py b/flatcamGUI/preferences/general/GeneralGUIPrefGroupUI.py index 9914f087..49529713 100644 --- a/flatcamGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/flatcamGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -13,12 +13,12 @@ from flatcamGUI.preferences.OptionUI import OptionUI, CheckboxOptionUI, RadioSet SeparatorOptionUI, HeadingOptionUI, ComboboxOptionUI, ColorOptionUI, FullWidthButtonOptionUI -class GeneralGUIPrefGroupUI2(OptionsGroupUI2): +class GeneralGUIPrefGroupUI(OptionsGroupUI2): def __init__(self, decimals=4, **kwargs): super().__init__(**kwargs) self.decimals = decimals - self.setTitle(str(_("GUI Preferences 2"))) + self.setTitle(str(_("GUI Preferences"))) self.layout_field = self.option_dict()["layout"].get_field() self.layout_field.activated.connect(self.on_layout) @@ -117,6 +117,8 @@ class GeneralGUIPrefGroupUI2(OptionsGroupUI2): "First 6 digits are the color and the last 2\n" "digits are for alpha (transparency) level." ), + # FIXME: opacity slider? + SeparatorOptionUI(), HeadingOptionUI(label_text="Right-Left Selection Color", label_tooltip=None), ColorOptionUI( diff --git a/flatcamGUI/preferences/general/GeneralPreferencesUI.py b/flatcamGUI/preferences/general/GeneralPreferencesUI.py index 744e01ec..4e44a473 100644 --- a/flatcamGUI/preferences/general/GeneralPreferencesUI.py +++ b/flatcamGUI/preferences/general/GeneralPreferencesUI.py @@ -2,14 +2,14 @@ from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI from flatcamGUI.preferences.PreferencesSectionUI import PreferencesSectionUI from flatcamGUI.preferences.general.GeneralAppPrefGroupUI import GeneralAppPrefGroupUI from flatcamGUI.preferences.general.GeneralAPPSetGroupUI import GeneralAPPSetGroupUI -from flatcamGUI.preferences.general.GeneralGUIPrefGroupUI import GeneralGUIPrefGroupUI2 +from flatcamGUI.preferences.general.GeneralGUIPrefGroupUI import GeneralGUIPrefGroupUI class GeneralPreferencesUI(PreferencesSectionUI): def __init__(self, decimals, **kwargs): self.decimals = decimals - self.general_gui_group = GeneralGUIPrefGroupUI2(decimals=self.decimals) + self.general_gui_group = GeneralGUIPrefGroupUI(decimals=self.decimals) self.general_app_group = GeneralAppPrefGroupUI(decimals=self.decimals) self.general_app_set_group = GeneralAPPSetGroupUI(decimals=self.decimals) super().__init__(**kwargs)