Skip to content
Permalink
Browse files

Disable radio buttons in color dialog if not using first tab

  • Loading branch information
nyalldawson committed Sep 30, 2014
1 parent b044d4d commit 6f4a28f5ffbf5463d69cc35d5198ef1ec8a07abb
Showing with 61 additions and 6 deletions.
  1. +12 −0 src/gui/qgscolordialog.cpp
  2. +1 −0 src/gui/qgscolordialog.h
  3. +48 −6 src/ui/qgscolordialog.ui
@@ -687,6 +687,18 @@ void QgsColorDialogV2::on_mSampleButton_clicked()
setMouseTracking( true );
}

void QgsColorDialogV2::on_mTabWidget_currentChanged( int index )
{
//disable radio buttons if not using the first tab, as they have no meaning for other tabs
bool enabled = index == 0;
mRedRadio->setEnabled( enabled );
mBlueRadio->setEnabled( enabled );
mGreenRadio->setEnabled( enabled );
mHueRadio->setEnabled( enabled );
mSaturationRadio->setEnabled( enabled );
mValueRadio->setEnabled( enabled );
}

void QgsColorDialogV2::saveSettings()
{
//save changes to scheme
@@ -170,6 +170,7 @@ class GUI_EXPORT QgsColorDialogV2 : public QDialog, private Ui::QgsColorDialogBa
void on_mAddCustomColorButton_clicked();

void on_mSampleButton_clicked();
void on_mTabWidget_currentChanged( int index );

private:

@@ -25,9 +25,16 @@
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,0,1">
<item>
<widget class="QRadioButton" name="mHueRadio">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>H</string>
</property>
@@ -39,9 +46,16 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<layout class="QHBoxLayout" name="horizontalLayout_5" stretch="0,0,1">
<item>
<widget class="QRadioButton" name="mSaturationRadio">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>S</string>
</property>
@@ -53,9 +67,16 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<layout class="QHBoxLayout" name="horizontalLayout_6" stretch="0,0,1">
<item>
<widget class="QRadioButton" name="mValueRadio">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>V</string>
</property>
@@ -67,9 +88,16 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,1">
<item>
<widget class="QRadioButton" name="mRedRadio">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>R</string>
</property>
@@ -81,9 +109,16 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,1">
<item>
<widget class="QRadioButton" name="mGreenRadio">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>G</string>
</property>
@@ -95,9 +130,16 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0,0,1">
<item>
<widget class="QRadioButton" name="mBlueRadio">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>B</string>
</property>

0 comments on commit 6f4a28f

Please sign in to comment.
You can’t perform that action at this time.