- multiple UI changes in Preferences

- UI changes in the Paint Plugin
This commit is contained in:
Marius Stanciu
2021-09-25 21:08:15 +03:00
committed by Marius
parent 0fa01e760a
commit 08d3a580ac
42 changed files with 762 additions and 628 deletions

View File

@@ -2,7 +2,7 @@ from PyQt6 import QtCore, QtWidgets
from PyQt6.QtCore import QSettings
from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, RadioSet, OptionalInputSection, FCSpinner, \
FCColorEntry, FCLabel, FCGridLayout
FCColorEntry, FCLabel, FCGridLayout, FCFrame
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
@@ -33,13 +33,19 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
else:
self.resource_loc = 'assets/resources'
# Create a grid layout for the Application general settings
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
self.layout.addLayout(grid0)
# #############################################################################################################
# Grid Settings Frame
# #############################################################################################################
# GRID Settings
self.grid_label = FCLabel('<b>%s</b>' % _('Grid Settings'))
grid0.addWidget(self.grid_label, 0, 0, 1, 2)
self.grid_label = FCLabel('<span style="color:brown;"><b>%s</b></span>' % _('Grid Settings'))
self.layout.addWidget(self.grid_label)
grids_frame = FCFrame()
self.layout.addWidget(grids_frame)
# Create a grid layout for the Application general settings
grids_grid = FCGridLayout(v_spacing=5, h_spacing=3)
grids_frame.setLayout(grids_grid)
# Grid X Entry
self.gridx_label = FCLabel('%s:' % _('X value'))
@@ -50,8 +56,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
self.gridx_entry.set_precision(self.decimals)
self.gridx_entry.setSingleStep(0.1)
grid0.addWidget(self.gridx_label, 2, 0)
grid0.addWidget(self.gridx_entry, 2, 1)
grids_grid.addWidget(self.gridx_label, 2, 0)
grids_grid.addWidget(self.gridx_entry, 2, 1)
# Grid Y Entry
self.gridy_label = FCLabel('%s:' % _('Y value'))
@@ -62,8 +68,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
self.gridy_entry.set_precision(self.decimals)
self.gridy_entry.setSingleStep(0.1)
grid0.addWidget(self.gridy_label, 4, 0)
grid0.addWidget(self.gridy_entry, 4, 1)
grids_grid.addWidget(self.gridy_label, 4, 0)
grids_grid.addWidget(self.gridy_entry, 4, 1)
# Snap Max Entry
self.snap_max_label = FCLabel('%s:' % _('Snap Max'))
@@ -72,17 +78,26 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
self.snap_max_dist_entry.set_precision(self.decimals)
self.snap_max_dist_entry.setSingleStep(0.1)
grid0.addWidget(self.snap_max_label, 6, 0)
grid0.addWidget(self.snap_max_dist_entry, 6, 1)
grids_grid.addWidget(self.snap_max_label, 6, 0)
grids_grid.addWidget(self.snap_max_dist_entry, 6, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 8, 0, 1, 2)
# separator_line = QtWidgets.QFrame()
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
# grids_grid.addWidget(separator_line, 8, 0, 1, 2)
# #############################################################################################################
# Workspace Frame
# #############################################################################################################
# Workspace
self.workspace_label = FCLabel('<b>%s</b>' % _('Workspace Settings'))
grid0.addWidget(self.workspace_label, 10, 0, 1, 2)
self.workspace_label = FCLabel('<span style="color:darkorchid;"><b>%s</b></span>' % _('Workspace Settings'))
self.layout.addWidget(self.workspace_label)
wk_frame = FCFrame()
self.layout.addWidget(wk_frame)
wk_grid = FCGridLayout(v_spacing=5, h_spacing=3)
wk_frame.setLayout(wk_grid)
self.workspace_cb = FCCheckBox('%s' % _('Active'))
self.workspace_cb.setToolTip(
@@ -90,7 +105,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
"The purpose is to illustrate the limits for our work.")
)
grid0.addWidget(self.workspace_cb, 12, 0, 1, 2)
wk_grid.addWidget(self.workspace_cb, 0, 0, 1, 2)
self.workspace_type_lbl = FCLabel('%s:' % _('Size'))
self.workspace_type_lbl.setToolTip(
@@ -99,8 +114,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
)
self.wk_cb = FCComboBox()
grid0.addWidget(self.workspace_type_lbl, 14, 0)
grid0.addWidget(self.wk_cb, 14, 1)
wk_grid.addWidget(self.workspace_type_lbl, 2, 0)
wk_grid.addWidget(self.wk_cb, 2, 1)
self.pagesize = {}
self.pagesize.update(
@@ -167,19 +182,23 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
self.wk_orientation_radio = RadioSet([{'label': _('Portrait'), 'value': 'p'},
{'label': _('Landscape'), 'value': 'l'},
], stretch=False)
], compact=True)
grid0.addWidget(self.wk_orientation_label, 16, 0)
grid0.addWidget(self.wk_orientation_radio, 16, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 18, 0, 1, 2)
wk_grid.addWidget(self.wk_orientation_label, 4, 0)
wk_grid.addWidget(self.wk_orientation_radio, 4, 1)
# #############################################################################################################
# Font Frame
# #############################################################################################################
# Font Size
self.font_size_label = FCLabel('<b>%s</b>' % _('Font Size'))
grid0.addWidget(self.font_size_label, 20, 0, 1, 2)
self.font_size_label = FCLabel('<span style="color:red;"><b>%s</b></span>' % _('Font Size'))
self.layout.addWidget(self.font_size_label)
fnt_frame = FCFrame()
self.layout.addWidget(fnt_frame)
fnt_grid = FCGridLayout(v_spacing=5, h_spacing=3)
fnt_frame.setLayout(fnt_grid)
# Notebook Font Size
self.notebook_font_size_label = FCLabel('%s:' % _('Notebook'))
@@ -199,8 +218,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
else:
self.notebook_font_size_spinner.set_value(12)
grid0.addWidget(self.notebook_font_size_label, 22, 0)
grid0.addWidget(self.notebook_font_size_spinner, 22, 1)
fnt_grid.addWidget(self.notebook_font_size_label, 0, 0)
fnt_grid.addWidget(self.notebook_font_size_spinner, 0, 1)
# Axis Font Size
self.axis_font_size_label = FCLabel('%s:' % _('Axis'))
@@ -218,8 +237,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
else:
self.axis_font_size_spinner.set_value(8)
grid0.addWidget(self.axis_font_size_label, 24, 0)
grid0.addWidget(self.axis_font_size_spinner, 24, 1)
fnt_grid.addWidget(self.axis_font_size_label, 2, 0)
fnt_grid.addWidget(self.axis_font_size_spinner, 2, 1)
# TextBox Font Size
self.textbox_font_size_label = FCLabel('%s:' % _('Textbox'))
@@ -238,8 +257,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
else:
self.textbox_font_size_spinner.set_value(10)
grid0.addWidget(self.textbox_font_size_label, 26, 0)
grid0.addWidget(self.textbox_font_size_spinner, 26, 1)
fnt_grid.addWidget(self.textbox_font_size_label, 4, 0)
fnt_grid.addWidget(self.textbox_font_size_spinner, 4, 1)
# HUD Font Size
self.hud_font_size_label = FCLabel('%s:' % _('HUD'))
@@ -257,13 +276,21 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
else:
self.hud_font_size_spinner.set_value(8)
grid0.addWidget(self.hud_font_size_label, 28, 0)
grid0.addWidget(self.hud_font_size_spinner, 28, 1)
fnt_grid.addWidget(self.hud_font_size_label, 6, 0)
fnt_grid.addWidget(self.hud_font_size_spinner, 6, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 30, 0, 1, 2)
# #############################################################################################################
# Axis Frame
# #############################################################################################################
# Axis Size
self.axis_label = FCLabel('<span style="color:DarkOrchid;"><b>%s</b></span>' % _('Axis'))
self.layout.addWidget(self.axis_label)
ax_frame = FCFrame()
self.layout.addWidget(ax_frame)
ax_grid = FCGridLayout(v_spacing=5, h_spacing=3)
ax_frame.setLayout(ax_grid)
# Axis Color
self.axis_color_label = FCLabel('%s:' % _('Axis Color'))
@@ -272,20 +299,20 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
)
self.axis_color_entry = FCColorEntry()
grid0.addWidget(self.axis_color_label, 32, 0)
grid0.addWidget(self.axis_color_entry, 32, 1)
ax_grid.addWidget(self.axis_color_label, 0, 0)
ax_grid.addWidget(self.axis_color_entry, 0, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 34, 0, 1, 2)
# #############################################################################################################
# Mouse Frame
# #############################################################################################################
self.mouse_lbl = FCLabel('<span style="color:LightSeaGreen;"><b>%s</b></span>' % _('Mouse Settings'))
self.layout.addWidget(self.mouse_lbl)
# -----------------------------------------------------------
# -------------- MOUSE SETTINGS -----------------------------
# -----------------------------------------------------------
m_frame = FCFrame()
self.layout.addWidget(m_frame)
self.mouse_lbl = FCLabel('<b>%s</b>' % _('Mouse Settings'))
grid0.addWidget(self.mouse_lbl, 36, 0, 1, 2)
m_grid = FCGridLayout(v_spacing=5, h_spacing=3)
m_frame.setLayout(m_grid)
# Mouse Cursor Shape
self.cursor_lbl = FCLabel('%s:' % _('Cursor Shape'))
@@ -298,10 +325,10 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
self.cursor_radio = RadioSet([
{"label": _("Small"), "value": "small"},
{"label": _("Big"), "value": "big"}
], orientation='horizontal', stretch=False)
], orientation='horizontal', compact=True)
grid0.addWidget(self.cursor_lbl, 38, 0)
grid0.addWidget(self.cursor_radio, 38, 1)
m_grid.addWidget(self.cursor_lbl, 0, 0)
m_grid.addWidget(self.cursor_radio, 0, 1)
# Mouse Cursor Size
self.cursor_size_lbl = FCLabel('%s:' % _('Cursor Size'))
@@ -313,8 +340,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
self.cursor_size_entry.set_range(10, 70)
self.cursor_size_entry.setWrapping(True)
grid0.addWidget(self.cursor_size_lbl, 40, 0)
grid0.addWidget(self.cursor_size_entry, 40, 1)
m_grid.addWidget(self.cursor_size_lbl, 2, 0)
m_grid.addWidget(self.cursor_size_entry, 2, 1)
# Cursor Width
self.cursor_width_lbl = FCLabel('%s:' % _('Cursor Width'))
@@ -326,15 +353,15 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
self.cursor_width_entry.set_range(1, 10)
self.cursor_width_entry.setWrapping(True)
grid0.addWidget(self.cursor_width_lbl, 42, 0)
grid0.addWidget(self.cursor_width_entry, 42, 1)
m_grid.addWidget(self.cursor_width_lbl, 4, 0)
m_grid.addWidget(self.cursor_width_entry, 4, 1)
# Cursor Color Enable
self.mouse_cursor_color_cb = FCCheckBox(label='%s' % _('Cursor Color'))
self.mouse_cursor_color_cb.setToolTip(
_("Check this box to color mouse cursor.")
)
grid0.addWidget(self.mouse_cursor_color_cb, 44, 0, 1, 2)
m_grid.addWidget(self.mouse_cursor_color_cb, 6, 0, 1, 2)
# Cursor Color
self.mouse_color_label = FCLabel('%s:' % _('Cursor Color'))
@@ -343,8 +370,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
)
self.mouse_cursor_entry = FCColorEntry()
grid0.addWidget(self.mouse_color_label, 46, 0)
grid0.addWidget(self.mouse_cursor_entry, 46, 1)
m_grid.addWidget(self.mouse_color_label, 8, 0)
m_grid.addWidget(self.mouse_cursor_entry, 8, 1)
self.mois = OptionalInputSection(
self.mouse_cursor_color_cb,
@@ -362,26 +389,33 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
"- RMB --> Right Mouse Button")
)
self.pan_button_radio = RadioSet([{'label': _('MMB'), 'value': '3'},
{'label': _('RMB'), 'value': '2'}])
{'label': _('RMB'), 'value': '2'}], compact=True)
grid0.addWidget(self.panbuttonlabel, 48, 0)
grid0.addWidget(self.pan_button_radio, 48, 1)
m_grid.addWidget(self.panbuttonlabel, 10, 0)
m_grid.addWidget(self.pan_button_radio, 10, 1)
# Multiple Selection Modifier Key
self.mselectlabel = FCLabel('%s:' % _('Multiple Selection'))
self.mselectlabel = FCLabel('%s:' % _('Multi-Selection'))
self.mselectlabel.setToolTip(
_("Select the key used for multiple selection.")
)
self.mselect_radio = RadioSet([{'label': _('CTRL'), 'value': 'Control'},
{'label': _('SHIFT'), 'value': 'Shift'}])
{'label': _('SHIFT'), 'value': 'Shift'}], compact=True)
grid0.addWidget(self.mselectlabel, 50, 0)
grid0.addWidget(self.mselect_radio, 50, 1)
m_grid.addWidget(self.mselectlabel, 50, 0)
m_grid.addWidget(self.mselect_radio, 50, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 52, 0, 1, 2)
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
self.par_label = FCLabel('<b><font color="blue">%s:</font></b>' % _('Parameters'))
self.layout.addWidget(self.par_label)
par_frame = FCFrame()
self.layout.addWidget(par_frame)
par_grid = FCGridLayout(v_spacing=5, h_spacing=3)
par_frame.setLayout(par_grid)
# Delete confirmation
self.delete_conf_cb = FCCheckBox(_('Delete object confirmation'))
@@ -390,14 +424,14 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
"whenever the Delete object(s) event is triggered, either by\n"
"menu shortcut or key shortcut.")
)
grid0.addWidget(self.delete_conf_cb, 54, 0, 1, 2)
par_grid.addWidget(self.delete_conf_cb, 0, 0, 1, 2)
self.allow_edit_cb = FCCheckBox(_("Allow Edit"))
self.allow_edit_cb.setToolTip(
_("When checked, the user can edit the object names in the Project Tab\n"
"by clicking on the object name. Active after restart.")
)
grid0.addWidget(self.allow_edit_cb, 56, 0, 1, 2)
par_grid.addWidget(self.allow_edit_cb, 2, 0, 1, 2)
# Open behavior
self.open_style_cb = FCCheckBox('%s' % _('"Open" behavior'))
@@ -408,7 +442,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
"path for saving files or the path for opening files.")
)
grid0.addWidget(self.open_style_cb, 58, 0, 1, 2)
par_grid.addWidget(self.open_style_cb, 4, 0, 1, 2)
# Enable/Disable ToolTips globally
self.toggle_tooltips_cb = FCCheckBox(label=_('Enable ToolTips'))
@@ -417,7 +451,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
"when hovering with mouse over items throughout the App.")
)
grid0.addWidget(self.toggle_tooltips_cb, 60, 0, 1, 2)
par_grid.addWidget(self.toggle_tooltips_cb, 6, 0, 1, 2)
# Bookmarks Limit in the Help Menu
self.bm_limit_spinner = FCSpinner()
@@ -429,8 +463,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
"but the menu will hold only so much.")
)
grid0.addWidget(self.bm_limit_label, 62, 0)
grid0.addWidget(self.bm_limit_spinner, 62, 1)
par_grid.addWidget(self.bm_limit_label, 8, 0)
par_grid.addWidget(self.bm_limit_spinner, 8, 1)
# Activity monitor icon
self.activity_label = FCLabel('%s:' % _("Activity Icon"))
@@ -440,8 +474,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
self.activity_combo = FCComboBox()
self.activity_combo.addItems(['Ball black', 'Ball green', 'Arrow green', 'Eclipse green'])
grid0.addWidget(self.activity_label, 64, 0)
grid0.addWidget(self.activity_combo, 64, 1)
par_grid.addWidget(self.activity_label, 10, 0)
par_grid.addWidget(self.activity_combo, 10, 1)
self.layout.addStretch()

View File

@@ -1,10 +1,9 @@
import sys
from PyQt6 import QtWidgets
from PyQt6.QtCore import QSettings
from appGUI.GUIElements import RadioSet, FCSpinner, FCCheckBox, FCComboBox, FCButton, OptionalInputSection, \
FCDoubleSpinner, FCLabel, FCGridLayout, RadioSetDefaults
FCDoubleSpinner, FCLabel, FCGridLayout, RadioSetDefaults, FCFrame
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
@@ -16,6 +15,8 @@ if '_' not in builtins.__dict__:
_ = gettext.gettext
# https://www.w3schools.com/colors/colors_names.asp
# Colors names
class GeneralAppPrefGroupUI(OptionsGroupUI):
def __init__(self, defaults, decimals=4, parent=None):
super(GeneralAppPrefGroupUI, self).__init__(self, parent=parent)
@@ -24,21 +25,28 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
self.decimals = decimals
self.defaults = defaults
# Create a form layout for the Application general settings
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
self.layout.addLayout(grid0)
# Units for FlatCAM
self.unitslabel = FCLabel('<span style="color:red;"><b>%s:</b></span>' % _('Units'))
# #############################################################################################################
# Grid0 Frame
# #############################################################################################################
self.unitslabel = FCLabel('<span style="color:red;"><b>%s</b></span>' % _('Units'))
self.unitslabel.setToolTip(_("The default value for the application units.\n"
"Whatever is selected here is set every time\n"
"FlatCAM is started."))
self.layout.addWidget(self.unitslabel)
grid0_frame = FCFrame()
self.layout.addWidget(grid0_frame)
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
grid0_frame.setLayout(grid0)
# Units for FlatCAM
self.units_radio = RadioSetDefaults(
choices=[{'label': _('MM'), 'value': 'MM'}, {'label': _('IN'), 'value': 'IN'}]
choices=[{'label': _('mm'), 'value': 'MM'}, {'label': _('inch'), 'value': 'IN'}],
compact=True
)
grid0.addWidget(self.unitslabel, 0, 0)
grid0.addWidget(self.units_radio, 0, 1)
grid0.addWidget(self.units_radio, 0, 0, 1, 2)
# Precision Metric
self.precision_metric_label = FCLabel('%s:' % _('Precision MM'))
@@ -68,6 +76,18 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.precision_inch_label, 4, 0)
grid0.addWidget(self.precision_inch_entry, 4, 1)
self.par_label = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
self.layout.addWidget(self.par_label)
# #############################################################################################################
# Parameters
# #############################################################################################################
grid1_frame = FCFrame()
self.layout.addWidget(grid1_frame)
grid1 = FCGridLayout(v_spacing=5, h_spacing=3)
grid1_frame.setLayout(grid1)
# Graphic Engine for FlatCAM
self.ge_label = FCLabel('<b>%s:</b>' % _('Graphic Engine'))
self.ge_label.setToolTip(_("Choose what graphic engine to use in FlatCAM.\n"
@@ -76,141 +96,16 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
"Some graphic cards are too old and do not work in OpenGL(3D) mode, like:\n"
"Intel HD3000 or older. In this case the plot area will be black therefore\n"
"use the Legacy(2D) mode."))
self.ge_radio = RadioSet([{'label': _('Legacy(2D)'), 'value': '2D'},
{'label': _('OpenGL(3D)'), 'value': '3D'}],
orientation='vertical')
self.ge_radio = RadioSet([{'label': _('2D'), 'value': '2D'},
{'label': _('3D'), 'value': '3D'}], compact=True)
grid0.addWidget(self.ge_label, 6, 0)
grid0.addWidget(self.ge_radio, 6, 1)
grid1.addWidget(self.ge_label, 0, 0)
grid1.addWidget(self.ge_radio, 0, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 8, 0, 1, 2)
# Application Level for FlatCAM
self.app_level_label = FCLabel('<span style="color:red;"><b>%s:</b></span>' % _('APPLICATION LEVEL'))
self.app_level_label.setToolTip(_("Choose the default level of usage for FlatCAM.\n"
"BASIC level -> reduced functionality, best for beginner's.\n"
"ADVANCED level -> full functionality.\n\n"
"The choice here will influence the parameters in\n"
"the Selected Tab for all kinds of FlatCAM objects."))
grid0.addWidget(self.app_level_label, 10, 0, 1, 2)
self.app_level_radio = RadioSet([{'label': _('Beginner'), 'value': 'b'},
{'label': _('Advanced'), 'value': 'a'}])
grid0.addWidget(self.app_level_radio, 12, 0, 1, 2)
# Portability
self.portability_cb = FCCheckBox('%s' % _('Portable app'))
self.portability_cb.setToolTip(_("Choose if the application should run as portable.\n\n"
"If Checked the application will run portable,\n"
"which means that the preferences files will be saved\n"
"in the application folder, in the lib\\config subfolder."))
grid0.addWidget(self.portability_cb, 14, 0, 1, 2)
# Verbose Log
self.verbose_cb = FCCheckBox('%s' % _('Verbose log'))
self.verbose_cb.setToolTip(_("Enable log messages in the Tcl Shell.\n"
"Require restart."))
grid0.addWidget(self.verbose_cb, 16, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 18, 0, 1, 2)
# Languages for FlatCAM
self.languagelabel = FCLabel('<b>%s</b>' % _('Languages'))
self.languagelabel.setToolTip(_("Set the language used throughout FlatCAM."))
grid0.addWidget(self.languagelabel, 20, 0, 1, 2)
self.language_combo = FCComboBox()
grid0.addWidget(self.language_combo, 22, 0, 1, 2)
self.language_combo.addItems(self.defaults["global_languages"])
self.language_apply_btn = FCButton(_("Apply Language"))
self.language_apply_btn.setToolTip(_("Set the language used throughout FlatCAM.\n"
"The app will restart after click."))
grid0.addWidget(self.language_apply_btn, 24, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 26, 0, 1, 2)
# -----------------------------------------------------------
# ----------- APPLICATION STARTUP SETTINGS ------------------
# -----------------------------------------------------------
self.startup_label = FCLabel('<b>%s</b>' % _('Startup Settings'))
grid0.addWidget(self.startup_label, 28, 0, 1, 2)
# Splash Screen
self.splash_cb = FCCheckBox('%s' % _('Splash Screen'))
self.splash_cb.setToolTip(
_("Enable display of the splash screen at application startup.")
)
qsettings = QSettings("Open Source", "FlatCAM")
if qsettings.value("splash_screen"):
self.splash_cb.set_value(True)
else:
self.splash_cb.set_value(False)
grid0.addWidget(self.splash_cb, 30, 0, 1, 2)
# Sys Tray Icon
self.systray_cb = FCCheckBox('%s' % _('Sys Tray Icon'))
self.systray_cb.setToolTip(
_("Enable display of FlatCAM icon in Sys Tray.")
)
grid0.addWidget(self.systray_cb, 32, 0, 1, 2)
# Shell StartUp CB
self.shell_startup_cb = FCCheckBox(label='%s' % _('Show Shell'))
self.shell_startup_cb.setToolTip(
_("Check this box if you want the shell to\n"
"start automatically at startup.")
)
grid0.addWidget(self.shell_startup_cb, 34, 0, 1, 2)
# Project at StartUp CB
self.project_startup_cb = FCCheckBox(label='%s' % _('Show Project'))
self.project_startup_cb.setToolTip(
_("Check this box if you want the project/selected/tool tab area to\n"
"to be shown automatically at startup.")
)
grid0.addWidget(self.project_startup_cb, 36, 0, 1, 2)
# Version Check CB
self.version_check_cb = FCCheckBox(label='%s' % _('Version Check'))
self.version_check_cb.setToolTip(
_("Check this box if you want to check\n"
"for a new version automatically at startup.")
)
grid0.addWidget(self.version_check_cb, 38, 0, 1, 2)
# Send Stats CB
self.send_stats_cb = FCCheckBox(label='%s' % _('Send Statistics'))
self.send_stats_cb.setToolTip(
_("Check this box if you agree to send anonymous\n"
"stats automatically at startup, to help improve FlatCAM.")
)
grid0.addWidget(self.send_stats_cb, 40, 0, 1, 2)
self.ois_version_check = OptionalInputSection(self.version_check_cb, [self.send_stats_cb])
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 42, 0, 1, 2)
# separator_line = QtWidgets.QFrame()
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
# grid0.addWidget(separator_line, 8, 0, 1, 2)
# Worker Numbers
self.worker_number_label = FCLabel('%s:' % _('Workers number'))
@@ -225,8 +120,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
self.worker_number_sb = FCSpinner()
self.worker_number_sb.set_range(2, 16)
grid0.addWidget(self.worker_number_label, 44, 0)
grid0.addWidget(self.worker_number_sb, 44, 1)
grid1.addWidget(self.worker_number_label, 2, 0)
grid1.addWidget(self.worker_number_sb, 2, 1)
# Geometric tolerance
tol_label = FCLabel('%s:' % _("Geo Tolerance"))
@@ -242,17 +137,157 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
self.tol_entry.setSingleStep(0.001)
self.tol_entry.set_precision(6)
grid0.addWidget(tol_label, 46, 0)
grid0.addWidget(self.tol_entry, 46, 1)
grid1.addWidget(tol_label, 4, 0)
grid1.addWidget(self.tol_entry, 4, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 48, 0, 1, 2)
# Portability
self.portability_cb = FCCheckBox('%s' % _('Portable app'))
self.portability_cb.setToolTip(_("Choose if the application should run as portable.\n\n"
"If Checked the application will run portable,\n"
"which means that the preferences files will be saved\n"
"in the application folder, in the lib\\config subfolder."))
grid1.addWidget(self.portability_cb, 6, 0, 1, 2)
# Verbose Log
self.verbose_cb = FCCheckBox('%s' % _('Verbose log'))
self.verbose_cb.setToolTip(_("Enable log messages in the Tcl Shell.\n"
"Require restart."))
grid1.addWidget(self.verbose_cb, 8, 0, 1, 2)
# #############################################################################################################
# Grid0 Frame
# #############################################################################################################
self.app_level_label = FCLabel('<span style="color:red;"><b>%s</b></span>' % _('Application Level'))
self.app_level_label.setToolTip(_("Choose the default level of usage for FlatCAM.\n"
"BASIC level -> reduced functionality, best for beginner's.\n"
"ADVANCED level -> full functionality.\n\n"
"The choice here will influence the parameters in\n"
"the Selected Tab for all kinds of FlatCAM objects."))
self.layout.addWidget(self.app_level_label)
grid2_frame = FCFrame()
self.layout.addWidget(grid2_frame)
grid2 = FCGridLayout(v_spacing=5, h_spacing=3)
grid2_frame.setLayout(grid2)
# Application Level for FlatCAM
self.app_level_radio = RadioSet([{'label': _('Beginner'), 'value': 'b'},
{'label': _('Advanced'), 'value': 'a'}], compact=True)
grid2.addWidget(self.app_level_radio, 2, 0, 1, 2)
# #############################################################################################################
# Grid3 Frame
# #############################################################################################################
# Languages for FlatCAM
self.languagelabel = FCLabel('<span style="color:DarkCyan;"><b>%s</b></span>' % _('Languages'))
self.languagelabel.setToolTip(_("Set the language used throughout FlatCAM."))
self.layout.addWidget(self.languagelabel)
grid3_frame = FCFrame()
self.layout.addWidget(grid3_frame)
grid3 = FCGridLayout(v_spacing=5, h_spacing=3)
grid3_frame.setLayout(grid3)
self.language_combo = FCComboBox()
self.language_combo.addItems(self.defaults["global_languages"])
grid3.addWidget(self.language_combo, 0, 0, 1, 2)
self.language_apply_btn = FCButton(_("Apply Language"))
self.language_apply_btn.setToolTip(_("Set the language used throughout FlatCAM.\n"
"The app will restart after click."))
grid3.addWidget(self.language_apply_btn, 2, 0, 1, 2)
# -----------------------------------------------------------
# ----------- APPLICATION STARTUP SETTINGS ------------------
# -----------------------------------------------------------
self.startup_label = FCLabel('<span style="color:green;"><b>%s</b></span>' % _('Startup Settings'))
self.layout.addWidget(self.startup_label)
# #############################################################################################################
# Grid4 Frame
# #############################################################################################################
grid4_frame = FCFrame()
self.layout.addWidget(grid4_frame)
grid4 = FCGridLayout(v_spacing=5, h_spacing=3)
grid4_frame.setLayout(grid4)
# Splash Screen
self.splash_cb = FCCheckBox('%s' % _('Splash Screen'))
self.splash_cb.setToolTip(
_("Enable display of the splash screen at application startup.")
)
qsettings = QSettings("Open Source", "FlatCAM")
if qsettings.value("splash_screen"):
self.splash_cb.set_value(True)
else:
self.splash_cb.set_value(False)
grid4.addWidget(self.splash_cb, 0, 0, 1, 2)
# Sys Tray Icon
self.systray_cb = FCCheckBox('%s' % _('Sys Tray Icon'))
self.systray_cb.setToolTip(
_("Enable display of FlatCAM icon in Sys Tray.")
)
grid4.addWidget(self.systray_cb, 2, 0, 1, 2)
# Shell StartUp CB
self.shell_startup_cb = FCCheckBox(label='%s' % _('Show Shell'))
self.shell_startup_cb.setToolTip(
_("Check this box if you want the shell to\n"
"start automatically at startup.")
)
grid4.addWidget(self.shell_startup_cb, 4, 0, 1, 2)
# Project at StartUp CB
self.project_startup_cb = FCCheckBox(label='%s' % _('Show Project'))
self.project_startup_cb.setToolTip(
_("Check this box if you want the project/selected/tool tab area to\n"
"to be shown automatically at startup.")
)
grid4.addWidget(self.project_startup_cb, 6, 0, 1, 2)
# Version Check CB
self.version_check_cb = FCCheckBox(label='%s' % _('Version Check'))
self.version_check_cb.setToolTip(
_("Check this box if you want to check\n"
"for a new version automatically at startup.")
)
grid4.addWidget(self.version_check_cb, 8, 0, 1, 2)
# Send Stats CB
self.send_stats_cb = FCCheckBox(label='%s' % _('Send Statistics'))
self.send_stats_cb.setToolTip(
_("Check this box if you agree to send anonymous\n"
"stats automatically at startup, to help improve FlatCAM.")
)
grid4.addWidget(self.send_stats_cb, 10, 0, 1, 2)
self.ois_version_check = OptionalInputSection(self.version_check_cb, [self.send_stats_cb])
# Save Settings
self.save_label = FCLabel('<b>%s</b>' % _("Save Settings"))
grid0.addWidget(self.save_label, 50, 0, 1, 2)
self.save_label = FCLabel('<span style="color:purple;"><b>%s</b></span>' % _("Save Settings"))
self.layout.addWidget(self.save_label)
# #############################################################################################################
# Grid6 Frame
# #############################################################################################################
grid6_frame = FCFrame()
self.layout.addWidget(grid6_frame)
grid6 = FCGridLayout(v_spacing=5, h_spacing=3)
grid6_frame.setLayout(grid6)
# Save compressed project CB
self.save_type_cb = FCCheckBox(_('Save Compressed Project'))
@@ -261,7 +296,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
"When checked it will save a compressed FlatCAM project.")
)
grid0.addWidget(self.save_type_cb, 52, 0, 1, 2)
grid6.addWidget(self.save_type_cb, 0, 0, 1, 2)
# Project LZMA Comppression Level
self.compress_spinner = FCSpinner()
@@ -273,8 +308,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
"but require more RAM usage and more processing time.")
)
grid0.addWidget(self.compress_label, 54, 0)
grid0.addWidget(self.compress_spinner, 54, 1)
grid6.addWidget(self.compress_label, 2, 0)
grid6.addWidget(self.compress_spinner, 2, 1)
self.proj_ois = OptionalInputSection(self.save_type_cb, [self.compress_label, self.compress_spinner], True)
@@ -286,7 +321,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
"at the set interval.")
)
grid0.addWidget(self.autosave_cb, 56, 0, 1, 2)
grid6.addWidget(self.autosave_cb, 4, 0, 1, 2)
# Auto Save Timeout Interval
self.autosave_entry = FCSpinner()
@@ -299,21 +334,25 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
"While active, some operations may block this feature.")
)
grid0.addWidget(self.autosave_label, 58, 0)
grid0.addWidget(self.autosave_entry, 58, 1)
grid6.addWidget(self.autosave_label, 6, 0)
grid6.addWidget(self.autosave_entry, 6, 1)
# self.as_ois = OptionalInputSection(self.autosave_cb, [self.autosave_label, self.autosave_entry], True)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 60, 0, 1, 2)
self.pdf_param_label = FCLabel('<B>%s:</b>' % _("Text to PDF parameters"))
self.pdf_param_label = FCLabel('<span style="color:orange;"><b>%s</b></span>' % _("Text to PDF parameters"))
self.pdf_param_label.setToolTip(
_("Used when saving text in Code Editor or in FlatCAM Document objects.")
)
grid0.addWidget(self.pdf_param_label, 62, 0, 1, 2)
self.layout.addWidget(self.pdf_param_label)
# #############################################################################################################
# Grid7 Frame
# #############################################################################################################
grid7_frame = FCFrame()
self.layout.addWidget(grid7_frame)
grid7 = FCGridLayout(v_spacing=5, h_spacing=3)
grid7_frame.setLayout(grid7)
# Top Margin value
self.tmargin_entry = FCDoubleSpinner()
@@ -325,8 +364,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
_("Distance between text body and the top of the PDF file.")
)
grid0.addWidget(self.tmargin_label, 64, 0)
grid0.addWidget(self.tmargin_entry, 64, 1)
grid7.addWidget(self.tmargin_label, 0, 0)
grid7.addWidget(self.tmargin_entry, 0, 1)
# Bottom Margin value
self.bmargin_entry = FCDoubleSpinner()
@@ -338,8 +377,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
_("Distance between text body and the bottom of the PDF file.")
)
grid0.addWidget(self.bmargin_label, 66, 0)
grid0.addWidget(self.bmargin_entry, 66, 1)
grid7.addWidget(self.bmargin_label, 2, 0)
grid7.addWidget(self.bmargin_entry, 2, 1)
# Left Margin value
self.lmargin_entry = FCDoubleSpinner()
@@ -351,8 +390,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
_("Distance between text body and the left of the PDF file.")
)
grid0.addWidget(self.lmargin_label, 68, 0)
grid0.addWidget(self.lmargin_entry, 68, 1)
grid7.addWidget(self.lmargin_label, 4, 0)
grid7.addWidget(self.lmargin_entry, 4, 1)
# Right Margin value
self.rmargin_entry = FCDoubleSpinner()
@@ -364,11 +403,13 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
_("Distance between text body and the right of the PDF file.")
)
grid0.addWidget(self.rmargin_label, 70, 0)
grid0.addWidget(self.rmargin_entry, 70, 1)
grid7.addWidget(self.rmargin_label, 6, 0)
grid7.addWidget(self.rmargin_entry, 6, 1)
self.layout.addStretch()
FCGridLayout.set_common_column_size([grid0, grid1, grid6, grid7], 0)
if sys.platform != 'win32':
self.portability_cb.hide()

View File

@@ -86,7 +86,7 @@ class GeneralAppSettingsGroupUI(OptionsGroupUI2):
self.textbox_font_size_field = self.option_dict()["textbox_font_size"].get_field()
if qsettings.contains("textbox_font_size"):
self.textbox_font_size_field.set_value(settings.value('textbox_font_size', type=int))
self.textbox_font_size_field.set_value(qsettings.value('textbox_font_size', type=int))
else:
self.textbox_font_size_field.set_value(10)
@@ -120,7 +120,7 @@ class GeneralAppSettingsGroupUI(OptionsGroupUI2):
def build_options(self) -> [OptionUI]:
return [
HeadingOptionUI(label_text="Grid Settings", label_tooltip=None),
HeadingOptionUI(label_text="Grid Settings", color="brown", label_tooltip=None),
DoubleSpinnerOptionUI(
option="global_gridx",
label_text="X value",

View File

@@ -2,7 +2,7 @@ from PyQt6 import QtWidgets, QtCore
from PyQt6.QtCore import QSettings
from appGUI.GUIElements import RadioSet, FCCheckBox, FCComboBox, FCSliderWithSpinner, FCColorEntry, FCLabel, \
FCGridLayout
FCGridLayout, FCFrame
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
@@ -22,9 +22,17 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
self.decimals = decimals
self.defaults = defaults
# Create a grid layout for the Application general settings
self.param_lbl = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
self.layout.addWidget(self.param_lbl)
# #############################################################################################################
# Grid0 Frame
# #############################################################################################################
par_frame = FCFrame()
self.layout.addWidget(par_frame)
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
self.layout.addLayout(grid0)
par_frame.setLayout(grid0)
# Theme selection
self.theme_label = FCLabel('%s:' % _('Theme'))
@@ -36,7 +44,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
self.theme_radio = RadioSet([
{"label": _("Light"), "value": "white"},
{"label": _("Dark"), "value": "black"}
], orientation='vertical')
], compact=True)
grid0.addWidget(self.theme_label, 0, 0)
grid0.addWidget(self.theme_radio, 0, 1)
@@ -48,7 +56,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
"a lighter (gray) color. To be used when a\n"
"full dark theme is applied.")
)
grid0.addWidget(self.gray_icons_cb, 1, 0, 1, 3)
grid0.addWidget(self.gray_icons_cb, 2, 0, 1, 3)
# self.theme_button = FCButton(_("Apply Theme"))
# self.theme_button.setToolTip(
@@ -61,7 +69,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 3, 0, 1, 2)
grid0.addWidget(separator_line, 4, 0, 1, 2)
# Layout selection
self.layout_label = FCLabel('%s:' % _('Layout'))
@@ -75,8 +83,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
self.layout_combo.addItem("compact")
self.layout_combo.addItem("minimal")
grid0.addWidget(self.layout_label, 4, 0)
grid0.addWidget(self.layout_combo, 4, 1)
grid0.addWidget(self.layout_label, 6, 0)
grid0.addWidget(self.layout_combo, 6, 1)
# Set the current index for layout_combo
qsettings = QSettings("Open Source", "FlatCAM")
@@ -99,8 +107,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
self.style_combo.setCurrentIndex(index)
self.style_combo.activated.connect(self.handle_style)
grid0.addWidget(self.style_label, 5, 0)
grid0.addWidget(self.style_combo, 5, 1)
grid0.addWidget(self.style_label, 8, 0)
grid0.addWidget(self.style_combo, 8, 1)
# Enable Hover box
self.hover_cb = FCCheckBox('%s' % _('Hover Shape'))
@@ -109,7 +117,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
"It is displayed whenever the mouse cursor is hovering\n"
"over any kind of not-selected object.")
)
grid0.addWidget(self.hover_cb, 8, 0, 1, 3)
grid0.addWidget(self.hover_cb, 10, 0, 1, 3)
# Enable Selection box
self.selection_cb = FCCheckBox('%s' % _('Selection Shape'))
@@ -119,16 +127,23 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
"either by clicking or dragging mouse from left to right or\n"
"right to left.")
)
grid0.addWidget(self.selection_cb, 9, 0, 1, 3)
grid0.addWidget(self.selection_cb, 12, 0, 1, 3)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 14, 0, 1, 2)
# #############################################################################################################
# Grid1 Frame
# #############################################################################################################
self.color_lbl = FCLabel('<span style="color:red;"><b>%s</b></span>' % _("Colors"))
self.layout.addWidget(self.color_lbl)
color_frame = FCFrame()
self.layout.addWidget(color_frame)
grid1 = FCGridLayout(v_spacing=5, h_spacing=3)
color_frame.setLayout(grid1)
# Plot Selection (left - right) Color
self.sel_lr_label = FCLabel('<b>%s</b>' % _('Left-Right Selection Color'))
grid0.addWidget(self.sel_lr_label, 15, 0, 1, 2)
grid1.addWidget(self.sel_lr_label, 0, 0, 1, 2)
self.sl_color_label = FCLabel('%s:' % _('Outline'))
self.sl_color_label.setToolTip(
@@ -136,8 +151,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
)
self.sl_color_entry = FCColorEntry()
grid0.addWidget(self.sl_color_label, 16, 0)
grid0.addWidget(self.sl_color_entry, 16, 1)
grid1.addWidget(self.sl_color_label, 2, 0)
grid1.addWidget(self.sl_color_entry, 2, 1)
self.sf_color_label = FCLabel('%s:' % _('Fill'))
self.sf_color_label.setToolTip(
@@ -148,8 +163,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
)
self.sf_color_entry = FCColorEntry()
grid0.addWidget(self.sf_color_label, 17, 0)
grid0.addWidget(self.sf_color_entry, 17, 1)
grid1.addWidget(self.sf_color_label, 4, 0)
grid1.addWidget(self.sf_color_entry, 4, 1)
# Plot Selection (left - right) Fill Transparency Level
self.left_right_alpha_label = FCLabel('%s:' % _('Alpha'))
@@ -158,17 +173,17 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
)
self.left_right_alpha_entry = FCSliderWithSpinner(0, 255, 1)
grid0.addWidget(self.left_right_alpha_label, 18, 0)
grid0.addWidget(self.left_right_alpha_entry, 18, 1)
grid1.addWidget(self.left_right_alpha_label, 6, 0)
grid1.addWidget(self.left_right_alpha_entry, 6, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 19, 0, 1, 2)
grid1.addWidget(separator_line, 8, 0, 1, 2)
# Plot Selection (left - right) Color
self.sel_rl_label = FCLabel('<b>%s</b>' % _('Right-Left Selection Color'))
grid0.addWidget(self.sel_rl_label, 20, 0, 1, 2)
grid1.addWidget(self.sel_rl_label, 10, 0, 1, 2)
# Plot Selection (right - left) Line Color
self.alt_sl_color_label = FCLabel('%s:' % _('Outline'))
@@ -177,8 +192,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
)
self.alt_sl_color_entry = FCColorEntry()
grid0.addWidget(self.alt_sl_color_label, 21, 0)
grid0.addWidget(self.alt_sl_color_entry, 21, 1)
grid1.addWidget(self.alt_sl_color_label, 12, 0)
grid1.addWidget(self.alt_sl_color_entry, 12, 1)
# Plot Selection (right - left) Fill Color
self.alt_sf_color_label = FCLabel('%s:' % _('Fill'))
@@ -190,8 +205,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
)
self.alt_sf_color_entry = FCColorEntry()
grid0.addWidget(self.alt_sf_color_label, 22, 0)
grid0.addWidget(self.alt_sf_color_entry, 22, 1)
grid1.addWidget(self.alt_sf_color_label, 14, 0)
grid1.addWidget(self.alt_sf_color_entry, 14, 1)
# Plot Selection (right - left) Fill Transparency Level
self.right_left_alpha_label = FCLabel('%s:' % _('Alpha'))
@@ -200,20 +215,20 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
)
self.right_left_alpha_entry = FCSliderWithSpinner(0, 255, 1)
grid0.addWidget(self.right_left_alpha_label, 23, 0)
grid0.addWidget(self.right_left_alpha_entry, 23, 1)
grid1.addWidget(self.right_left_alpha_label, 16, 0)
grid1.addWidget(self.right_left_alpha_entry, 16, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 24, 0, 1, 2)
grid1.addWidget(separator_line, 18, 0, 1, 2)
# ------------------------------------------------------------------
# ----------------------- Editor Color -----------------------------
# ------------------------------------------------------------------
self.editor_color_label = FCLabel('<b>%s</b>' % _('Editor Color'))
grid0.addWidget(self.editor_color_label, 25, 0, 1, 2)
grid1.addWidget(self.editor_color_label, 20, 0, 1, 2)
# Editor Draw Color
self.draw_color_label = FCLabel('%s:' % _('Drawing'))
@@ -222,8 +237,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
)
self.draw_color_entry = FCColorEntry()
grid0.addWidget(self.draw_color_label, 26, 0)
grid0.addWidget(self.draw_color_entry, 26, 1)
grid1.addWidget(self.draw_color_label, 22, 0)
grid1.addWidget(self.draw_color_entry, 22, 1)
# Editor Draw Selection Color
self.sel_draw_color_label = FCLabel('%s:' % _('Selection'))
@@ -232,20 +247,20 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
)
self.sel_draw_color_entry = FCColorEntry()
grid0.addWidget(self.sel_draw_color_label, 27, 0)
grid0.addWidget(self.sel_draw_color_entry, 27, 1)
grid1.addWidget(self.sel_draw_color_label, 24, 0)
grid1.addWidget(self.sel_draw_color_entry, 24, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 28, 0, 1, 2)
grid1.addWidget(separator_line, 26, 0, 1, 2)
# ------------------------------------------------------------------
# ----------------------- Project Settings -----------------------------
# ------------------------------------------------------------------
self.proj_settings_label = FCLabel('<b>%s</b>' % _('Project Items Color'))
grid0.addWidget(self.proj_settings_label, 29, 0, 1, 2)
grid1.addWidget(self.proj_settings_label, 28, 0, 1, 2)
# Project Tab items color
self.proj_color_label = FCLabel('%s:' % _('Enabled'))
@@ -254,8 +269,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
)
self.proj_color_entry = FCColorEntry()
grid0.addWidget(self.proj_color_label, 30, 0)
grid0.addWidget(self.proj_color_entry, 30, 1)
grid1.addWidget(self.proj_color_label, 30, 0)
grid1.addWidget(self.proj_color_entry, 30, 1)
self.proj_color_dis_label = FCLabel('%s:' % _('Disabled'))
self.proj_color_dis_label.setToolTip(
@@ -264,8 +279,10 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
)
self.proj_color_dis_entry = FCColorEntry()
grid0.addWidget(self.proj_color_dis_label, 31, 0)
grid0.addWidget(self.proj_color_dis_entry, 31, 1)
grid1.addWidget(self.proj_color_dis_label, 32, 0)
grid1.addWidget(self.proj_color_dis_entry, 32, 1)
FCGridLayout.set_common_column_size([grid0, grid1], 0)
# Project autohide CB
self.project_autohide_cb = FCCheckBox(label=_('Project AutoHide'))
@@ -275,10 +292,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
"to show whenever a new object is created.")
)
grid0.addWidget(self.project_autohide_cb, 32, 0, 1, 2)
# Just to add empty rows
grid0.addWidget(FCLabel(''), 33, 0, 1, 2)
self.layout.addWidget(self.project_autohide_cb)
self.layout.addStretch()