author | drw <drw> | 2005-02-25 21:43:00 (UTC) |
---|---|---|
committer | drw <drw> | 2005-02-25 21:43:00 (UTC) |
commit | f2f2b0bc7f8fbb0ecbfd7548b7a29618cc5a9139 (patch) (unidiff) | |
tree | 8dfef7af3cd038b3a27570e64234388c8c563884 /libopie2/opieui/otabinfo.h | |
parent | 8cddb795296ddc1f9bd3203a9441c555a565f476 (diff) | |
download | opie-f2f2b0bc7f8fbb0ecbfd7548b7a29618cc5a9139.zip opie-f2f2b0bc7f8fbb0ecbfd7548b7a29618cc5a9139.tar.gz opie-f2f2b0bc7f8fbb0ecbfd7548b7a29618cc5a9139.tar.bz2 |
Reworked OTabWidget - optimized (now uses less runtime resources), fix display issue where tabbar appears to float a few pixels above where it should
-rw-r--r-- | libopie2/opieui/otabinfo.h | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/libopie2/opieui/otabinfo.h b/libopie2/opieui/otabinfo.h index d6d5abf..99ff10e 100644 --- a/libopie2/opieui/otabinfo.h +++ b/libopie2/opieui/otabinfo.h | |||
@@ -1,49 +1,49 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | 4 | Copyright (c) 2002 Dan Williams <williamsdr@acm.org> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef OTABINFO_H | 32 | #ifndef OTABINFO_H |
33 | #define OTABINFO_H | 33 | #define OTABINFO_H |
34 | 34 | ||
35 | /* QT */ | 35 | /* QT */ |
36 | #include <qlist.h> | 36 | #include <qlist.h> |
37 | #include <qstring.h> | 37 | #include <qstring.h> |
38 | 38 | ||
39 | class QWidget; | 39 | class QWidget; |
40 | 40 | ||
41 | namespace Opie{ | 41 | namespace Opie{ |
42 | namespace Ui { | 42 | namespace Ui { |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * @class OTabInfo | 45 | * @class OTabInfo |
46 | * @brief The OTabInfo class is used internally by OTabWidget to keep track | 46 | * @brief The OTabInfo class is used internally by OTabWidget to keep track |
47 | * of widgets added to the control. | 47 | * of widgets added to the control. |
48 | * | 48 | * |
49 | * OTabInfo provides the following information about a widget added to an | 49 | * OTabInfo provides the following information about a widget added to an |
@@ -61,48 +61,56 @@ public: | |||
61 | * @fn OTabInfo() | 61 | * @fn OTabInfo() |
62 | * @brief Object constructor. | 62 | * @brief Object constructor. |
63 | */ | 63 | */ |
64 | OTabInfo() : i( -1 ), c( 0 ), p( 0 ), l( QString::null ) {} | 64 | OTabInfo() : i( -1 ), c( 0 ), p( 0 ), l( QString::null ) {} |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * @fn OTabInfo( int id, QWidget *control, const QString &icon, const QString &label ) | 67 | * @fn OTabInfo( int id, QWidget *control, const QString &icon, const QString &label ) |
68 | * @brief Object constructor. | 68 | * @brief Object constructor. |
69 | * | 69 | * |
70 | * @param id TabBar identifier for widget. | 70 | * @param id TabBar identifier for widget. |
71 | * @param control QWidget pointer to widget. | 71 | * @param control QWidget pointer to widget. |
72 | * @param icon QString name of icon file. | 72 | * @param icon QString name of icon file. |
73 | * @param label QString text label for OTabWidget selection control. | 73 | * @param label QString text label for OTabWidget selection control. |
74 | */ | 74 | */ |
75 | OTabInfo( int id, QWidget *control, const QString &icon, const QString &label ) | 75 | OTabInfo( int id, QWidget *control, const QString &icon, const QString &label ) |
76 | : i( id ), c( control ), p( icon ), l( label ) {} | 76 | : i( id ), c( control ), p( icon ), l( label ) {} |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * @fn id()const | 79 | * @fn id()const |
80 | * @brief Returns TabBar ID. | 80 | * @brief Returns TabBar ID. |
81 | */ | 81 | */ |
82 | int id() const { return i; } | 82 | int id() const { return i; } |
83 | 83 | ||
84 | /** | 84 | /** |
85 | * @fn setId( int id ) | ||
86 | * @brief Set Id for tab. | ||
87 | * | ||
88 | * @param id integer tab identifier. | ||
89 | */ | ||
90 | void setId( int id ) { i = id; } | ||
91 | |||
92 | /** | ||
85 | * @fn label()const | 93 | * @fn label()const |
86 | * @brief Returns text label for widget. | 94 | * @brief Returns text label for widget. |
87 | */ | 95 | */ |
88 | const QString &label() const { return l; } | 96 | const QString &label() const { return l; } |
89 | 97 | ||
90 | /** | 98 | /** |
91 | * @fn setLabel( const QString &label ) | 99 | * @fn setLabel( const QString &label ) |
92 | * @brief Set label for tab. | 100 | * @brief Set label for tab. |
93 | * | 101 | * |
94 | * @param label QString text label for OTabWidget selection control. | 102 | * @param label QString text label for OTabWidget selection control. |
95 | */ | 103 | */ |
96 | void setLabel( const QString &label ) { l = label; } | 104 | void setLabel( const QString &label ) { l = label; } |
97 | 105 | ||
98 | /** | 106 | /** |
99 | * @fn control()const | 107 | * @fn control()const |
100 | * @brief Returns pointer to widget. | 108 | * @brief Returns pointer to widget. |
101 | */ | 109 | */ |
102 | QWidget *control() const { return c; } | 110 | QWidget *control() const { return c; } |
103 | 111 | ||
104 | /** | 112 | /** |
105 | * @fn icon()const | 113 | * @fn icon()const |
106 | * @brief Returns name of icon file. | 114 | * @brief Returns name of icon file. |
107 | */ | 115 | */ |
108 | const QString &icon() const { return p; } | 116 | const QString &icon() const { return p; } |