Branch: master

8a8b8ce4 2014-06-04 06:37:39 Michele Calgaro
Moved position and improved appearance of "Change TDE menu icon" button
in Configure Panel -> Menus. This resolves bug 1706.
M kcontrol/kicker/menutab.ui
M kcontrol/kicker/menutab_impl.cpp
diff --git a/kcontrol/kicker/menutab.ui b/kcontrol/kicker/menutab.ui
index 78a9711..aa488c1 100644
--- a/kcontrol/kicker/menutab.ui
+++ b/kcontrol/kicker/menutab.ui
@@ -163,7 +163,7 @@
 							</widget>
 						</grid>
 					</widget>
-					<widget class="TQPushButton" colspan="4">
+					<widget class="TQPushButton">
 						<property name="name">
 							<cstring>m_editKMenuButton</cstring>
 						</property>
@@ -174,7 +174,21 @@
 							<string>Start the editor for the TDE Menu. Here you can add, edit, remove and hide applications.</string>
 						</property>
 					</widget>
-					<spacer>
+          <widget class="KPushButton">
+            <property name="name">
+              <cstring>btnCustomKMenuIcon</cstring>
+            </property>
+            <property name="text">
+              <string>Change menu icon</string>
+            </property>
+            <property name="whatsThis" stdset="0">
+              <string>Allows you to choose a different icon for the TDE menu.</string>
+            </property>
+            <property name="acceptDrops">
+              <bool>false</bool>
+            </property>
+          </widget>
+          <spacer>
 						<property name="name">
 							<cstring>Spacer10</cstring>
 						</property>
@@ -293,6 +307,22 @@
 						<property name="margin">
 							<number>0</number>
 						</property>
+            <widget class="TQLabel" row="0" column="0">
+              <property name="name">
+                <cstring>TextLabel1_3_3_2</cstring>
+              </property>
+              <property name="sizePolicy">
+                <sizepolicy>
+                  <hsizetype>4</hsizetype>
+                  <vsizetype>1</vsizetype>
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                </sizepolicy>
+              </property>
+              <property name="text">
+                <string>Text:</string>
+              </property>
+            </widget>
 						<widget class="TQLineEdit" row="0" column="1" colspan="3">
 							<property name="name">
 								<cstring>kcfg_KMenuText</cstring>
@@ -301,70 +331,7 @@
 								<number>35</number>
 							</property>
 						</widget>
-						<widget class="TQLabel" row="3" column="0" colspan="2">
-							<property name="name">
-								<cstring>TextLabel1_3_3_2</cstring>
-							</property>
-							<property name="sizePolicy">
-								<sizepolicy>
-									<hsizetype>4</hsizetype>
-									<vsizetype>1</vsizetype>
-									<horstretch>0</horstretch>
-									<verstretch>0</verstretch>
-								</sizepolicy>
-							</property>
-							<property name="text">
-								<string>Change TDE Menu icon:</string>
-							</property>
-						</widget>
-						<widget class="KPushButton" row="3" column="3" colspan="1">
-							<property name="name">
-								<cstring>btnCustomKMenuIcon</cstring>
-							</property>
-							<property name="sizePolicy">
-								<sizepolicy>
-									<hsizetype>0</hsizetype>
-									<vsizetype>0</vsizetype>
-									<horstretch>0</horstretch>
-									<verstretch>0</verstretch>
-								</sizepolicy>
-							</property>
-							<property name="minimumSize">
-								<size>
-									<width>26</width>
-									<height>26</height>
-								</size>
-							</property>
-							<property name="maximumSize">
-								<size>
-									<width>26</width>
-									<height>26</height>
-								</size>
-							</property>
-							<property name="acceptDrops">
-								<bool>false</bool>
-							</property>
-							<property name="text">
-								<string></string>
-							</property>
-						</widget>
-						<widget class="TQLabel" row="0" column="0">
-							<property name="name">
-								<cstring>TextLabel1_3_3_2</cstring>
-							</property>
-							<property name="sizePolicy">
-								<sizepolicy>
-									<hsizetype>4</hsizetype>
-									<vsizetype>1</vsizetype>
-									<horstretch>0</horstretch>
-									<verstretch>0</verstretch>
-								</sizepolicy>
-							</property>
-							<property name="text">
-								<string>Text:</string>
-							</property>
-						</widget>
-						<widget class="TQLabel" row="2" column="0">
+						<widget class="TQLabel" row="1" column="0">
 							<property name="name">
 								<cstring>TextLabel1_3_3_2</cstring>
 							</property>
@@ -380,12 +347,12 @@
 								<string>Font:</string>
 							</property>
 						</widget>
-						<widget class="TDEFontRequester" row="2" column="1" rowspan="1" colspan="3">
+						<widget class="TDEFontRequester" row="1" column="1" colspan="3">
 							<property name="name">
 								<cstring>kcfg_ButtonFont</cstring>
 							</property>
 						</widget>
-						<spacer row="4" column="3">
+						<spacer row="2" column="3">
 							<property name="name">
 								<cstring>spacer6</cstring>
 							</property>
diff --git a/kcontrol/kicker/menutab_impl.cpp b/kcontrol/kicker/menutab_impl.cpp
index 571365a..6be59c4 100644
--- a/kcontrol/kicker/menutab_impl.cpp
+++ b/kcontrol/kicker/menutab_impl.cpp
@@ -85,13 +85,12 @@
     connect(maxrecentdocs, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(kmenuChanged()));
 
     TDEIconLoader * ldr = TDEGlobal::iconLoader();
-    TQPixmap kmenu_icon;
     m_kmenu_icon = KickerSettings::customKMenuIcon();
     if (m_kmenu_icon.isNull() == true) {
         m_kmenu_icon = TQString("kmenu");
     }
-    kmenu_icon = ldr->loadIcon(m_kmenu_icon, TDEIcon::Small, TDEIcon::SizeSmall);
-    btnCustomKMenuIcon->setPixmap(kmenu_icon);
+    TQIconSet kmenu_icon = ldr->loadIconSet(m_kmenu_icon, TDEIcon::Small, TDEIcon::SizeSmall);
+    btnCustomKMenuIcon->setIconSet(kmenu_icon);
 
     TDEConfig *config;
     config = new TDEConfig(TQString::fromLatin1("kdeglobals"), false, false);
@@ -323,10 +322,9 @@
         return;
 
     m_kmenu_icon = newIcon;
-    TDEIconLoader * ldr = TDEGlobal::iconLoader();
-    TQPixmap kmenu_icon;
-    kmenu_icon = ldr->loadIcon(m_kmenu_icon, TDEIcon::Small, TDEIcon::SizeSmall);
-    btnCustomKMenuIcon->setPixmap(kmenu_icon);
+    TDEIconLoader * ldr = TDEGlobal::iconLoader();    
+    TQIconSet kmenu_icon = ldr->loadIconSet(m_kmenu_icon, TDEIcon::Small, TDEIcon::SizeSmall);
+    btnCustomKMenuIcon->setIconSet(kmenu_icon);
     m_kmenu_button_changed = true;
 
     emit changed();