Bug 72203 - Toolbar repaint with Plastik style lags behind window frame
Summary: Toolbar repaint with Plastik style lags behind window frame
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kstyle (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Karol Szwed
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-09 01:10 UTC by Rayiner Hashem
Modified: 2004-01-21 17:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rayiner Hashem 2004-01-09 01:10:11 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          g++ 3.3.3 
OS:          Linux

When resizing a window with the Plastik style, there will be a lag between the time Qt repaints the toolbar using the button color, and the time the style fills it with the background color. This causes the toolbar to "creep" across the screen as the window is enlarged. The fix is simple. A patch based on Mosfet Liquid's fix for the problem follows:

---------------- cut here ----------------

--- plastik/plastik.cpp	2004-01-04 11:18:46.000000000 -0500
+++ plastik-custom2/plastik.cpp	2004-01-09 18:44:21.000000000 -0500
@@ -1566,7 +1566,11 @@
     // --------------------
         case PE_PanelMenuBar:
         case PE_PanelDockWindow: {
-            p->fillRect(r, cg.background() );
+            // fix for toolbar lag (from Mosfet Liquid)
+            QWidget* w = (QWidget*)p->device();
+            if(w->backgroundMode() == PaletteButton)
+                w->setBackgroundMode(PaletteBackground);
+            p->fillRect(r, cg.brush(QColorGroup::Background));
 
             if ( _drawToolBarSeparator ) {
                 if ( r.width() > r.height() ) {

--------------- cut here -----------------

The problem can also be fixed by changing the background mode of toolbar widgets in QStyle::polish(), but that method does not work for KOffice apps, which seem to change the background-mode of their toolbars after polish() is called.
Comment 1 Sandro Giessl 2004-01-21 17:29:24 UTC
Thanks!