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 @@ -286,6 +286,22 @@ <p><b>Tip</b>: You can customize the image that appears in the TDE Menu by putting an image file called kside.png and a tileable image file called kside_tile.png in $TDEHOME/share/apps/kicker/pics.</qt> + + + kcfg_UseTopPixmap + + + Show top ima&ge + + + true + + + <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> + + kcfg_ShowKMenuText 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 new file mode 100644 index 000000000..38a527aef Binary files /dev/null and b/kicker/data/kmenu_side/kside_top_left.png 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 000000000..d6ea97fd9 Binary files /dev/null and b/kicker/data/kmenu_side/kside_top_right.png 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 000000000..08ddb6712 Binary files /dev/null and b/kicker/data/kmenu_side/kside_top_tile.png differ 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 #include #include +#include #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::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 @@ - + true - + false - + - + true - + + + false + + + + + kside_top_left.png + + + + + kside_top_right.png + + + + + kside_top_tile.png + + + kside.png - + kside_tile.png - + false - + i18n("Applications") - + QString("kmenu")