[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeutils/kdf
From:       Stanislav Karchebny <berk () upnet ! ru>
Date:       2004-07-15 5:55:09
Message-ID: 20040715055509.1D7ED16B0D () office ! kde ! org
[Download RAW message or body]

CVS commit by karchebny: 

* Allow hiding menu on second click on tray icon (improves usability).


  M +12 -2     kwikdisk.cpp   1.57
  M +1 -0      kwikdisk.h   1.15


--- kdeutils/kdf/kwikdisk.h  #1.14:1.15
@@ -68,4 +68,5 @@ class KwikDisk : public KSystemTray
       bool           m_readingDF;
       bool           m_dirty;
+      bool           m_menuVisible;
       COptionDialog *m_optionDialog;
 };

--- kdeutils/kdf/kwikdisk.cpp  #1.56:1.57
@@ -61,4 +61,5 @@ KwikDisk::KwikDisk()
    , m_readingDF(FALSE)
    , m_dirty(TRUE)
+   , m_menuVisible(FALSE)
    , m_optionDialog(0)
 {
@@ -83,6 +84,15 @@ void KwikDisk::mousePressEvent(QMouseEve
       updateDF();
 
+   if( m_menuVisible )
+   {
+      contextMenu()->hide();
+      me->ignore();
+      m_menuVisible = FALSE;
+      return;
+   }
+
    contextMenuAboutToShow(contextMenu());
    contextMenu()->popup( me->globalPos() );
+   m_menuVisible = TRUE;
 }
 
@@ -134,6 +144,6 @@ void KwikDisk::updateDFDone()
    kdDebug() << k_funcinfo << endl;
 
-   m_readingDF = false;
-   m_dirty     = false;
+   m_readingDF = FALSE;
+   m_dirty     = FALSE;
 
    contextMenu()->clear();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic