diff options
author | Timothy Pearson <[email protected]> | 2014-10-08 00:33:34 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2014-10-08 00:33:34 -0500 |
commit | f4dab230c4d9f9e2aca86df98d2ee7398f9988aa (patch) | |
tree | 0d2b9292ae4ba365aab22c59a2de05146e407ee7 | |
parent | 4724b1a838bf20c85309d8812c1a0bd23bbf2f90 (diff) | |
download | tdebase-f4dab230c4d9f9e2aca86df98d2ee7398f9988aa.tar.gz tdebase-f4dab230c4d9f9e2aca86df98d2ee7398f9988aa.zip |
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
-rw-r--r-- | kcontrol/kicker/menutab.ui | 16 | ||||
-rw-r--r-- | kcontrol/kicker/menutab_impl.cpp | 18 | ||||
-rw-r--r-- | kicker/data/kmenu_side/CMakeLists.txt | 2 | ||||
-rw-r--r-- | kicker/data/kmenu_side/Makefile.am | 2 | ||||
-rw-r--r-- | kicker/data/kmenu_side/kside_top_left.png | bin | 0 -> 178 bytes | |||
-rw-r--r-- | kicker/data/kmenu_side/kside_top_right.png | bin | 0 -> 204 bytes | |||
-rw-r--r-- | kicker/data/kmenu_side/kside_top_tile.png | bin | 0 -> 158 bytes | |||
-rw-r--r-- | kicker/kicker/ui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | kicker/kicker/ui/Makefile.am | 2 | ||||
-rw-r--r-- | kicker/kicker/ui/k_mnu.cpp | 40 | ||||
-rw-r--r-- | kicker/libkicker/kickerSettings.kcfg | 38 |
11 files changed, 103 insertions, 17 deletions
diff --git a/kcontrol/kicker/menutab.ui b/kcontrol/kicker/menutab.ui index aa488c1b0..5d3f8fcfe 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&ge</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="whatsThis" stdset="0"> + <string><qt>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. + + <p><b>Tip</b>: 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.</qt></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 6be59c475..fe20f2302 100644 --- a/kcontrol/kicker/menutab_impl.cpp +++ b/kcontrol/kicker/menutab_impl.cpp @@ -84,6 +84,11 @@ MenuTab::MenuTab( TQWidget *parent, const char* name ) //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() void MenuTab::load( bool useDefaults ) { TDESharedConfig::Ptr c = TDESharedConfig::openConfig(KickerConfig::the()->configName()); - + c->setReadDefaults( useDefaults ); c->setGroup("menus"); @@ -175,6 +180,7 @@ void MenuTab::menuStyleChanged() 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 @@ void MenuTab::menuStyleChanged() 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 @@ void MenuTab::save() 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 4207e1361..197db4e39 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 2d3e00932..3df9240ea 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 Binary files differnew file mode 100644 index 000000000..38a527aef --- /dev/null +++ b/kicker/data/kmenu_side/kside_top_left.png diff --git a/kicker/data/kmenu_side/kside_top_right.png b/kicker/data/kmenu_side/kside_top_right.png Binary files differnew file mode 100644 index 000000000..d6ea97fd9 --- /dev/null +++ b/kicker/data/kmenu_side/kside_top_right.png diff --git a/kicker/data/kmenu_side/kside_top_tile.png b/kicker/data/kmenu_side/kside_top_tile.png Binary files differnew file mode 100644 index 000000000..08ddb6712 --- /dev/null +++ b/kicker/data/kmenu_side/kside_top_tile.png diff --git a/kicker/kicker/ui/CMakeLists.txt b/kicker/kicker/ui/CMakeLists.txt index e1fdfd957..754288ce9 100644 --- a/kicker/kicker/ui/CMakeLists.txt +++ b/kicker/kicker/ui/CMakeLists.txt @@ -48,7 +48,7 @@ set( ${target}_SRCS 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 f624e35ec..40ddeb144 100644 --- a/kicker/kicker/ui/Makefile.am +++ b/kicker/kicker/ui/Makefile.am @@ -12,7 +12,7 @@ libkicker_ui_la_SOURCES = addbutton_mnu.cpp appletitem.ui appletview.ui addapple 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 a39da3051..6f8ddc4aa 100644 --- a/kicker/kicker/ui/k_mnu.cpp +++ b/kicker/kicker/ui/k_mnu.cpp @@ -51,6 +51,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <kstandarddirs.h> #include <tdetoolbarbutton.h> #include <twin.h> +#include <popupmenutop.h> #include "client_mnu.h" #include "container_base.h" @@ -156,7 +157,7 @@ void PanelKMenu::windowClearTimeout() bool PanelKMenu::loadSidePixmap() { - if (!KickerSettings::useSidePixmap()) + if (!KickerSettings::useSidePixmap() || KickerSettings::useTopSide()) { return false; } @@ -754,8 +755,15 @@ void PanelKMenu::createRecentMenuItems() 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 @@ void PanelKMenu::createRecentMenuItems() 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++; @@ -791,6 +803,11 @@ void PanelKMenu::createRecentMenuItems() insertSeparator(RecentlyLaunchedApps::the().m_nNumMenuItems); } } + else if(KickerSettings::useTopSide()) + { + int id = insertItem(new PopupMenuTop(),serviceMenuEndId(),0); + setItemEnabled( id, false ); + } } void PanelKMenu::clearSubmenus() @@ -822,6 +839,8 @@ void PanelKMenu::updateRecent() RecentlyLaunchedApps::the().m_bNeedToUpdate = false; + bool bTitleTop = KickerSettings::useTopSide(); + int nId = serviceMenuEndId() + 1; // remove previous items @@ -829,6 +848,10 @@ void PanelKMenu::updateRecent() { // -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); @@ -842,6 +865,10 @@ void PanelKMenu::updateRecent() } } + if(bTitleTop) { + removeItemAt(0); + } + // insert new items TQStringList RecentApps; RecentlyLaunchedApps::the().getRecentApps(RecentApps); @@ -866,6 +893,10 @@ void PanelKMenu::updateRecent() RecentlyLaunchedApps::the().caption(), font()), nId - 1, 0); setItemEnabled( id, false ); + if(bTitleTop) { + id = insertItem(new PopupMenuTop(),nId - 1,0); + setItemEnabled( id, false ); + } } insertMenuItem(s, nId++, KickerSettings::showMenuTitles() ? 1 : 0); @@ -881,6 +912,11 @@ void PanelKMenu::updateRecent() insertSeparator(RecentlyLaunchedApps::the().m_nNumMenuItems); } } + else if(bTitleTop) + { + int id = insertItem(new PopupMenuTop(),serviceMenuEndId(),0); + setItemEnabled( id, false ); + } } void PanelKMenu::clearRecentMenuItems() diff --git a/kicker/libkicker/kickerSettings.kcfg b/kicker/libkicker/kickerSettings.kcfg index 0b022a30e..0abc51bf0 100644 --- a/kicker/libkicker/kickerSettings.kcfg +++ b/kicker/libkicker/kickerSettings.kcfg @@ -354,42 +354,62 @@ <group name="KMenu" > -<entry name="UseSidePixmap" type="Bool" > + <entry name="UseSidePixmap" type="Bool" > <label>Use side image in Kmenu</label> <default>true</default> </entry> -<entry name="UseTooltip" type="Bool" > + <entry name="UseTooltip" type="Bool" > <label>Use Tooltip in Kmenu</label> <default>false</default> -</entry> + </entry> -<entry name="UseSearchBar" type="Bool" > + <entry name="UseSearchBar" type="Bool" > <label>Show searh field in Kmenu</label> <default>true</default> </entry> -<entry name="SidePixmapName" key="SideName" type="String" > + <entry name="UseTopSide" type="Bool" > + <label>Use side image on top of Kmenu</label> + <default>false</default> + </entry> + + <entry name="LeftSideTopPixmapName" key="LeftSideTopName" type="String" > + <label>The name of the file to use as the side image in the TDE Menu</label> + <default>kside_top_left.png</default> + </entry> + + <entry name="RightSideTopPixmapName" key="RightSideTopName" type="String" > + <label>The name of the file to use as the side image in the TDE Menu</label> + <default>kside_top_right.png</default> + </entry> + + <entry name="SideTopTileName" key="SideTopTileName" type="String" > + <label>The name of the file used as a tile to fill the height of TDE Menu that SidePixmapName does not cover</label> + <default>kside_top_tile.png</default> + </entry> + + <entry name="SidePixmapName" key="SideName" type="String" > <label>The name of the file to use as the side image in the TDE Menu</label> <default>kside.png</default> </entry> -<entry name="SideTileName" key="SideTileName" type="String" > + <entry name="SideTileName" key="SideTileName" type="String" > <label>The name of the file used as a tile to fill the height of TDE Menu that SidePixmapName does not cover</label> <default>kside_tile.png</default> </entry> -<entry name="ShowKMenuText" key="ShowText" type="Bool" > + <entry name="ShowKMenuText" key="ShowText" type="Bool" > <label>Show text on the TDE Menu button</label> <default>false</default> </entry> -<entry name="KMenuText" key="Text" type="String" > + <entry name="KMenuText" key="Text" type="String" > <label>Text to be shown on TDE Menu Button</label> <default code="true">i18n("Applications")</default> </entry> -<entry name="CustomKMenuIcon" key="CustomIcon" type="Path" > + <entry name="CustomKMenuIcon" key="CustomIcon" type="Path" > <label>Custom TDE Menu Button Icon</label> <default code="true">QString("kmenu")</default> </entry> |