Diffstat (limited to 'noncore/settings/sysinfo/otabwidget.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/otabwidget.h | 54 |
1 files changed, 43 insertions, 11 deletions
diff --git a/noncore/settings/sysinfo/otabwidget.h b/noncore/settings/sysinfo/otabwidget.h index 4588cb9..38f4d20 100644 --- a/noncore/settings/sysinfo/otabwidget.h +++ b/noncore/settings/sysinfo/otabwidget.h | |||
@@ -17,46 +17,78 @@ | |||
17 | ** | 17 | ** |
18 | **********************************************************************/ | 18 | **********************************************************************/ |
19 | 19 | ||
20 | #ifndef OTABWIDGET_H | 20 | #ifndef OTABWIDGET_H |
21 | #define OTABWIDGET_H | 21 | #define OTABWIDGET_H |
22 | 22 | ||
23 | #include <qtabwidget.h> | 23 | #include <qwidget.h> |
24 | |||
25 | class QComboBox; | ||
26 | class QPixmap; | ||
27 | class QTabBar; | ||
28 | class QWidgetStack; | ||
24 | 29 | ||
25 | class TabInfo | 30 | class TabInfo |
26 | { | 31 | { |
27 | public: | 32 | public: |
28 | TabInfo() : c( 0 ), i( 0 ), l( QString::null ) {} | 33 | TabInfo() : i( -1 ), c( 0 ), p( 0 ), l( QString::null ) {} |
29 | TabInfo( QWidget *control, const QString &icon, const QString &label ) | 34 | TabInfo( int id, QWidget *control, const QString &icon, const QString &label ) |
30 | : c( control ), i( icon ), l( label ) {} | 35 | : i( id ), c( control ), p( icon ), l( label ) {} |
36 | int id() const { return i; } | ||
31 | QString label() const { return l; } | 37 | QString label() const { return l; } |
32 | QWidget *control() const { return c; } | 38 | QWidget *control() const { return c; } |
33 | QString icon() const { return i; } | 39 | QString icon() const { return p; } |
34 | 40 | ||
35 | private: | 41 | private: |
42 | int i; | ||
36 | QWidget *c; | 43 | QWidget *c; |
37 | QString i; | 44 | QString p; |
38 | QString l; | 45 | QString l; |
39 | }; | 46 | }; |
40 | 47 | ||
41 | typedef QValueList<TabInfo> TabInfoList; | 48 | typedef QValueList<TabInfo> TabInfoList; |
42 | 49 | ||
43 | class OTabWidget : public QTabWidget | 50 | class OTabWidget : public QWidget |
44 | { | 51 | { |
45 | Q_OBJECT | 52 | Q_OBJECT |
46 | public: | 53 | public: |
47 | OTabWidget( QWidget *, const char * ); | 54 | enum TabStyle { Global, TextTab, IconTab, TextList, IconList }; |
55 | TabStyle tabStyle() const; | ||
56 | void setTabStyle( TabStyle ); | ||
57 | |||
58 | enum TabPosition { Top, Bottom }; | ||
59 | TabPosition tabPosition() const; | ||
60 | void setTabPosition( TabPosition ); | ||
61 | |||
62 | OTabWidget( QWidget *, const char *, TabStyle, TabPosition ); | ||
48 | ~OTabWidget(); | 63 | ~OTabWidget(); |
49 | 64 | ||
50 | void addTab( QWidget *, const QString &, const QString & ); | 65 | void addTab( QWidget *, const QString &, const QString & ); |
66 | QSize sizeHint() const; | ||
67 | |||
68 | |||
69 | protected: | ||
70 | void resizeEvent( QResizeEvent * ); | ||
51 | 71 | ||
52 | private: | 72 | private: |
53 | TabInfoList Tabs; | 73 | TabInfoList tabs; |
54 | TabInfoList::Iterator CurrentTab; | 74 | TabInfoList::Iterator currentTab; |
75 | |||
76 | TabStyle tabBarStyle; | ||
77 | TabPosition tabBarPosition; | ||
78 | |||
79 | QWidgetStack *tabBarStack; | ||
80 | QTabBar *tabBar; | ||
81 | QComboBox *tabList; | ||
82 | |||
83 | QWidgetStack *widgetStack; | ||
55 | 84 | ||
56 | QPixmap loadSmooth( const QString & ); | 85 | QPixmap loadSmooth( const QString & ); |
86 | void selectTab( TabInfoList::Iterator ); | ||
87 | void setUpLayout( bool ); | ||
57 | 88 | ||
58 | private slots: | 89 | private slots: |
59 | void tabChangedSlot( QWidget * ); | 90 | void slotTabBarSelected( int ); |
91 | void slotTabListSelected( int ); | ||
60 | }; | 92 | }; |
61 | 93 | ||
62 | #endif | 94 | #endif |