summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2017-02-11 11:56:00 +0100
committerElvis Angelaccio <[email protected]>2017-02-23 16:37:08 +0100
commit57403a78afa20d4bf910dbd6fc52c2e8d0741a13 (patch)
tree69eb417ea396adc854c3c88151d72aea5693c8c9
parent90718b01476510ae9e4f328342409100fa05acb8 (diff)
Replace warps-slider checkbox with radio buttons
Summary: This was suggested by Thomas in https://git.reviewboard.kde.org/r/128475/ but it probably got lost. The "Left mouse warps scroll bar" checkbox is very hard to understand, so we replace it with a buttongroup with two radio buttons that explain what actually happens in either case. Reviewers: broulik, colomar Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D4563
-rw-r--r--src/gtkconfigkcmodule.cpp12
-rw-r--r--src/ui/gui.ui383
2 files changed, 208 insertions, 187 deletions
diff --git a/src/gtkconfigkcmodule.cpp b/src/gtkconfigkcmodule.cpp
index d36c6a3..bb2d994 100644
--- a/src/gtkconfigkcmodule.cpp
+++ b/src/gtkconfigkcmodule.cpp
@@ -114,7 +114,7 @@ GTKConfigKCModule::GTKConfigKCModule(QWidget* parent, const QVariantList& args )
connect(ui->cb_toolbar_icons, SIGNAL(currentIndexChanged(int)), this, SLOT(appChanged()));
connect(ui->checkBox_icon_gtk_menus, SIGNAL(clicked(bool)), this, SLOT(appChanged()));
connect(ui->checkBox_icon_gtk_buttons, SIGNAL(clicked(bool)), this, SLOT(appChanged()));
- connect(ui->checkBox_primary_button_warps_slider, SIGNAL(clicked(bool)), this, SLOT(appChanged()));
+ connect(ui->buttonGroup_primary_button_warps_slider, SIGNAL(buttonToggled(QAbstractButton*, bool)), this, SLOT(appChanged()));
//preview updates
connect(ui->cb_icon_fallback, SIGNAL(activated(QString)), this, SLOT(makePreviewIconTheme()));
@@ -157,7 +157,7 @@ void GTKConfigKCModule::syncUI()
appareance->setToolbarStyle(gtkToolbar.key(ui->cb_toolbar_icons->currentIndex()));
appareance->setShowIconsInButtons(ui->checkBox_icon_gtk_buttons->isChecked());
appareance->setShowIconsInMenus(ui->checkBox_icon_gtk_menus->isChecked());
- appareance->setPrimaryButtonWarpsSlider(ui->checkBox_primary_button_warps_slider->isChecked());
+ appareance->setPrimaryButtonWarpsSlider(ui->buttonGroup_primary_button_warps_slider->checkedButton() == ui->radioButton_warp);
}
void GTKConfigKCModule::showThemeGHNS()
@@ -188,8 +188,10 @@ void GTKConfigKCModule::refreshLists()
ui->checkBox_icon_gtk_buttons->setChecked(appareance->getShowIconsInButtons());
ui->checkBox_icon_gtk_menus->setChecked(appareance->getShowIconsInMenus());
- ui->checkBox_primary_button_warps_slider->setChecked(appareance->getPrimaryButtonWarpsSlider());
-
+ const bool warps = appareance->getPrimaryButtonWarpsSlider();
+ ui->radioButton_warp->setChecked(warps);
+ ui->radioButton_dont_warp->setChecked(!warps);
+
makePreviewIconTheme();
}
@@ -352,7 +354,7 @@ void GTKConfigKCModule::defaults()
ui->checkBox_icon_gtk_menus->setChecked(showIcons);
// this makes it consistent with Qt apps and restores the old Gtk behavior
- ui->checkBox_primary_button_warps_slider->setChecked(false);
+ ui->radioButton_dont_warp->setChecked(true);
setComboItem(ui->cb_theme, QStringList("oxygen-gtk") << "Clearlooks");
setComboItem(ui->cb_theme_gtk3, QStringList("oxygen-gtk") << "Adwaita");
diff --git a/src/ui/gui.ui b/src/ui/gui.ui
index 326ee99..667ebbd 100644
--- a/src/ui/gui.ui
+++ b/src/ui/gui.ui
@@ -6,181 +6,25 @@
<rect>
<x>0</x>
<y>0</y>
- <width>858</width>
+ <width>931</width>
<height>564</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QGroupBox" name="groupBox_2">
- <property name="title">
- <string>GTK Themes</string>
+ <item row="2" column="2">
+ <widget class="QToolButton" name="newThemes">
+ <property name="toolTip">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Here you can find more GTK themes to try. You can either download them from the following websites.&lt;/p&gt;&lt;p&gt;Also you can download it from the opendesktop facilities as suggested below&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;http://gnome-look.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;gnome-look.org&lt;/span&gt;&lt;/a&gt;&lt;br/&gt;&lt;a href=&quot;art.gnome.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;art.gnome.org&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
- <layout class="QFormLayout" name="formLayout_3">
- <item row="0" column="0">
- <widget class="QLabel" name="label_9">
- <property name="text">
- <string>Select a GTK2 Theme:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QComboBox" name="cb_theme">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="gtk2Preview">
- <property name="toolTip">
- <string>Preview theme</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_21">
- <property name="text">
- <string>Select a GTK3 Theme:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <item>
- <widget class="QComboBox" name="cb_theme_gtk3">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="gtk3Preview">
- <property name="toolTip">
- <string>Preview theme</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Font:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="KFontRequester" name="font" native="true"/>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="1" colspan="2">
- <widget class="QGroupBox" name="groupBox_3">
- <property name="title">
- <string>Behaviour</string>
+ <property name="text">
+ <string>Get New Themes</string>
+ </property>
+ <property name="popupMode">
+ <enum>QToolButton::InstantPopup</enum>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
- <layout class="QFormLayout" name="formLayout">
- <property name="fieldGrowthPolicy">
- <enum>QFormLayout::ExpandingFieldsGrow</enum>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>GTK style toolbar:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="cb_toolbar_icons">
- <item>
- <property name="text">
- <string>Icons Only</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Text Only</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Text Under Icons</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Text After Icons</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_22">
- <property name="text">
- <string>Show icons in GTK buttons:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="checkBox_icon_gtk_buttons">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_23">
- <property name="text">
- <string>Show icons in GTK menus:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QCheckBox" name="checkBox_icon_gtk_menus">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>Left mouse button warps scroll bar:</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QCheckBox" name="checkBox_primary_button_warps_slider">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
</widget>
</item>
<item row="1" column="0" colspan="3">
@@ -471,6 +315,93 @@
</layout>
</widget>
</item>
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>GTK Themes</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_3">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_9">
+ <property name="text">
+ <string>Select a GTK2 Theme:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QComboBox" name="cb_theme">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="gtk2Preview">
+ <property name="toolTip">
+ <string>Preview theme</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_21">
+ <property name="text">
+ <string>Select a GTK3 Theme:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QComboBox" name="cb_theme_gtk3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="gtk3Preview">
+ <property name="toolTip">
+ <string>Preview theme</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Font:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="KFontRequester" name="font"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item row="2" column="0" colspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
@@ -484,20 +415,105 @@
</property>
</spacer>
</item>
- <item row="2" column="2">
- <widget class="QToolButton" name="newThemes">
- <property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Here you can find more GTK themes to try. You can either download them from the following websites.&lt;/p&gt;&lt;p&gt;Also you can download it from the opendesktop facilities as suggested below&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;http://gnome-look.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;gnome-look.org&lt;/span&gt;&lt;/a&gt;&lt;br/&gt;&lt;a href=&quot;art.gnome.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;art.gnome.org&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- <property name="text">
- <string>Get New Themes</string>
- </property>
- <property name="popupMode">
- <enum>QToolButton::InstantPopup</enum>
- </property>
- <property name="toolButtonStyle">
- <enum>Qt::ToolButtonTextBesideIcon</enum>
+ <item row="0" column="1" colspan="2">
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>Behaviour</string>
</property>
+ <layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>GTK style toolbar:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QComboBox" name="cb_toolbar_icons">
+ <item>
+ <property name="text">
+ <string>Icons Only</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Text Only</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Text Under Icons</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Text After Icons</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_22">
+ <property name="text">
+ <string>Show icons in GTK buttons:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="checkBox_icon_gtk_buttons">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_23">
+ <property name="text">
+ <string>Show icons in GTK menus:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="checkBox_icon_gtk_menus">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>On left-clicking the scroll bar:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QRadioButton" name="radioButton_dont_warp">
+ <property name="text">
+ <string>Scro&amp;ll one page up/down</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">buttonGroup_primary_button_warps_slider</string>
+ </attribute>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QRadioButton" name="radioButton_warp">
+ <property name="text">
+ <string>&amp;Jump to the mouse cursor position</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">buttonGroup_primary_button_warps_slider</string>
+ </attribute>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
</layout>
@@ -511,4 +527,7 @@
</customwidgets>
<resources/>
<connections/>
+ <buttongroups>
+ <buttongroup name="buttonGroup_primary_button_warps_slider"/>
+ </buttongroups>
</ui>