Branch: master

f4dab230 2014-10-08 00:33:34 Timothy Pearson
Push the top menu banner support patches from Bug 1499
These are disabled by default and need additional repair but this is a good start
A kicker/data/kmenu_side/kside_top_left.png
A kicker/data/kmenu_side/kside_top_right.png
A kicker/data/kmenu_side/kside_top_tile.png
M kcontrol/kicker/menutab.ui
M kcontrol/kicker/menutab_impl.cpp
M kicker/data/kmenu_side/CMakeLists.txt
M kicker/data/kmenu_side/Makefile.am
M kicker/kicker/ui/CMakeLists.txt
M kicker/kicker/ui/Makefile.am
M kicker/kicker/ui/k_mnu.cpp
M kicker/libkicker/kickerSettings.kcfg
diff --git a/kcontrol/kicker/menutab.ui b/kcontrol/kicker/menutab.ui
index aa488c1..5d3f8fc 100644
--- a/kcontrol/kicker/menutab.ui
+++ b/kcontrol/kicker/menutab.ui
@@ -288,6 +288,22 @@
 					</widget>
 					<widget class="TQCheckBox">
 						<property name="name">
+							<cstring>kcfg_UseTopPixmap</cstring>
+						</property>
+						<property name="text">
+							<string>Show top ima&amp;ge</string>
+						</property>
+						<property name="checked">
+							<bool>true</bool>
+						</property>
+						<property name="whatsThis" stdset="0">
+							<string>&lt;qt&gt;When this option is selected an image will appear on top of the TDE Menu. The image will be tinted according to your color settings.
+								
+								&lt;p&gt;&lt;b&gt;Tip&lt;/b&gt;: You can customize the image that appears in the TDE Menu by putting image files called kside_top_left.png and kside_top_right.png, and a tileable image file called kside_top_tile.png in $TDEHOME/share/apps/kicker/pics.&lt;/qt&gt;</string>
+						</property>
+					</widget>
+					<widget class="TQCheckBox">
+						<property name="name">
 							<cstring>kcfg_ShowKMenuText</cstring>
 						</property>
 						<property name="text">
diff --git a/kcontrol/kicker/menutab_impl.cpp b/kcontrol/kicker/menutab_impl.cpp
index 6be59c4..fe20f23 100644
--- a/kcontrol/kicker/menutab_impl.cpp
+++ b/kcontrol/kicker/menutab_impl.cpp
@@ -84,6 +84,11 @@
     //connect(kcfg_ButtonFont, TQT_SIGNAL(fontSelected(const TQFont &)), TQT_SLOT(kmenuChanged()));
     connect(maxrecentdocs, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(kmenuChanged()));
 
+    // FIXME
+    // When top pixmap support is ready for end-user visibility, replace
+    // the separate top/side checkboxes with either a drop down or radio buttons
+    kcfg_UseTopPixmap->hide();
+
     TDEIconLoader * ldr = TDEGlobal::iconLoader();
     m_kmenu_icon = KickerSettings::customKMenuIcon();
     if (m_kmenu_icon.isNull() == true) {
@@ -109,7 +114,7 @@
 void MenuTab::load( bool useDefaults )
 {
     TDESharedConfig::Ptr c = TDESharedConfig::openConfig(KickerConfig::the()->configName());
-    
+
     c->setReadDefaults( useDefaults );
 
     c->setGroup("menus");
@@ -175,6 +180,7 @@
        m_openOnHover->setEnabled(false);
        m_subMenus->setEnabled(true);
        kcfg_UseSidePixmap->setEnabled(true);
+       kcfg_UseTopPixmap->setEnabled(true);
        kcfg_UseTooltip->setEnabled(true);
        kcfg_MenuEntryFormat->setEnabled(true);
        kcfg_RecentVsOften->setEnabled(true);
@@ -184,12 +190,13 @@
        maxrecentdocs->setEnabled(true);
        kcfg_NumVisibleEntries->setEnabled(true);
     }
-    
+
     // Kickoff Menu
     else {
        m_openOnHover->setEnabled(true);
        m_subMenus->setEnabled(false);
        kcfg_UseSidePixmap->setEnabled(false);
+       kcfg_UseTopPixmap->setEnabled(true);
        kcfg_UseTooltip->setEnabled(false);
        kcfg_MenuEntryFormat->setEnabled(false);
        kcfg_RecentVsOften->setEnabled(false);
@@ -264,6 +271,13 @@
         forceRestart = true;
     }
 
+    bool toppixmapsetting = kcfg_UseTopPixmap->isChecked();
+    bool oldtoppixmapsetting = c->readBoolEntry("UseTopPixmap", true);
+
+    if (toppixmapsetting != oldtoppixmapsetting) {
+        forceRestart = true;
+    }
+
     bool tooltipsetting = kcfg_UseTooltip->isChecked();
     bool oldtooltipsetting = c->readBoolEntry("UseTooltip", false);
 
diff --git a/kicker/data/kmenu_side/CMakeLists.txt b/kicker/data/kmenu_side/CMakeLists.txt
index 4207e13..197db4e 100644
--- a/kicker/data/kmenu_side/CMakeLists.txt
+++ b/kicker/data/kmenu_side/CMakeLists.txt
@@ -9,4 +9,4 @@
 #
 #################################################
 
-install( FILES kside.png kside_tile.png DESTINATION ${DATA_INSTALL_DIR}/kicker/pics )
+install( FILES kside.png kside_tile.png kside_top_left.png kside_top_right.png kside_top_tile.png DESTINATION ${DATA_INSTALL_DIR}/kicker/pics )
diff --git a/kicker/data/kmenu_side/Makefile.am b/kicker/data/kmenu_side/Makefile.am
index 2d3e009..3df9240 100644
--- a/kicker/data/kmenu_side/Makefile.am
+++ b/kicker/data/kmenu_side/Makefile.am
@@ -1,4 +1,4 @@
-kicker_kmenuside_pics_data_DATA = kside.png kside_tile.png 
+kicker_kmenuside_pics_data_DATA = kside.png kside_tile.png kside_top_left.png kside_top_right.png kside_top_tile.png 
 kicker_kmenuside_pics_datadir = $(kde_datadir)/kicker/pics
 
 EXTRA_DIST = $(kicker_kmenuside_pics_data_DATA)
diff --git a/kicker/data/kmenu_side/kside_top_left.png b/kicker/data/kmenu_side/kside_top_left.png
new file mode 100644
index 0000000..38a527a
--- /dev/null
+++ b/kicker/data/kmenu_side/kside_top_left.png
Binary files differ
diff --git a/kicker/data/kmenu_side/kside_top_right.png b/kicker/data/kmenu_side/kside_top_right.png
new file mode 100644
index 0000000..d6ea97f
--- /dev/null
+++ b/kicker/data/kmenu_side/kside_top_right.png
Binary files differ
diff --git a/kicker/data/kmenu_side/kside_top_tile.png b/kicker/data/kmenu_side/kside_top_tile.png
new file mode 100644
index 0000000..08ddb67
--- /dev/null
+++ b/kicker/data/kmenu_side/kside_top_tile.png
Binary files differ
diff --git a/kicker/kicker/ui/CMakeLists.txt b/kicker/kicker/ui/CMakeLists.txt
index e1fdfd9..754288c 100644
--- a/kicker/kicker/ui/CMakeLists.txt
+++ b/kicker/kicker/ui/CMakeLists.txt
@@ -48,7 +48,7 @@
   extensionop_mnu.cpp k_mnu_stub.cpp recentapps.cpp
   browser_dlg.cpp itemview.cpp kickoff_bar.cpp removeapplet_mnu.cpp
   removeextension_mnu.cpp removecontainer_mnu.cpp removebutton_mnu.cpp
-  popupmenutitle.cpp hidebutton.cpp addappletvisualfeedback.cpp
+  popupmenutitle.cpp hidebutton.cpp popupmenutop.cpp addappletvisualfeedback.cpp
   clicklineedit.cpp flipscrollview.cpp media_watcher.cpp
   media_watcher.skel mykickoffsearchinterface.cpp query.cpp
 )
diff --git a/kicker/kicker/ui/Makefile.am b/kicker/kicker/ui/Makefile.am
index f624e35..40ddeb1 100644
--- a/kicker/kicker/ui/Makefile.am
+++ b/kicker/kicker/ui/Makefile.am
@@ -12,7 +12,7 @@
         addextension_mnu.cpp extensionop_mnu.cpp k_mnu_stub.cpp \
         recentapps.cpp browser_dlg.cpp itemview.cpp kickoff_bar.cpp \
         removeapplet_mnu.cpp removeextension_mnu.cpp removecontainer_mnu.cpp \
-        removebutton_mnu.cpp popupmenutitle.cpp hidebutton.cpp \
+        removebutton_mnu.cpp popupmenutitle.cpp popupmenutop.cpp hidebutton.cpp \
         addappletvisualfeedback.cpp clicklineedit.cpp flipscrollview.cpp \
         media_watcher.cpp media_watcher.skel mykickoffsearchinterface.cpp query.cpp
 
diff --git a/kicker/kicker/ui/k_mnu.cpp b/kicker/kicker/ui/k_mnu.cpp
index a39da30..6f8ddc4 100644
--- a/kicker/kicker/ui/k_mnu.cpp
+++ b/kicker/kicker/ui/k_mnu.cpp
@@ -51,6 +51,7 @@
 #include <kstandarddirs.h>
 #include <tdetoolbarbutton.h>
 #include <twin.h>
+#include <popupmenutop.h>
 
 #include "client_mnu.h"
 #include "container_base.h"
@@ -156,7 +157,7 @@
 
 bool PanelKMenu::loadSidePixmap()
 {
-    if (!KickerSettings::useSidePixmap())
+    if (!KickerSettings::useSidePixmap() || KickerSettings::useTopSide())
     {
         return false;
     }
@@ -754,8 +755,15 @@
     if (RecentApps.count() > 0)
     {
         bool bSeparator = KickerSettings::showMenuTitles();
+        bool bTitleTop = KickerSettings::useTopSide();
         int nId = serviceMenuEndId() + 1;
-        int nIndex = KickerSettings::showMenuTitles() ? 1 : 0;
+
+        int nIndex;
+        if( bTitleTop ) {
+            nIndex = KickerSettings::showMenuTitles() ? 2 : 0;
+        } else {
+            nIndex = KickerSettings::showMenuTitles() ? 1 : 0;
+        }
 
         for (TQValueList<TQString>::ConstIterator it =
              RecentApps.fromLast(); /*nop*/; --it)
@@ -775,6 +783,10 @@
                             RecentlyLaunchedApps::the().caption(), font()),
                         serviceMenuEndId(), 0);
                     setItemEnabled( id, false );
+                    if( bTitleTop) {
+                        id = insertItem(new PopupMenuTop(),serviceMenuEndId(),0);
+                        setItemEnabled( id, false );
+                    }
                 }
                 insertMenuItem(s, nId++, nIndex);
                 RecentlyLaunchedApps::the().m_nNumMenuItems++;
@@ -790,6 +802,11 @@
         {
             insertSeparator(RecentlyLaunchedApps::the().m_nNumMenuItems);
         }
+    }
+    else if(KickerSettings::useTopSide())
+    {
+        int id = insertItem(new PopupMenuTop(),serviceMenuEndId(),0);
+        setItemEnabled( id, false );
     }
 }
 
@@ -822,6 +839,8 @@
 
     RecentlyLaunchedApps::the().m_bNeedToUpdate = false;
 
+    bool bTitleTop = KickerSettings::useTopSide();
+
     int nId = serviceMenuEndId() + 1;
 
     // remove previous items
@@ -829,6 +848,10 @@
     {
         // -1 --> menu title
         int i = KickerSettings::showMenuTitles() ? -1 : 0;
+        if(bTitleTop) {
+            i = KickerSettings::showMenuTitles() ? -2 : 0;
+        }
+
         for (; i < RecentlyLaunchedApps::the().m_nNumMenuItems; i++)
         {
             removeItem(nId + i);
@@ -840,6 +863,10 @@
         {
             removeItemAt(0);
         }
+    }
+
+    if(bTitleTop) {
+        removeItemAt(0);
     }
 
     // insert new items
@@ -866,6 +893,10 @@
                         RecentlyLaunchedApps::the().caption(),
                             font()), nId - 1, 0);
                     setItemEnabled( id, false );
+                    if(bTitleTop) {
 ** Diff limit reached (max: 250 lines) **