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
pull/2/head
Timothy Pearson 10 years ago
parent 4724b1a838
commit f4dab230c4

@ -286,6 +286,22 @@
&lt;p&gt;&lt;b&gt;Tip&lt;/b&gt;: 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.&lt;/qt&gt;</string>
</property>
</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>

@ -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);

@ -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 )

@ -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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

@ -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
)

@ -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

@ -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()

@ -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>

Loading…
Cancel
Save