summaryrefslogtreecommitdiffstats
path: root/kicker
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-22 07:16:55 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-22 07:16:55 +0000
commit78feb5c8dc099b79e855db97ac96d7a2c33644c6 (patch)
tree2656a368d41cfc823b4a0d45aabcd3f9cce5e57e /kicker
parent7d27a8d80db659efcef8f3197f43d8337890123d (diff)
downloadtdebase-78feb5c8dc099b79e855db97ac96d7a2c33644c6.tar.gz
tdebase-78feb5c8dc099b79e855db97ac96d7a2c33644c6.zip
Repair various KMenu side pixmap problems
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1178045 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker')
-rw-r--r--kicker/kicker/ui/k_mnu.cpp21
-rw-r--r--kicker/kicker/ui/k_mnu.h4
2 files changed, 24 insertions, 1 deletions
diff --git a/kicker/kicker/ui/k_mnu.cpp b/kicker/kicker/ui/k_mnu.cpp
index b8084f489..9328a8586 100644
--- a/kicker/kicker/ui/k_mnu.cpp
+++ b/kicker/kicker/ui/k_mnu.cpp
@@ -74,6 +74,7 @@ PanelKMenu::PanelKMenu()
: PanelServiceMenu(TQString::null, TQString::null, 0, "KMenu")
, bookmarkMenu(0)
, bookmarkOwner(0)
+ , displayRepaired(FALSE)
{
static const TQCString dcopObjId("KMenu");
DCOPObject::setObjId(dcopObjId);
@@ -91,6 +92,8 @@ PanelKMenu::PanelKMenu()
dcopObjId,
"slotServiceStartedByStorageId(TQString,TQString)",
false);
+ displayRepairTimer = new TQTimer( this );
+ connect( displayRepairTimer, SIGNAL(timeout()), this, SLOT(repairDisplay()) );
}
PanelKMenu::~PanelKMenu()
@@ -365,9 +368,26 @@ void PanelKMenu::initialize()
insertTearOffHandle();
#endif
+ if (displayRepaired == FALSE) {
+ displayRepairTimer->start(0, FALSE);
+ displayRepaired = TRUE;
+ }
+
setInitialized(true);
}
+void PanelKMenu::repairDisplay(void) {
+ if (isShown() == true) {
+ displayRepairTimer->stop();
+
+ // Now do a nasty hack to prevent search bar merging into the side image
+ // This forces a layout/repaint of the qpopupmenu
+ repaint(); // This ensures that the side bar image was applied
+ styleChange(style()); // This forces a call to the private function updateSize(TRUE) inside the qpopupmenu.
+ update(); // This repaints the entire popup menu to apply the widget size/alignment changes made above
+ }
+}
+
int PanelKMenu::insertClientMenu(KickerClientMenu *p)
{
int id = client_id;
@@ -520,7 +540,6 @@ void PanelKMenu::showMenu()
else
{
show();
- repaint(); // If the menu is not repainted on initial display the search bar merges into the side image
}
}
diff --git a/kicker/kicker/ui/k_mnu.h b/kicker/kicker/ui/k_mnu.h
index 91904e0d0..6dedec4c9 100644
--- a/kicker/kicker/ui/k_mnu.h
+++ b/kicker/kicker/ui/k_mnu.h
@@ -27,6 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <dcopobject.h>
#include <tqintdict.h>
#include <tqpixmap.h>
+#include <tqtimer.h>
#include "service_mnu.h"
@@ -84,6 +85,7 @@ protected slots:
void paletteChanged();
virtual void configChanged();
void updateRecent();
+ void repairDisplay();
protected:
TQRect sideImageRect();
@@ -113,6 +115,8 @@ private:
PopupMenuList dynamicSubMenus;
KPIM::ClickLineEdit *searchEdit;
static const int searchLineID;
+ TQTimer *displayRepairTimer;
+ bool displayRepaired;
};
#endif