[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-usability
Subject: Re: [PATCH] Kicker applet context menu simplification
From: Teemu Rytilahti <teemu.rytilahti () kde-fi ! org>
Date: 2004-05-20 23:27:19
Message-ID: 200405210227.20303.teemu.rytilahti () kde-fi ! org
[Download RAW message or body]
Hello,
Have anyone developed this patch further or what happened to it as I can't see
it in CVS? I'd really like to have it there, and that's why I've done some
modifications to kicker based on the latest patch.
So, what I've changed there:
1) Removed ugly "%1 Menu", "%1 Button" and "%1 Applet" lines and started to
use plain %1. For me it looks prettier and for me as translator I can now
translate those properly.
2) Added panel menu, because I felt naked without it, like some other here
too. And in the same time I removed "Size" option from the menu, as it isn't
so important option it couldn't be only in the first page of configuration
dialog. I also thought to remove "Remove" submenu from panel menu, but I
didn't because it's the only way to remove applets and buttons at this
moment.
So, what do you think? Comments are very welcome :)
--
Best regards,
Teemu Rytilahti
http://www.kde-fi.org
["kicker_rmb.png" (image/png)]
["kicker-applet-menu-3.patch" (text/x-diff)]
? Doxyfile
? kicker-applet-menu-2.patch
? kicker-applet-menu-3.patch
? kicker-applet-menu.patch
? kicker.kdevelop
? kicker.kdevelop.pcs
? kicker.kdevses
Index: core/applethandle.cpp
===================================================================
RCS file: /home/kdecvs/kde/kdebase/kicker/core/applethandle.cpp,v
retrieving revision 1.16
diff -u -3 -p -r1.16 applethandle.cpp
--- a/core/applethandle.cpp 27 Aug 2003 08:49:30 -0000 1.16
+++ b/core/applethandle.cpp 20 May 2004 23:24:46 -0000
@@ -183,7 +183,10 @@ bool AppletHandle::eventFilter (QObject
{
QMouseEvent* ev = (QMouseEvent*) e;
if ( ev->button() == RightButton ) {
- emit showAppletMenu();
+ if(ev->state() & ControlButton)
+ emit showPanelMenu();
+ else
+ emit showAppletMenu();
return true;
} else if ( ev->button() == MidButton
|| ev->button() == LeftButton ) {
Index: core/applethandle.h
===================================================================
RCS file: /home/kdecvs/kde/kdebase/kicker/core/applethandle.h,v
retrieving revision 1.9
diff -u -3 -p -r1.9 applethandle.h
--- a/core/applethandle.h 17 Sep 2002 01:48:26 -0000 1.9
+++ b/core/applethandle.h 20 May 2004 23:24:46 -0000
@@ -55,6 +55,7 @@ class AppletHandle : public QWidget
void moveApplet( const QPoint& moveOffset );
void removeApplet();
void showAppletMenu();
+ void showPanelMenu();
public slots:
void toggleMenuButtonOff();
Index: core/container_applet.cpp
===================================================================
RCS file: /home/kdecvs/kde/kdebase/kicker/core/container_applet.cpp,v
retrieving revision 1.58
diff -u -3 -p -r1.58 container_applet.cpp
--- a/core/container_applet.cpp 17 Mar 2004 12:07:16 -0000 1.58
+++ b/core/container_applet.cpp 20 May 2004 23:24:46 -0000
@@ -78,6 +78,7 @@ AppletContainer::AppletContainer( const
connect( _handle, SIGNAL(moveApplet(const QPoint&)), this, SLOT(moveApplet(const \
QPoint&)) );
connect( _handle, SIGNAL(removeApplet()), this, SLOT(removeApplet()) );
connect( _handle, SIGNAL(showAppletMenu()), this, SLOT(showAppletMenu()) );
+ connect( _handle, SIGNAL(showPanelMenu()), this, SLOT(showPanelMenu()) );
//setup appletframe
_appletframe = new QHBox(this);
@@ -161,6 +162,14 @@ void AppletContainer::removeApplet()
emit removeme(this);
}
+void AppletContainer::showPanelMenu()
+{
+ if(! kapp->authorizeKAction("kicker_rmb"))
+ return;
+ QPopupMenu* menu = BaseContainer::reduceMenu(appletOpMenu());
+ menu->popup(popupPosition(popupDirection(), menu, this));
+}
+
void AppletContainer::showAppletMenu()
{
if (!kapp->authorizeKAction("kicker_rmb"))
Index: core/container_applet.h
===================================================================
RCS file: /home/kdecvs/kde/kdebase/kicker/core/container_applet.h,v
retrieving revision 1.25
diff -u -3 -p -r1.25 container_applet.h
--- a/core/container_applet.h 19 Feb 2004 14:48:04 -0000 1.25
+++ b/core/container_applet.h 20 May 2004 23:24:46 -0000
@@ -84,6 +84,9 @@ protected:
int _widthForHeightHint, _heightForWidthHint;
QString _deskFile, _configFile;
bool _firstuse;
+
+protected slots:
+ void showPanelMenu();
};
class InternalAppletContainer : public AppletContainer
Index: core/container_button.cpp
===================================================================
RCS file: /home/kdecvs/kde/kdebase/kicker/core/container_button.cpp,v
retrieving revision 1.48
diff -u -3 -p -r1.48 container_button.cpp
--- a/core/container_button.cpp 3 Apr 2004 17:53:03 -0000 1.48
+++ b/core/container_button.cpp 20 May 2004 23:24:46 -0000
@@ -150,29 +150,34 @@ bool ButtonContainer::eventFilter(QObjec
qApp->syncX();
qApp->processEvents();
- QPopupMenu* menu = opMenu();
- connect( menu, SIGNAL( aboutToHide() ), this, SLOT( slotMenuClosed() ) \
);
- switch(menu->exec( popupPosition( popupDirection(), menu, this, \
me->pos() )))
- {
- case PanelAppletOpMenu::Move:
- _moveOffset = rect().center();
- emit moveme(this);
- break;
- case PanelAppletOpMenu::Remove:
- emit removeme(this);
- break;
- case PanelAppletOpMenu::Help:
- help();
- break;
- case PanelAppletOpMenu::About:
- about();
- break;
- case PanelAppletOpMenu::Preferences:
- if (_button)
- _button->properties();
- break;
- default:
- break;
+ bool only_panel = me->state() & Qt::ControlButton;
+ QPopupMenu* menu = only_panel ? \
BaseContainer::reduceMenu(appletOpMenu()) : opMenu(); +
+ connect(menu, SIGNAL(aboutToHide()), SLOT(slotMenuClosed()));
+
+ int res = menu->exec(popupPosition(popupDirection(), menu, this, \
me->pos())); +
+ if(! only_panel) {
+ switch(res) {
+ case PanelAppletOpMenu::Move:
+ _moveOffset = rect().center();
+ emit moveme(this);
+ break;
+ case PanelAppletOpMenu::Remove:
+ emit removeme(this);
+ break;
+ case PanelAppletOpMenu::Help:
+ help();
+ break;
+ case PanelAppletOpMenu::About:
+ about();
+ break;
+ case PanelAppletOpMenu::Preferences:
+ if (_button)
+ _button->properties();
+ break;
+ default: break;
+ }
}
_button->setZoomEnabled(true);
Index: ui/appletop_mnu.cpp
===================================================================
RCS file: /home/kdecvs/kde/kdebase/kicker/ui/appletop_mnu.cpp,v
retrieving revision 1.33
diff -u -3 -p -r1.33 appletop_mnu.cpp
--- a/ui/appletop_mnu.cpp 23 Feb 2004 17:21:14 -0000 1.33
+++ b/ui/appletop_mnu.cpp 20 May 2004 23:24:46 -0000
@@ -32,9 +32,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include "appletop_mnu.h"
#include "container_button.h"
#include "childpanelextension.h"
+#include "popupmenutitle.h"
-PanelAppletOpMenu::PanelAppletOpMenu(int actions, QPopupMenu *opMenu, QPopupMenu* \
appletsMenu,
- const QString & title, const QString &icon, \
QWidget *parent, const char *name) +PanelAppletOpMenu::PanelAppletOpMenu(int actions, \
QPopupMenu*, QPopupMenu* appletsMenu, + const \
QString& title, const QString& icon, QWidget* parent, const char* name) : \
QPopupMenu(parent, name) {
/*
@@ -57,14 +58,13 @@ PanelAppletOpMenu::PanelAppletOpMenu(int
if (!Kicker::kicker()->isImmutable())
{
- QString text = isButton ? (isMenu ? i18n("&Move %1 Menu") :
- i18n("&Move %1 Button")) :
- i18n("&Move %1");
- insertItem(SmallIcon("move"), text.arg(title), Move);
- text = isButton ? (isMenu ? i18n("&Remove %1 Menu") :
- i18n("&Remove %1 Button")) :
- i18n("&Remove %1");
- insertItem(SmallIcon("remove"), text.arg(title), Remove);
+ /*QString cap = isButton ? (isMenu ? i18n("%1 Menu") :
+ i18n("%1 Button")) :
+ "%1";*/
+ insertItem(new PopupMenuTitle(title, font()));
+ insertItem(SmallIcon("move"), i18n("&Move"), Move);
+ insertItem(SmallIcon("remove"), i18n("&Remove"), Remove);
+
needSeparator = true;
}
@@ -160,7 +160,7 @@ PanelAppletOpMenu::PanelAppletOpMenu(int
}
insertItem(SmallIcon("panel"), i18n("Panel Menu"), panelMenu);
- */
+
if (appletsMenu)
{
@@ -174,9 +174,9 @@ PanelAppletOpMenu::PanelAppletOpMenu(int
{
insertItem(SmallIcon(icon), text, appletsMenu);
}
- }
-
- insertItem(SmallIcon("panel"), i18n("Panel Menu"), \
BaseContainer::reduceMenu(opMenu)); + }*/
+ QPopupMenu *panelMenu = new PanelOpMenu(Panel::the(), this);
+ insertItem(SmallIcon("panel"), i18n("Panel Menu"), panelMenu);
adjustSize();
}
Index: ui/panelop_mnu.cpp
===================================================================
RCS file: /home/kdecvs/kde/kdebase/kicker/ui/panelop_mnu.cpp,v
retrieving revision 1.45
diff -u -3 -p -r1.45 panelop_mnu.cpp
--- a/ui/panelop_mnu.cpp 28 Oct 2003 15:51:03 -0000 1.45
+++ b/ui/panelop_mnu.cpp 20 May 2004 23:24:46 -0000
@@ -122,7 +122,7 @@ void PanelOpMenu::buildMenu()
insertItem(i18n("&Remove"),
new RemoveContainerMenu( _panel->containerArea(), TRUE, this));
insertSeparator();
- insertItem(i18n("Si&ze"), sizeMnu);
+ //insertItem(i18n("Si&ze"), sizeMnu);
insertItem(SmallIconSet("configure"), i18n("&Configure Panel..."),
Kicker::kicker(), SLOT(slotLaunchConfig()));
_______________________________________________
kde-usability mailing list
kde-usability@kde.org
https://mail.kde.org/mailman/listinfo/kde-usability
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic