summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/ktoolbar.h
authorzautrix <zautrix>2004-12-05 12:12:10 (UTC)
committer zautrix <zautrix>2004-12-05 12:12:10 (UTC)
commit5ab47964d8b52897bb0662ef4a5fcf9604acaf6c (patch) (unidiff)
tree0f80433206ddd6b4ef901cb346d0f06caf76b20f /microkde/kdeui/ktoolbar.h
parent196365e533c6fd1a8f47aa9579763ef5afcebcda (diff)
downloadkdepimpi-5ab47964d8b52897bb0662ef4a5fcf9604acaf6c.zip
kdepimpi-5ab47964d8b52897bb0662ef4a5fcf9604acaf6c.tar.gz
kdepimpi-5ab47964d8b52897bb0662ef4a5fcf9604acaf6c.tar.bz2
fixed kapi toolbar repaint problem
Diffstat (limited to 'microkde/kdeui/ktoolbar.h') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kdeui/ktoolbar.h3
1 files changed, 2 insertions, 1 deletions
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
@@ -952,156 +952,157 @@ signals:
952 /** 952 /**
953 * Emitted when button @p id is clicked. 953 * Emitted when button @p id is clicked.
954 */ 954 */
955 void clicked(int id); 955 void clicked(int id);
956 956
957 /** 957 /**
958 * Emitted when button @p id is double-clicked. 958 * Emitted when button @p id is double-clicked.
959 * 959 *
960 * Note: you will always 960 * Note: you will always
961 * recive two @ref clicked() , @ref pressed() and @ref released() signals. 961 * recive two @ref clicked() , @ref pressed() and @ref released() signals.
962 * There is no way to avoid it - at least no easy way. 962 * There is no way to avoid it - at least no easy way.
963 * If you need to resolve this all you can do is set up timers 963 * If you need to resolve this all you can do is set up timers
964 * which wait for @ref QApplication::doubleClickInterval() to expire. 964 * which wait for @ref QApplication::doubleClickInterval() to expire.
965 * If in that time you don't get this signal, you may belive that 965 * If in that time you don't get this signal, you may belive that
966 * button was only clicked and not double-clicked. 966 * button was only clicked and not double-clicked.
967 * And please note that butons with popup menus do not emit this signal, 967 * And please note that butons with popup menus do not emit this signal,
968 * but those with delayed popup do. 968 * but those with delayed popup do.
969 */ 969 */
970 void doubleClicked (int id); 970 void doubleClicked (int id);
971 971
972 /** 972 /**
973 * Emitted when button @p id is pressed. 973 * Emitted when button @p id is pressed.
974 */ 974 */
975 void pressed(int); 975 void pressed(int);
976 976
977 /** 977 /**
978 * Emits when button @p id is released. 978 * Emits when button @p id is released.
979 */ 979 */
980 void released(int); 980 void released(int);
981 981
982 /** 982 /**
983 * Emitted when a toggle button changes state. 983 * Emitted when a toggle button changes state.
984 * 984 *
985 * Emitted also if you change state 985 * Emitted also if you change state
986 * with @ref setButton() or @ref toggleButton() 986 * with @ref setButton() or @ref toggleButton()
987 * If you make a button normal again, with 987 * If you make a button normal again, with
988 * setToggle(false), this signal won't 988 * setToggle(false), this signal won't
989 * be emitted. 989 * be emitted.
990 */ 990 */
991 void toggled(int); 991 void toggled(int);
992 992
993 /** 993 /**
994 * This signal is emitted when item id gets highlighted/unhighlighted 994 * This signal is emitted when item id gets highlighted/unhighlighted
995 * (i.e when mouse enters/exits). 995 * (i.e when mouse enters/exits).
996 * 996 *
997 * Note that this signal is emitted from 997 * Note that this signal is emitted from
998 * all buttons (normal, disabled and toggle) even when there is no visible 998 * all buttons (normal, disabled and toggle) even when there is no visible
999 * change in buttons (i.e., buttons do not raise when mouse enters). 999 * change in buttons (i.e., buttons do not raise when mouse enters).
1000 * The parameter @p isHighlighted is @p true when mouse enters and @p false when 1000 * The parameter @p isHighlighted is @p true when mouse enters and @p false when
1001 * mouse exits. 1001 * mouse exits.
1002 */ 1002 */
1003 void highlighted(int id, bool isHighlighted); 1003 void highlighted(int id, bool isHighlighted);
1004 1004
1005 /** 1005 /**
1006 * This signal is emitted when item id gets highlighted/unhighlighted 1006 * This signal is emitted when item id gets highlighted/unhighlighted
1007 * (i.e when mouse enters/exits). 1007 * (i.e when mouse enters/exits).
1008 * 1008 *
1009 * Note that this signal is emitted from 1009 * Note that this signal is emitted from
1010 * all buttons (normal, disabled and toggle) even when there is no visible 1010 * all buttons (normal, disabled and toggle) even when there is no visible
1011 * change in buttons (i.e., buttons do not raise when mouse enters). 1011 * change in buttons (i.e., buttons do not raise when mouse enters).
1012 */ 1012 */
1013 void highlighted(int id ); 1013 void highlighted(int id );
1014 1014
1015 /** 1015 /**
1016 * Emitted when toolbar changes position, or when 1016 * Emitted when toolbar changes position, or when
1017 * an item is removed from toolbar. 1017 * an item is removed from toolbar.
1018 * 1018 *
1019 * If you subclass @ref KMainWindow and reimplement 1019 * If you subclass @ref KMainWindow and reimplement
1020 * @ref KMainWindow::resizeEvent() be sure to connect to 1020 * @ref KMainWindow::resizeEvent() be sure to connect to
1021 * this signal. Note: You can connect this signal to a slot that 1021 * this signal. Note: You can connect this signal to a slot that
1022 * doesn't take parameter. 1022 * doesn't take parameter.
1023 */ 1023 */
1024 void moved( BarPosition ); 1024 void moved( BarPosition );
1025 1025
1026 /** 1026 /**
1027 * @internal 1027 * @internal
1028 * This signal is emitted when toolbar detects changing of 1028 * This signal is emitted when toolbar detects changing of
1029 * following parameters: 1029 * following parameters:
1030 * highlighting, button-size, button-mode. This signal is 1030 * highlighting, button-size, button-mode. This signal is
1031 * internal, aimed to buttons. 1031 * internal, aimed to buttons.
1032 */ 1032 */
1033 void modechange (); 1033 void modechange ();
1034 1034
1035 /** 1035 /**
1036 * This signal is emitted when the toolbar is getting deleted, 1036 * This signal is emitted when the toolbar is getting deleted,
1037 * and before ~KToolbar finishes (so it's still time to remove 1037 * and before ~KToolbar finishes (so it's still time to remove
1038 * widgets from the toolbar). 1038 * widgets from the toolbar).
1039 * Used by KWidgetAction. 1039 * Used by KWidgetAction.
1040 * @since 3.2 1040 * @since 3.2
1041 */ 1041 */
1042 void toolbarDestroyed(); 1042 void toolbarDestroyed();
1043 1043
1044public: 1044public:
1045 /** 1045 /**
1046 * @return global setting for "Highlight buttons under mouse" 1046 * @return global setting for "Highlight buttons under mouse"
1047 */ 1047 */
1048 void repaintMe();
1048 static bool highlightSetting(); 1049 static bool highlightSetting();
1049 1050
1050 /** 1051 /**
1051 * @return global setting for "Toolbars transparent when moving" 1052 * @return global setting for "Toolbars transparent when moving"
1052 */ 1053 */
1053 static bool transparentSetting(); 1054 static bool transparentSetting();
1054 1055
1055 /** 1056 /**
1056 * @return global setting for "Icon Text" 1057 * @return global setting for "Icon Text"
1057 */ 1058 */
1058 static IconText iconTextSetting(); 1059 static IconText iconTextSetting();
1059 1060
1060public slots: 1061public slots:
1061 virtual void setIconText( const QString &txt ) 1062 virtual void setIconText( const QString &txt )
1062 { QToolBar::setIconText( txt ); } 1063 { QToolBar::setIconText( txt ); }
1064 void slotRepaint();
1063 1065
1064protected: 1066protected:
1065 void mousePressEvent( QMouseEvent * ); 1067 void mousePressEvent( QMouseEvent * );
1066 void childEvent( QChildEvent *e ); 1068 void childEvent( QChildEvent *e );
1067 void showEvent( QShowEvent *e ); 1069 void showEvent( QShowEvent *e );
1068 void resizeEvent( QResizeEvent *e ); 1070 void resizeEvent( QResizeEvent *e );
1069 bool event( QEvent *e ); 1071 bool event( QEvent *e );
1070 void applyAppearanceSettings(KConfig *config, const QString &_configGroup, bool forceGlobal = false); 1072 void applyAppearanceSettings(KConfig *config, const QString &_configGroup, bool forceGlobal = false);
1071 QString settingsGroup(); 1073 QString settingsGroup();
1072 1074
1073private slots: 1075private slots:
1074 void rebuildLayout(); 1076 void rebuildLayout();
1075 void slotReadConfig (); 1077 void slotReadConfig ();
1076 void slotAppearanceChanged(); 1078 void slotAppearanceChanged();
1077 void slotIconChanged(int); 1079 void slotIconChanged(int);
1078 void slotRepaint();
1079 void toolBarPosChanged( QToolBar *tb ); 1080 void toolBarPosChanged( QToolBar *tb );
1080 void slotContextAboutToShow(); 1081 void slotContextAboutToShow();
1081 void widgetDestroyed(); 1082 void widgetDestroyed();
1082 1083
1083private: 1084private:
1084 void init( bool readConfig = true, bool honorStyle = false ); 1085 void init( bool readConfig = true, bool honorStyle = false );
1085 void doConnections( KToolBarButton *button ); 1086 void doConnections( KToolBarButton *button );
1086 void insertWidgetInternal( QWidget *w, int &index, int id ); 1087 void insertWidgetInternal( QWidget *w, int &index, int id );
1087 void removeWidgetInternal( QWidget *w ); 1088 void removeWidgetInternal( QWidget *w );
1088 void getAttributes( QString &position, QString &icontext, int &index ); 1089 void getAttributes( QString &position, QString &icontext, int &index );
1089//US KPopupMenu *contextMenu(); 1090//US KPopupMenu *contextMenu();
1090 QPopupMenu *contextMenu(); 1091 QPopupMenu *contextMenu();
1091 1092
1092 QMap<QWidget*, int > widget2id; 1093 QMap<QWidget*, int > widget2id;
1093 typedef QMap<int, QWidget* > Id2WidgetMap; 1094 typedef QMap<int, QWidget* > Id2WidgetMap;
1094 Id2WidgetMap id2widget; 1095 Id2WidgetMap id2widget;
1095//US KPopupMenu *context; 1096//US KPopupMenu *context;
1096 QPopupMenu *context; 1097 QPopupMenu *context;
1097 QPtrList<QWidget> widgets; 1098 QPtrList<QWidget> widgets;
1098 QTimer *layoutTimer; 1099 QTimer *layoutTimer;
1099 QGuardedPtr<QWidget> stretchableWidget, rightAligned; 1100 QGuardedPtr<QWidget> stretchableWidget, rightAligned;
1100protected: 1101protected:
1101 virtual void virtual_hook( int id, void* data ); 1102 virtual void virtual_hook( int id, void* data );
1102private: 1103private:
1103 KToolBarPrivate *d; 1104 KToolBarPrivate *d;
1104 bool inshutdownprocess; 1105 bool inshutdownprocess;
1105}; 1106};
1106 1107
1107#endif 1108#endif