[Gui] Fix color bar position and text (#10552)

* [Gui] Fix ColorBar position and labelling

* [Gui] Improve formatting

* [Gui] ColorBar adjusts if user squashes window height

* [Gui] Changes following feedback
This commit is contained in:
Syres916
2023-09-20 00:35:22 +01:00
committed by GitHub
parent b2d255e5fc
commit 0c96b7d903
4 changed files with 172 additions and 12 deletions

View File

@@ -75,6 +75,8 @@ void DlgSettingsViewColor::saveSettings()
ui->checkMidColor->onSave();
ui->TreeEditColor->onSave();
ui->TreeActiveColor->onSave();
ui->CbLabelColor->onSave();
ui->CbLabelTextSize->onSave();
}
void DlgSettingsViewColor::loadSettings()
@@ -89,7 +91,9 @@ void DlgSettingsViewColor::loadSettings()
ui->checkMidColor->onRestore();
ui->TreeEditColor->onRestore();
ui->TreeActiveColor->onRestore();
ui->CbLabelColor->onRestore();
ui->CbLabelTextSize->onRestore();
if (ui->radioButtonSimple->isChecked())
onRadioButtonSimpleToggled(true);
else if(ui->radioButtonGradient->isChecked())

View File

@@ -407,7 +407,140 @@
</widget>
</item>
<item>
<spacer name="spacer_3">
<widget class="QGroupBox" name="groupColorBar">
<property name="title">
<string>Color Bar</string>
</property>
<layout class="QGridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_CbLabelColor">
<property name="minimumSize">
<size>
<width>240</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Label text color</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::PrefColorButton" name="CbLabelColor">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color Bar (used in Mesh and FEM Wbs) Label text color</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>CbLabelColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_CbLabelTextSize">
<property name="text">
<string>Label text size</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefSpinBox" name="CbLabelTextSize">
<property name="toolTip">
<string>Color Bar (used in Mesh and FEM Wbs) Label Text Size</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>4</number>
</property>
<property name="maximum">
<number>36</number>
</property>
<property name="value">
<number>13</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>CbLabelTextSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<spacer name="spacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="spacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@@ -442,6 +575,11 @@
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefSpinBox</class>
<extends>QSpinBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>SelectionColor_Background</tabstop>