summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/otabwidget.h
Unidiff
Diffstat (limited to 'noncore/settings/sysinfo/otabwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/otabwidget.h54
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
@@ -20,43 +20,75 @@
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
25class QComboBox;
26class QPixmap;
27class QTabBar;
28class QWidgetStack;
24 29
25class TabInfo 30class TabInfo
26{ 31{
27public: 32public:
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
35private: 41private:
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
41typedef QValueList<TabInfo> TabInfoList; 48typedef QValueList<TabInfo> TabInfoList;
42 49
43class OTabWidget : public QTabWidget 50class OTabWidget : public QWidget
44{ 51{
45 Q_OBJECT 52 Q_OBJECT
46public: 53public:
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
69protected:
70 void resizeEvent( QResizeEvent * );
51 71
52private: 72private:
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
58private slots: 89private slots:
59 void tabChangedSlot( QWidget * ); 90 void slotTabBarSelected( int );
91 void slotTabListSelected( int );
60}; 92};
61 93
62#endif 94#endif