author | zautrix <zautrix> | 2004-12-05 12:12:10 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-12-05 12:12:10 (UTC) |
commit | 5ab47964d8b52897bb0662ef4a5fcf9604acaf6c (patch) (side-by-side diff) | |
tree | 0f80433206ddd6b4ef901cb346d0f06caf76b20f | |
parent | 196365e533c6fd1a8f47aa9579763ef5afcebcda (diff) | |
download | kdepimpi-5ab47964d8b52897bb0662ef4a5fcf9604acaf6c.zip kdepimpi-5ab47964d8b52897bb0662ef4a5fcf9604acaf6c.tar.gz kdepimpi-5ab47964d8b52897bb0662ef4a5fcf9604acaf6c.tar.bz2 |
fixed kapi toolbar repaint problem
-rw-r--r-- | kaddressbook/kabcore.cpp | 10 | ||||
-rw-r--r-- | microkde/kdeui/ktoolbar.cpp | 6 | ||||
-rw-r--r-- | microkde/kdeui/ktoolbar.h | 3 |
3 files changed, 15 insertions, 4 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 76f9ab6..15cab73 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -354,24 +354,28 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const mEditorDialog = 0; createAddresseeEditorDialog( this ); setModified( false ); mBRdisabled = false; #ifndef DESKTOP_VERSION infrared = 0; #endif //toggleBeamReceive( ); - + //mMainWindow->toolBar()->show(); // we have a toolbar repainting error on the Zaurus when starting KA/Pi - QTimer::singleShot( 10000, this , SLOT ( updateToolBar())); + QTimer::singleShot( 10, this , SLOT ( updateToolBar())); } void KABCore::updateToolBar() { - mMainWindow->toolBar()->update(); + static int iii = 0; + ++iii; + mMainWindow->toolBar()->repaintMe(); + if ( iii < 5 ) + QTimer::singleShot( 10, this , SLOT ( updateToolBar())); } KABCore::~KABCore() { // save(); //saveSettings(); //KABPrefs::instance()->writeConfig(); delete AddresseeConfig::instance(); mAddressBook = 0; diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp index 79b0f9d..e9226c0 100644 --- a/microkde/kdeui/ktoolbar.cpp +++ b/microkde/kdeui/ktoolbar.cpp @@ -1405,16 +1405,22 @@ void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id ) } else widgets.insert( index, w ); if ( id == -1 ) id = id2widget.count(); id2widget.insert( id, w ); widget2id.insert( w, id ); } +void KToolBar::repaintMe() +{ + setUpdatesEnabled( true ); + QToolBar::repaint( true ); + qDebug(" KToolBar::repaintMe() "); +} void KToolBar::showEvent( QShowEvent *e ) { QToolBar::showEvent( e ); rebuildLayout(); } void KToolBar::setStretchableWidget( QWidget *w ) diff --git a/microkde/kdeui/ktoolbar.h b/microkde/kdeui/ktoolbar.h index 2c061b5..61b5ea3 100644 --- a/microkde/kdeui/ktoolbar.h +++ b/microkde/kdeui/ktoolbar.h @@ -1040,47 +1040,48 @@ signals: * @since 3.2 */ void toolbarDestroyed(); public: /** * @return global setting for "Highlight buttons under mouse" */ + void repaintMe(); static bool highlightSetting(); /** * @return global setting for "Toolbars transparent when moving" */ static bool transparentSetting(); /** * @return global setting for "Icon Text" */ static IconText iconTextSetting(); public slots: virtual void setIconText( const QString &txt ) { QToolBar::setIconText( txt ); } + void slotRepaint(); protected: void mousePressEvent( QMouseEvent * ); void childEvent( QChildEvent *e ); void showEvent( QShowEvent *e ); void resizeEvent( QResizeEvent *e ); bool event( QEvent *e ); void applyAppearanceSettings(KConfig *config, const QString &_configGroup, bool forceGlobal = false); QString settingsGroup(); private slots: void rebuildLayout(); void slotReadConfig (); void slotAppearanceChanged(); void slotIconChanged(int); - void slotRepaint(); void toolBarPosChanged( QToolBar *tb ); void slotContextAboutToShow(); void widgetDestroyed(); private: void init( bool readConfig = true, bool honorStyle = false ); void doConnections( KToolBarButton *button ); void insertWidgetInternal( QWidget *w, int &index, int id ); |