From cabf9ee1a9d21721cf47e8030b67de4d28e38c06 Mon Sep 17 00:00:00 2001 From: Carl Tremblay Date: Fri, 11 Oct 2019 00:19:00 -0400 Subject: [PATCH] Merged Chart colors with Chart options to save space and reduce the height of display setting dialog --- NanoVNASaver/NanoVNASaver.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/NanoVNASaver/NanoVNASaver.py b/NanoVNASaver/NanoVNASaver.py index 42d62c1..ec93d45 100644 --- a/NanoVNASaver/NanoVNASaver.py +++ b/NanoVNASaver/NanoVNASaver.py @@ -1083,10 +1083,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget): display_options_layout.addRow(self.show_lines_option, show_lines_label) - self.dark_mode_option = QtWidgets.QCheckBox("Dark chart mode") - dark_mode_label = QtWidgets.QLabel("Black background with white text") - self.dark_mode_option.stateChanged.connect(self.changeDarkMode) - display_options_layout.addRow(self.dark_mode_option, dark_mode_label) + self.btnColorPicker = QtWidgets.QPushButton("█") self.btnColorPicker.setFixedWidth(20) @@ -1132,36 +1129,42 @@ class DisplaySettingsWindow(QtWidgets.QWidget): display_options_layout.addRow("Second reference color", self.btnSecondaryReferenceColorPicker) - layout.addWidget(display_options_box) + # layout.addWidget(display_options_box) # ************************** # Chart Colors Controls # ************************** - color_options_box = QtWidgets.QGroupBox("Chart colors") - color_options_layout = QtWidgets.QFormLayout(color_options_box) + # color_options_box = QtWidgets.QGroupBox("Chart colors") + # color_options_layout = QtWidgets.QFormLayout(color_options_box) + + self.dark_mode_option = QtWidgets.QCheckBox("Dark chart mode") + dark_mode_label = QtWidgets.QLabel("Black background with white text") + self.dark_mode_option.stateChanged.connect(self.changeDarkMode) + display_options_layout.addRow(self.dark_mode_option, dark_mode_label) self.use_custom_colors = QtWidgets.QCheckBox("Use custom chart colors") self.use_custom_colors.stateChanged.connect(self.changeCustomColors) - color_options_layout.addRow(self.use_custom_colors) + display_options_layout.addRow(self.use_custom_colors) self.btn_background_picker = QtWidgets.QPushButton("█") self.btn_background_picker.setFixedWidth(20) self.btn_background_picker.clicked.connect(lambda: self.setColor("background", QtWidgets.QColorDialog.getColor(self.backgroundColor, options=QtWidgets.QColorDialog.ShowAlphaChannel))) - color_options_layout.addRow("Chart background", self.btn_background_picker) + display_options_layout.addRow("Chart background", self.btn_background_picker) self.btn_foreground_picker = QtWidgets.QPushButton("█") self.btn_foreground_picker.setFixedWidth(20) self.btn_foreground_picker.clicked.connect(lambda: self.setColor("foreground", QtWidgets.QColorDialog.getColor(self.foregroundColor, options=QtWidgets.QColorDialog.ShowAlphaChannel))) - color_options_layout.addRow("Chart foreground", self.btn_foreground_picker) + display_options_layout.addRow("Chart foreground", self.btn_foreground_picker) self.btn_text_picker = QtWidgets.QPushButton("█") self.btn_text_picker.setFixedWidth(20) self.btn_text_picker.clicked.connect(lambda: self.setColor("text", QtWidgets.QColorDialog.getColor(self.textColor, options=QtWidgets.QColorDialog.ShowAlphaChannel))) - color_options_layout.addRow("Chart text", self.btn_text_picker) + display_options_layout.addRow("Chart text", self.btn_text_picker) - layout.addWidget(color_options_box) + # layout.addWidget(color_options_box) + layout.addWidget(display_options_box) # ************************** # Font Controls # **************************