diff options
author | David Schulz <david.schulz@qt.io> | 2019-02-21 13:25:17 +0100 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2019-03-04 10:16:19 +0000 |
commit | 51e24f5ad4fda308f6d6875969318ccf7158bffa (patch) | |
tree | c67ad4630fd9430801f99e57415b296d54579061 /src/plugins/texteditor | |
parent | 473352940fddfe8e6ca93995615107a2bfa84a06 (diff) |
TextEditor: Hide controls in scheme editor for builtin schemes
Show a label instead with a link that copies the current color scheme.
Fixes: QTCREATORBUG-21874
Change-Id: I74083bac8d7124341b4b63d8e172172235c5e184
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/texteditor')
-rw-r--r-- | src/plugins/texteditor/colorschemeedit.cpp | 48 | ||||
-rw-r--r-- | src/plugins/texteditor/colorschemeedit.h | 3 | ||||
-rw-r--r-- | src/plugins/texteditor/colorschemeedit.ui | 510 | ||||
-rw-r--r-- | src/plugins/texteditor/fontsettingspage.cpp | 2 |
4 files changed, 282 insertions, 281 deletions
diff --git a/src/plugins/texteditor/colorschemeedit.cpp b/src/plugins/texteditor/colorschemeedit.cpp index 5f999835c53..76fcf7b29b7 100644 --- a/src/plugins/texteditor/colorschemeedit.cpp +++ b/src/plugins/texteditor/colorschemeedit.cpp @@ -155,6 +155,7 @@ ColorSchemeEdit::ColorSchemeEdit(QWidget *parent) : m_ui->detailsScrollArea->viewport()->setAutoFillBackground(false); m_ui->scrollAreaWidgetContents->setAutoFillBackground(false); m_ui->itemList->setModel(m_formatsModel); + m_ui->builtinSchemeLabel->setVisible(m_readOnly); populateUnderlineStyleComboBox(); @@ -186,6 +187,7 @@ ColorSchemeEdit::ColorSchemeEdit(QWidget *parent) : this, &ColorSchemeEdit::eraseUnderlineColor); connect(m_ui->underlineComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &ColorSchemeEdit::changeUnderlineStyle); + connect(m_ui->builtinSchemeLabel, &QLabel::linkActivated, this, &ColorSchemeEdit::copyScheme); } ColorSchemeEdit::~ColorSchemeEdit() @@ -214,31 +216,9 @@ void ColorSchemeEdit::setReadOnly(bool readOnly) m_readOnly = readOnly; - const bool enabled = !readOnly; - m_ui->foregroundLabel->setEnabled(enabled); - m_ui->foregroundToolButton->setEnabled(enabled); - m_ui->backgroundLabel->setEnabled(enabled); - m_ui->backgroundToolButton->setEnabled(enabled); - m_ui->eraseBackgroundToolButton->setEnabled(enabled); - m_ui->eraseForegroundToolButton->setEnabled(enabled); - m_ui->relativeForegroundHeadline->setEnabled(enabled); - m_ui->foregroundSaturationLabel->setEnabled(enabled); - m_ui->foregroundLightnessLabel->setEnabled(enabled); - m_ui->foregroundSaturationSpinBox->setEnabled(enabled); - m_ui->foregroundLightnessSpinBox->setEnabled(enabled); - m_ui->relativeBackgroundHeadline->setEnabled(enabled); - m_ui->backgroundSaturationLabel->setEnabled(enabled); - m_ui->backgroundLightnessLabel->setEnabled(enabled); - m_ui->backgroundSaturationSpinBox->setEnabled(enabled); - m_ui->backgroundLightnessSpinBox->setEnabled(enabled); - m_ui->fontHeadline->setEnabled(enabled); - m_ui->boldCheckBox->setEnabled(enabled); - m_ui->italicCheckBox->setEnabled(enabled); - m_ui->underlineHeadline->setEnabled(enabled); - m_ui->underlineLabel->setEnabled(enabled); - m_ui->underlineColorToolButton->setEnabled(enabled); - m_ui->eraseUnderlineColorToolButton->setEnabled(enabled); - m_ui->underlineComboBox->setEnabled(enabled); + m_ui->detailsScrollArea->setVisible(!readOnly); + m_ui->builtinSchemeLabel->setVisible(readOnly); + updateControls(); } void ColorSchemeEdit::setColorScheme(const ColorScheme &colorScheme) @@ -278,7 +258,8 @@ void ColorSchemeEdit::updateForegroundControls() const auto &formatDescription = m_descriptions[m_curItem]; const Format &format = m_scheme.formatFor(formatDescription.id()); - bool isVisible = formatDescription.showControl(FormatDescription::ShowForegroundControl); + bool isVisible = !m_readOnly + && formatDescription.showControl(FormatDescription::ShowForegroundControl); m_ui->relativeForegroundHeadline->setEnabled(isVisible); m_ui->foregroundLabel->setVisible(isVisible); @@ -297,7 +278,8 @@ void ColorSchemeEdit::updateBackgroundControls() const auto formatDescription = m_descriptions[m_curItem]; const Format &format = m_scheme.formatFor(formatDescription.id()); - bool isVisible = formatDescription.showControl(FormatDescription::ShowBackgroundControl); + bool isVisible = !m_readOnly + && formatDescription.showControl(FormatDescription::ShowBackgroundControl); m_ui->relativeBackgroundHeadline->setVisible(isVisible); m_ui->backgroundLabel->setVisible(isVisible); @@ -319,7 +301,8 @@ void ColorSchemeEdit::updateRelativeForegroundControls() QSignalBlocker saturationSignalBlocker(m_ui->foregroundSaturationSpinBox); QSignalBlocker lightnessSignalBlocker(m_ui->foregroundLightnessSpinBox); - bool isVisible = formatDescription.showControl(FormatDescription::ShowRelativeForegroundControl); + bool isVisible = !m_readOnly + && formatDescription.showControl(FormatDescription::ShowRelativeForegroundControl); m_ui->relativeForegroundHeadline->setVisible(isVisible); m_ui->foregroundSaturationLabel->setVisible(isVisible); @@ -350,7 +333,8 @@ void ColorSchemeEdit::updateRelativeBackgroundControls() QSignalBlocker saturationSignalBlocker(m_ui->backgroundSaturationSpinBox); QSignalBlocker lightnessSignalBlocker(m_ui->backgroundLightnessSpinBox); - bool isVisible = formatDescription.showControl(FormatDescription::ShowRelativeBackgroundControl); + bool isVisible = !m_readOnly + && formatDescription.showControl(FormatDescription::ShowRelativeBackgroundControl); m_ui->relativeBackgroundHeadline->setVisible(isVisible); m_ui->backgroundSaturationLabel->setVisible(isVisible); @@ -381,7 +365,8 @@ void ColorSchemeEdit::updateFontControls() QSignalBlocker boldSignalBlocker(m_ui->boldCheckBox); QSignalBlocker italicSignalBlocker(m_ui->italicCheckBox); - bool isVisible= formatDescription.showControl(FormatDescription::ShowFontControls); + bool isVisible = !m_readOnly + && formatDescription.showControl(FormatDescription::ShowFontControls); m_ui->fontHeadline->setVisible(isVisible); m_ui->boldCheckBox->setVisible(isVisible); @@ -401,7 +386,8 @@ void ColorSchemeEdit::updateUnderlineControls() QSignalBlocker comboBoxSignalBlocker(m_ui->underlineComboBox); - bool isVisible= formatDescription.showControl(FormatDescription::ShowUnderlineControl); + bool isVisible = !m_readOnly + && formatDescription.showControl(FormatDescription::ShowUnderlineControl); m_ui->underlineHeadline->setVisible(isVisible); m_ui->underlineLabel->setVisible(isVisible); diff --git a/src/plugins/texteditor/colorschemeedit.h b/src/plugins/texteditor/colorschemeedit.h index 6a1356609bf..f7504c170f8 100644 --- a/src/plugins/texteditor/colorschemeedit.h +++ b/src/plugins/texteditor/colorschemeedit.h @@ -59,6 +59,9 @@ public: void setColorScheme(const ColorScheme &colorScheme); const ColorScheme &colorScheme() const; +signals: + void copyScheme(); + private: void currentItemChanged(const QModelIndex &index); void changeForeColor(); diff --git a/src/plugins/texteditor/colorschemeedit.ui b/src/plugins/texteditor/colorschemeedit.ui index e9bb34596ba..ded11ef21f0 100644 --- a/src/plugins/texteditor/colorschemeedit.ui +++ b/src/plugins/texteditor/colorschemeedit.ui @@ -6,7 +6,7 @@ <rect> <x>0</x> <y>0</y> - <width>462</width> + <width>513</width> <height>416</height> </rect> </property> @@ -40,6 +40,16 @@ </widget> </item> <item> + <widget class="QLabel" name="builtinSchemeLabel"> + <property name="text"> + <string><p align='center'><b>Builtin color schemes need to be <a href="copy">copied</a><br/> before they can be changed</b></p></string> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + </widget> + </item> + <item> <widget class="QScrollArea" name="detailsScrollArea"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Expanding"> @@ -87,37 +97,21 @@ <property name="verticalSpacing"> <number>0</number> </property> - <item row="5" column="0" colspan="3"> - <widget class="QLabel" name="relativeForegroundHeadline"> - <property name="font"> - <font> - <weight>75</weight> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>Relative Foreground</string> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="foregroundLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Foreground:</string> + <item row="30" column="0" colspan="3"> + <spacer name="spacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> - <property name="buddy"> - <cstring>foregroundToolButton</cstring> + <property name="sizeHint" stdset="0"> + <size> + <width>200</width> + <height>0</height> + </size> </property> - </widget> + </spacer> </item> - <item row="10" column="0" colspan="3"> - <widget class="QWidget" name="relativeForegroundSpacer3" native="true"> + <item row="3" column="0" colspan="3"> + <widget class="QWidget" name="foregroundSpacer" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -127,77 +121,80 @@ <property name="minimumSize"> <size> <width>0</width> - <height>18</height> + <height>6</height> </size> </property> <property name="maximumSize"> <size> <width>16777215</width> - <height>18</height> + <height>6</height> </size> </property> </widget> </item> - <item row="9" column="0"> - <widget class="QLabel" name="foregroundLightnessLabel"> + <item row="1" column="1"> + <widget class="QToolButton" name="foregroundToolButton"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> - <string>Lightness:</string> + <string/> </property> </widget> </item> - <item row="0" column="1"> - <widget class="QToolButton" name="foregroundToolButton"> + <item row="10" column="0"> + <widget class="QLabel" name="foregroundLightnessLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> - <string/> + <string>Lightness:</string> </property> </widget> </item> - <item row="26" column="0" colspan="3"> - <spacer name="spacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> + <item row="11" column="0" colspan="3"> + <widget class="QWidget" name="relativeForegroundSpacer3" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="sizeHint" stdset="0"> + <property name="minimumSize"> <size> - <width>200</width> - <height>0</height> + <width>0</width> + <height>18</height> </size> </property> - </spacer> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>18</height> + </size> + </property> + </widget> </item> - <item row="3" column="2"> - <widget class="QToolButton" name="eraseBackgroundToolButton"> + <item row="8" column="0"> + <widget class="QLabel" name="foregroundSaturationLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip"> - <string>Erase background.</string> - </property> <property name="text"> - <string>x</string> - </property> - <property name="arrowType"> - <enum>Qt::LeftArrow</enum> + <string>Saturation:</string> </property> </widget> </item> - <item row="14" column="0" colspan="3"> - <widget class="QWidget" name="relativeBackgroundSpacer2" native="true"> + <item row="19" column="0" colspan="3"> + <widget class="QWidget" name="fontSpacer1" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -218,85 +215,71 @@ </property> </widget> </item> - <item row="7" column="1" colspan="2"> - <widget class="QDoubleSpinBox" name="foregroundSaturationSpinBox"> - <property name="minimum"> - <double>-1.000000000000000</double> - </property> - <property name="maximum"> - <double>1.000000000000000</double> - </property> - <property name="singleStep"> - <double>0.050000000000000</double> - </property> - </widget> - </item> - <item row="15" column="0"> - <widget class="QLabel" name="backgroundLightnessLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Lightness:</string> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QToolButton" name="eraseForegroundToolButton"> + <item row="23" column="0" colspan="3"> + <widget class="QWidget" name="underlineSpacer1" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip"> - <string>Erase foreground.</string> - </property> - <property name="text"> - <string>x</string> + <property name="minimumSize"> + <size> + <width>0</width> + <height>6</height> + </size> </property> - <property name="arrowType"> - <enum>Qt::LeftArrow</enum> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>6</height> + </size> </property> </widget> </item> - <item row="13" column="0"> - <widget class="QLabel" name="backgroundSaturationLabel"> + <item row="1" column="0"> + <widget class="QLabel" name="foregroundLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> - <string>Saturation:</string> + <string>Foreground:</string> + </property> + <property name="buddy"> + <cstring>foregroundToolButton</cstring> </property> </widget> </item> - <item row="19" column="1" colspan="2"> - <widget class="QCheckBox" name="italicCheckBox"> + <item row="22" column="0"> + <widget class="QLabel" name="underlineHeadline"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> <property name="text"> - <string>Italic</string> + <string>Underline</string> </property> </widget> </item> - <item row="9" column="1" colspan="2"> - <widget class="QDoubleSpinBox" name="foregroundLightnessSpinBox"> - <property name="minimum"> - <double>-1.000000000000000</double> - </property> - <property name="maximum"> - <double>1.000000000000000</double> + <item row="6" column="0" colspan="3"> + <widget class="QLabel" name="relativeForegroundHeadline"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> </property> - <property name="singleStep"> - <double>0.050000000000000</double> + <property name="text"> + <string>Relative Foreground</string> </property> </widget> </item> - <item row="6" column="0" colspan="3"> + <item row="7" column="0" colspan="3"> <widget class="QWidget" name="relativeForegroundSpacer1" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> @@ -318,8 +301,8 @@ </property> </widget> </item> - <item row="13" column="1" colspan="2"> - <widget class="QDoubleSpinBox" name="backgroundSaturationSpinBox"> + <item row="16" column="1" colspan="2"> + <widget class="QDoubleSpinBox" name="backgroundLightnessSpinBox"> <property name="minimum"> <double>-1.000000000000000</double> </property> @@ -331,24 +314,27 @@ </property> </widget> </item> - <item row="3" column="0"> - <widget class="QLabel" name="backgroundLabel"> + <item row="4" column="2"> + <widget class="QToolButton" name="eraseBackgroundToolButton"> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="toolTip"> + <string>Erase background.</string> + </property> <property name="text"> - <string>Background:</string> + <string>x</string> </property> - <property name="buddy"> - <cstring>backgroundToolButton</cstring> + <property name="arrowType"> + <enum>Qt::LeftArrow</enum> </property> </widget> </item> - <item row="4" column="0" colspan="3"> - <widget class="QWidget" name="backgroundSpacer" native="true"> + <item row="13" column="0" colspan="3"> + <widget class="QWidget" name="relativeBackgroundSpacer1" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -358,32 +344,32 @@ <property name="minimumSize"> <size> <width>0</width> - <height>18</height> + <height>6</height> </size> </property> <property name="maximumSize"> <size> <width>16777215</width> - <height>18</height> + <height>6</height> </size> </property> </widget> </item> - <item row="17" column="0"> - <widget class="QLabel" name="fontHeadline"> - <property name="font"> - <font> - <weight>75</weight> - <bold>true</bold> - </font> + <item row="4" column="1"> + <widget class="QToolButton" name="backgroundToolButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> <property name="text"> - <string>Font</string> + <string/> </property> </widget> </item> - <item row="7" column="0"> - <widget class="QLabel" name="foregroundSaturationLabel"> + <item row="16" column="0"> + <widget class="QLabel" name="backgroundLightnessLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> @@ -391,85 +377,105 @@ </sizepolicy> </property> <property name="text"> - <string>Saturation:</string> + <string>Lightness:</string> </property> </widget> </item> - <item row="19" column="0"> - <widget class="QCheckBox" name="boldCheckBox"> + <item row="12" column="0" colspan="3"> + <widget class="QLabel" name="relativeBackgroundHeadline"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> <property name="text"> - <string>Bold</string> + <string>Relative Background</string> </property> </widget> </item> - <item row="18" column="0" colspan="3"> - <widget class="QWidget" name="fontSpacer1" native="true"> + <item row="18" column="0"> + <widget class="QLabel" name="fontHeadline"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Font</string> + </property> + </widget> + </item> + <item row="14" column="0"> + <widget class="QLabel" name="backgroundSaturationLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>6</height> - </size> + <property name="text"> + <string>Saturation:</string> </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>6</height> - </size> + </widget> + </item> + <item row="14" column="1" colspan="2"> + <widget class="QDoubleSpinBox" name="backgroundSaturationSpinBox"> + <property name="minimum"> + <double>-1.000000000000000</double> + </property> + <property name="maximum"> + <double>1.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.050000000000000</double> </property> </widget> </item> - <item row="12" column="0" colspan="3"> - <widget class="QWidget" name="relativeBackgroundSpacer1" native="true"> + <item row="24" column="2"> + <widget class="QToolButton" name="eraseUnderlineColorToolButton"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>6</height> - </size> + <property name="toolTip"> + <string>Erase background.</string> </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>6</height> - </size> + <property name="text"> + <string>x</string> + </property> + <property name="arrowType"> + <enum>Qt::LeftArrow</enum> </property> </widget> </item> - <item row="16" column="0" colspan="3"> - <widget class="QWidget" name="relativeBackgroundSpacer3" native="true"> + <item row="26" column="0" colspan="3"> + <widget class="QComboBox" name="underlineComboBox"/> + </item> + <item row="1" column="2"> + <widget class="QToolButton" name="eraseForegroundToolButton"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>18</height> - </size> + <property name="toolTip"> + <string>Erase foreground.</string> </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>18</height> - </size> + <property name="text"> + <string>x</string> + </property> + <property name="arrowType"> + <enum>Qt::LeftArrow</enum> </property> </widget> </item> - <item row="24" column="0" colspan="3"> - <widget class="QWidget" name="underlineSpacer2" native="true"> + <item row="15" column="0" colspan="3"> + <widget class="QWidget" name="relativeBackgroundSpacer2" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -490,8 +496,15 @@ </property> </widget> </item> - <item row="22" column="0" colspan="3"> - <widget class="QWidget" name="underlineSpacer1" native="true"> + <item row="20" column="0"> + <widget class="QCheckBox" name="boldCheckBox"> + <property name="text"> + <string>Bold</string> + </property> + </widget> + </item> + <item row="17" column="0" colspan="3"> + <widget class="QWidget" name="relativeBackgroundSpacer3" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -501,18 +514,18 @@ <property name="minimumSize"> <size> <width>0</width> - <height>6</height> + <height>18</height> </size> </property> <property name="maximumSize"> <size> <width>16777215</width> - <height>6</height> + <height>18</height> </size> </property> </widget> </item> - <item row="23" column="1"> + <item row="24" column="1"> <widget class="QToolButton" name="underlineColorToolButton"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> @@ -525,49 +538,29 @@ </property> </widget> </item> - <item row="21" column="0"> - <widget class="QLabel" name="underlineHeadline"> - <property name="font"> - <font> - <weight>75</weight> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>Underline</string> - </property> - </widget> - </item> - <item row="23" column="0"> - <widget class="QLabel" name="underlineLabel"> + <item row="25" column="0" colspan="3"> + <widget class="QWidget" name="underlineSpacer2" native="true"> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> - <string>Color:</string> - </property> - <property name="buddy"> - <cstring>backgroundToolButton</cstring> - </property> - </widget> - </item> - <item row="11" column="0" colspan="3"> - <widget class="QLabel" name="relativeBackgroundHeadline"> - <property name="font"> - <font> - <weight>75</weight> - <bold>true</bold> - </font> + <property name="minimumSize"> + <size> + <width>0</width> + <height>6</height> + </size> </property> - <property name="text"> - <string>Relative Background</string> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>6</height> + </size> </property> </widget> </item> - <item row="20" column="0" colspan="3"> + <item row="21" column="0" colspan="3"> <widget class="QWidget" name="fontSpacer2" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> @@ -589,8 +582,8 @@ </property> </widget> </item> - <item row="15" column="1" colspan="2"> - <widget class="QDoubleSpinBox" name="backgroundLightnessSpinBox"> + <item row="10" column="1" colspan="2"> + <widget class="QDoubleSpinBox" name="foregroundLightnessSpinBox"> <property name="minimum"> <double>-1.000000000000000</double> </property> @@ -602,65 +595,82 @@ </property> </widget> </item> - <item row="3" column="1"> - <widget class="QToolButton" name="backgroundToolButton"> + <item row="8" column="1" colspan="2"> + <widget class="QDoubleSpinBox" name="foregroundSaturationSpinBox"> + <property name="minimum"> + <double>-1.000000000000000</double> + </property> + <property name="maximum"> + <double>1.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.050000000000000</double> + </property> + </widget> + </item> + <item row="9" column="0" colspan="3"> + <widget class="QWidget" name="relativeForegroundSpacer2" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> - <string/> + <property name="minimumSize"> + <size> + <width>0</width> + <height>6</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>6</height> + </size> </property> </widget> </item> - <item row="23" column="2"> - <widget class="QToolButton" name="eraseUnderlineColorToolButton"> + <item row="24" column="0"> + <widget class="QLabel" name="underlineLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip"> - <string>Erase background.</string> - </property> <property name="text"> - <string>x</string> + <string>Color:</string> </property> - <property name="arrowType"> - <enum>Qt::LeftArrow</enum> + <property name="buddy"> + <cstring>backgroundToolButton</cstring> </property> </widget> </item> - <item row="25" column="0" colspan="3"> - <widget class="QComboBox" name="underlineComboBox"/> - </item> - <item row="8" column="0" colspan="3"> - <widget class="QWidget" name="relativeForegroundSpacer2" native="true"> + <item row="4" column="0"> + <widget class="QLabel" name="backgroundLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>6</height> - </size> + <property name="text"> + <string>Background:</string> </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>6</height> - </size> + <property name="buddy"> + <cstring>backgroundToolButton</cstring> </property> </widget> </item> - <item row="2" column="0" colspan="3"> - <widget class="QWidget" name="foregroundSpacer" native="true"> + <item row="20" column="1" colspan="2"> + <widget class="QCheckBox" name="italicCheckBox"> + <property name="text"> + <string>Italic</string> + </property> + </widget> + </item> + <item row="5" column="0" colspan="3"> + <widget class="QWidget" name="backgroundSpacer" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -670,13 +680,13 @@ <property name="minimumSize"> <size> <width>0</width> - <height>6</height> + <height>18</height> </size> </property> <property name="maximumSize"> <size> <width>16777215</width> - <height>6</height> + <height>18</height> </size> </property> </widget> diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index 1a6235789e2..36ee3ac6c6d 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -377,6 +377,8 @@ QWidget *FontSettingsPage::widget() this, &FontSettingsPage::colorSchemeSelected); connect(d_ptr->m_ui->copyButton, &QPushButton::clicked, this, &FontSettingsPage::openCopyColorSchemeDialog); + connect(d_ptr->m_ui->schemeEdit, &ColorSchemeEdit::copyScheme, + this, &FontSettingsPage::openCopyColorSchemeDialog); connect(d_ptr->m_ui->deleteButton, &QPushButton::clicked, this, &FontSettingsPage::confirmDeleteColorScheme); |