[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:57:16
Message-ID: 200405210257.17021.teemu.rytilahti () kde-fi ! org
[Download RAW message or body]

Davide Ferrari kirjoitti viestissään (lähetysaika perjantai, 21. toukokuuta 
2004 02:41):
> Alle 01:27, venerdì 21 maggio 2004, Teemu Rytilahti ha scritto:
> > So, what do you think? Comments are very welcome :)
>
> Ehm, can you post an english screenshot? I'm not very used to finnish and I
> can't get the right feeling with it :)
> Thanks!
Oh, sorry about that, here it's now... I did more patching and enabled this 
new behaviour to child panel. And I also commented out some lines from 
systemtray code to not to "sunk" the applet when mouse hovers it. What do you 
think about that one? In my humble opionion the sunkening of systemtray 
doesn't look very cool, and not at last when it doesn't return sometimes 
somewhy.

If you take a look at the patch, don't be too cruel about those "removing 
stuff" comments as this is only kind of "prepatch" and I'll surely clean it 
up soon, if you accept this proposal.

-- 
Best regards, 
Teemu Rytilahti
http://www.kde-fi.org

["kicker_rmb_en.png" (image/png)]
["kicker-applet-menu-3b.patch" (text/x-diff)]

? Doxyfile
? kicker-applet-menu-2.patch
? kicker-applet-menu-3.patch
? kicker-applet-menu-3b.patch
? kicker-applet-menu.patch
? kicker.kdevelop
? kicker.kdevelop.pcs
? kicker.kdevses
Index: applets/systemtray/systemtrayapplet.cpp
===================================================================
RCS file: /home/kdecvs/kde/kdebase/kicker/applets/systemtray/systemtrayapplet.cpp,v
retrieving revision 1.47
diff -u -3 -p -r1.47 systemtrayapplet.cpp
--- a/applets/systemtray/systemtrayapplet.cpp	11 Feb 2004 00:46:54 -0000	1.47
+++ b/applets/systemtray/systemtrayapplet.cpp	20 May 2004 23:46:54 -0000
@@ -164,21 +164,24 @@ void SystemTrayApplet::enterEvent( QEven
      * tray while a popup menu from one of the systray icons is active) and no
      * leave event will be sent, thus leaving the border shown.
      */
-
+    
+    /* why there's this one? Imho this makes it only uglier and 
+     * the leave event doesn't always happen or it doesn't return it back. -tpr \
20040521  if ( showFrame && ( frameStyle() == NoFrame ) )
     {
         setFrameStyle( Panel|Sunken );
         repaint();
-    }
+    }*/
 }
 
 void SystemTrayApplet::leaveEvent( QEvent * )
 {
+    /* no for this too, -tpr
     if ( showFrame && !geometry().contains( mapFromGlobal( QCursor::pos() ) ) )
     {
         setFrameStyle( NoFrame );
         repaint();
-    }
+    }*/
 }
 
 void SystemTrayApplet::systemTrayWindowAdded( WId w )
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:46:55 -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:46:55 -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:46:55 -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:46:55 -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:46:55 -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: extensions/childpanel/childpanelextension.cpp
===================================================================
RCS file: /home/kdecvs/kde/kdebase/kicker/extensions/childpanel/childpanelextension.cpp,v
 retrieving revision 1.43
diff -u -3 -p -r1.43 childpanelextension.cpp
--- a/extensions/childpanel/childpanelextension.cpp	4 May 2004 18:01:35 -0000	1.43
+++ b/extensions/childpanel/childpanelextension.cpp	20 May 2004 23:46:55 -0000
@@ -293,7 +293,7 @@ void ChildPanelExtension::slotBuildOpMen
         _opMnu->insertItem(i18n("&Add"), addMnu);
         _opMnu->insertItem(i18n("&Remove"), removeMnu);
         _opMnu->insertSeparator();
-        _opMnu->insertItem(i18n("Si&ze"), _sizeMnu);
+        //_opMnu->insertItem(i18n("Si&ze"), _sizeMnu);
         _opMnu->insertItem(SmallIconSet("configure"), i18n("&Configure Panel..."),
                 this, SLOT(slotLaunchConfig()));
         _opMnu->insertSeparator();
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:46:55 -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:46:55 -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