[kwin] /: [KCMs] move GHNS buttons to the normal location

Nate Graham null at kde.org
Wed Oct 31 13:30:09 GMT 2018


Git commit 9a59e3fb6cf4c2b272d724520bbfd3ed1a0e5c89 by Nate Graham.
Committed on 31/10/2018 at 13:29.
Pushed by ngraham into branch 'master'.

[KCMs] move GHNS buttons to the normal location

Summary:
All other KCMs have their {nav Get New [things]...} buttons in the bottom-right corner. This patch adjusts KWin's KCMs to adopt the same convention there too.

With this patch, all KCMs will have their GHNS buttons in the same location.

Closes T9954

Test Plan:
{F6375278}

{F6375277}

{F6375276}

{F6375275}

Reviewers: #kwin, #vdg, zzag

Reviewed By: #kwin, zzag

Subscribers: Codezela, kwin, kde-doc-english

Tags: #kwin, #documentation

Maniphest Tasks: T9954

Differential Revision: https://phabricator.kde.org/D16537

M  +1    -1    doc/kwindecoration/index.docbook
M  +13   -7    kcmkwin/kwincompositing/qml/EffectView.qml
M  +23   -23   kcmkwin/kwindecoration/kcm.ui
M  +46   -45   kcmkwin/kwinscripts/module.ui
M  +14   -3    kcmkwin/kwintabbox/main.cpp
M  +0    -20   kcmkwin/kwintabbox/main.ui

https://commits.kde.org/kwin/9a59e3fb6cf4c2b272d724520bbfd3ed1a0e5c89

diff --git a/doc/kwindecoration/index.docbook b/doc/kwindecoration/index.docbook
index 0f2992be2..1a7dc9b66 100644
--- a/doc/kwindecoration/index.docbook
+++ b/doc/kwindecoration/index.docbook
@@ -51,7 +51,7 @@ windows.</para>
 
 <para>Choose a window decoration style from the preview list, using the 
 search field at the top of the screen or download a new style using the 
-<guibutton>Get New Decorations</guibutton> button.</para>
+<guibutton>Get New Window Decorations</guibutton> button.</para>
 
 <para>The default window decoration is called <quote>Breeze</quote>.</para>
 
diff --git a/kcmkwin/kwincompositing/qml/EffectView.qml b/kcmkwin/kwincompositing/qml/EffectView.qml
index fe1f91763..e92a8f3a3 100644
--- a/kcmkwin/kwincompositing/qml/EffectView.qml
+++ b/kcmkwin/kwincompositing/qml/EffectView.qml
@@ -99,13 +99,6 @@ Rectangle {
                     }
                 }
             }
-
-            Button {
-                id: ghnsButton
-                text: i18n("Get New Effects...")
-                iconName: "get-hot-new-stuff"
-                onClicked: effectConfig.openGHNS()
-            }
         }
 
         EffectFilterModel {
@@ -169,6 +162,19 @@ Rectangle {
             }
         }
 
+        RowLayout {
+            Layout.fillWidth: true
+
+            Item {
+                Layout.fillWidth: true
+            }
+            Button {
+                id: ghnsButton
+                text: i18n("Get New Desktop Effects...")
+                iconName: "get-hot-new-stuff"
+                onClicked: effectConfig.openGHNS()
+            }
+        }
     }//End ColumnLayout
     Connections {
         target: searchModel
diff --git a/kcmkwin/kwindecoration/kcm.ui b/kcmkwin/kwindecoration/kcm.ui
index ff2983186..9e8e53234 100644
--- a/kcmkwin/kwindecoration/kcm.ui
+++ b/kcmkwin/kwindecoration/kcm.ui
@@ -33,16 +33,6 @@
            </property>
           </widget>
          </item>
-         <item>
-          <widget class="QPushButton" name="knsButton">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>Get New Decorations...</string>
-           </property>
-          </widget>
-         </item>
         </layout>
        </item>
        <item>
@@ -76,19 +66,6 @@
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_2">
-         <item>
-          <spacer name="borderSizesSpacer">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
          <item>
           <widget class="QLabel" name="borderSizesLabel">
            <property name="text">
@@ -151,6 +128,29 @@
            </item>
           </widget>
          </item>
+         <item>
+          <spacer name="borderSizesSpacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="knsButton">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>Get New Window Decorations...</string>
+           </property>
+          </widget>
+         </item>
         </layout>
        </item>
       </layout>
diff --git a/kcmkwin/kwinscripts/module.ui b/kcmkwin/kwinscripts/module.ui
index 60ef9a84d..6a4215ba8 100644
--- a/kcmkwin/kwinscripts/module.ui
+++ b/kcmkwin/kwinscripts/module.ui
@@ -13,59 +13,60 @@
   <property name="windowTitle">
    <string>KWin script configuration</string>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout_2">
+  <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="KMessageWidget" name="messageWidget" native="true"/>
    </item>
+   <item>
+    <widget class="KPluginSelector" name="scriptSelector" native="true">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="focusPolicy">
+      <enum>Qt::WheelFocus</enum>
+     </property>
+    </widget>
+   </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout">
      <item>
-      <layout class="QVBoxLayout" name="verticalLayout2">
-       <item>
-        <widget class="KPluginSelector" name="scriptSelector" native="true">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="focusPolicy">
-          <enum>Qt::WheelFocus</enum>
-         </property>
-        </widget>
-       </item>
-      </layout>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+        </sizepolicy>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>80</width>
+         <height>40</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="importScriptButton">
+       <property name="text">
+        <string>Install from File...</string>
+       </property>
+       <property name="icon">
+        <iconset theme="document-import">
+         <normaloff/>
+        </iconset>
+       </property>
+      </widget>
      </item>
      <item>
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <widget class="QPushButton" name="importScriptButton">
-         <property name="text">
-          <string>Import KWin script...</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="KNS3::Button" name="ghnsButton">
-         <property name="text">
-          <string>Get New Scripts...</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="verticalSpacer">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>40</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
+      <widget class="KNS3::Button" name="ghnsButton">
+       <property name="text">
+        <string>Get New Scripts...</string>
+       </property>
+      </widget>
      </item>
     </layout>
    </item>
diff --git a/kcmkwin/kwintabbox/main.cpp b/kcmkwin/kwintabbox/main.cpp
index 0017911b3..f1827ee7c 100644
--- a/kcmkwin/kwintabbox/main.cpp
+++ b/kcmkwin/kwintabbox/main.cpp
@@ -24,8 +24,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 // Qt
 #include <QtDBus>
 #include <QDesktopWidget>
-#include <QVBoxLayout>
 #include <QDialogButtonBox>
+#include <QHBoxLayout>
+#include <QPushButton>
+#include <QVBoxLayout>
+#include <QSpacerItem>
 #include <QStandardPaths>
 #include <QPointer>
 
@@ -72,6 +75,15 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
     m_alternativeTabBoxUi = new KWinTabBoxConfigForm(tabWidget);
     tabWidget->addTab(m_primaryTabBoxUi, i18n("Main"));
     tabWidget->addTab(m_alternativeTabBoxUi, i18n("Alternative"));
+
+    QPushButton* ghnsButton = new QPushButton(QIcon::fromTheme(QStringLiteral("get-hot-new-stuff")), i18n("Get New Task Switchers..."));
+    connect(ghnsButton, SIGNAL(clicked(bool)), SLOT(slotGHNS()));
+
+    QHBoxLayout* buttonBar = new QHBoxLayout();
+    QSpacerItem* buttonBarSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+    buttonBar->addItem(buttonBarSpacer);
+    buttonBar->addWidget(ghnsButton);
+
     QVBoxLayout* layout = new QVBoxLayout(this);
     KTitleWidget* infoLabel = new KTitleWidget(tabWidget);
     infoLabel->setText(i18n("Focus policy settings limit the functionality of navigating through windows."),
@@ -79,6 +91,7 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
     infoLabel->setPixmap(KTitleWidget::InfoMessage, KTitleWidget::ImageLeft);
     layout->addWidget(infoLabel,0);
     layout->addWidget(tabWidget,1);
+    layout->addLayout(buttonBar);
     setLayout(layout);
 
 #define ADD_SHORTCUT(_NAME_, _CUT_, _BTN_) \
@@ -113,7 +126,6 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
     KWinTabBoxConfigForm *ui[2] = { m_primaryTabBoxUi, m_alternativeTabBoxUi };
     for (int i = 0; i < 2; ++i) {
         ui[i]->effectConfigButton->setIcon(QIcon::fromTheme(QStringLiteral("view-preview")));
-        ui[i]->ghns->setIcon(QIcon::fromTheme(QStringLiteral("get-hot-new-stuff")));
 
         connect(ui[i]->highlightWindowCheck, SIGNAL(clicked(bool)), SLOT(changed()));
         connect(ui[i]->showTabBox, SIGNAL(clicked(bool)), SLOT(tabBoxToggled(bool)));
@@ -145,7 +157,6 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
         connect(ui[i]->filterMinimization, SIGNAL(clicked(bool)), SLOT(changed()));
         connect(ui[i]->visibleWindows, SIGNAL(clicked(bool)), SLOT(changed()));
         connect(ui[i]->hiddenWindows, SIGNAL(clicked(bool)), SLOT(changed()));
-        connect(ui[i]->ghns, SIGNAL(clicked(bool)), SLOT(slotGHNS()));
     }
 
     // check focus policy - we don't offer configs for unreasonable focus policies
diff --git a/kcmkwin/kwintabbox/main.ui b/kcmkwin/kwintabbox/main.ui
index 9baa26d80..e7fa24ccb 100644
--- a/kcmkwin/kwintabbox/main.ui
+++ b/kcmkwin/kwintabbox/main.ui
@@ -553,26 +553,6 @@
           </property>
          </widget>
         </item>
-        <item row="1" column="2">
-         <spacer name="horizontalSpacer_5">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item row="1" column="3">
-         <widget class="QPushButton" name="ghns">
-          <property name="toolTip">
-           <string>Get New Window Switcher Layout</string>
-          </property>
-         </widget>
-        </item>
        </layout>
       </widget>
      </item>


More information about the kde-doc-english mailing list