author | drw <drw> | 2005-04-14 18:30:23 (UTC) |
---|---|---|
committer | drw <drw> | 2005-04-14 18:30:23 (UTC) |
commit | 5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf (patch) (unidiff) | |
tree | d4ba8a948d876db9bbff10cbd282fd16aab91feb /libopie2 | |
parent | 7a3b813cc3bfbb2f7c31f347c35405851e82aecf (diff) | |
download | opie-5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf.zip opie-5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf.tar.gz opie-5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf.tar.bz2 |
More icon sizing updates
-rw-r--r-- | libopie2/opieui/otabbar.cpp | 50 | ||||
-rw-r--r-- | libopie2/opieui/otabbar.h | 46 | ||||
-rw-r--r-- | libopie2/opieui/otabwidget.cpp | 1 |
3 files changed, 50 insertions, 47 deletions
diff --git a/libopie2/opieui/otabbar.cpp b/libopie2/opieui/otabbar.cpp index a62e18b..dc5df42 100644 --- a/libopie2/opieui/otabbar.cpp +++ b/libopie2/opieui/otabbar.cpp | |||
@@ -1,63 +1,67 @@ | |||
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 | #include <opie2/otabbar.h> | 32 | #include <opie2/otabbar.h> |
33 | 33 | ||
34 | #include <qpe/applnk.h> | ||
35 | |||
36 | #include <stdio.h> | ||
37 | |||
34 | using namespace Opie::Ui; | 38 | using namespace Opie::Ui; |
35 | 39 | ||
36 | OTabBar::OTabBar( QWidget *parent , const char *name ) | 40 | OTabBar::OTabBar( QWidget *parent , const char *name ) |
37 | :QTabBar( parent, name ) | 41 | :QTabBar( parent, name ) |
38 | {} | 42 | {} |
39 | 43 | ||
40 | void OTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const | 44 | void OTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const |
41 | { | 45 | { |
42 | 46 | ||
43 | QRect r = br; | 47 | QRect r = br; |
44 | if ( t->iconset) | 48 | if ( t->iconset) |
45 | { | 49 | { |
46 | QIconSet::Mode mode = (t->enabled && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled; | 50 | QIconSet::Mode mode = (t->enabled && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled; |
47 | if ( mode == QIconSet::Normal && has_focus ) | 51 | if ( mode == QIconSet::Normal && has_focus ) |
48 | { | 52 | { |
49 | mode = QIconSet::Active; | 53 | mode = QIconSet::Active; |
50 | } | 54 | } |
51 | QPixmap pixmap = t->iconset->pixmap( QIconSet::Small, mode ); | 55 | QPixmap pixmap = t->iconset->pixmap(); |
52 | int pixw = pixmap.width(); | 56 | int pixw = pixmap.width(); |
53 | int pixh = pixmap.height(); | 57 | int pixh = pixmap.height(); |
54 | r.setLeft( r.left() + pixw + 2 ); | 58 | r.setLeft( r.left() + pixw + 2 ); |
55 | p->drawPixmap( br.left()+2, br.center().y()-pixh/2, pixmap ); | 59 | p->drawPixmap( br.left()+2, br.center().y()-pixh/2, pixmap ); |
56 | } | 60 | } |
57 | 61 | ||
58 | QRect tr = r; | 62 | QRect tr = r; |
59 | if ( t->id == currentTab() ) | 63 | if ( t->id == currentTab() ) |
60 | { | 64 | { |
61 | tr.setBottom( tr.bottom() - style().defaultFrameWidth() ); | 65 | tr.setBottom( tr.bottom() - style().defaultFrameWidth() ); |
62 | } | 66 | } |
63 | 67 | ||
diff --git a/libopie2/opieui/otabbar.h b/libopie2/opieui/otabbar.h index 925ae96..1044bdd 100644 --- a/libopie2/opieui/otabbar.h +++ b/libopie2/opieui/otabbar.h | |||
@@ -1,41 +1,41 @@ | |||
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 OTABBAR_H | 32 | #ifndef OTABBAR_H |
33 | #define OTABBAR_H | 33 | #define OTABBAR_H |
34 | 34 | ||
35 | /* QT */ | 35 | /* QT */ |
36 | #include <qtabbar.h> | 36 | #include <qtabbar.h> |
37 | 37 | ||
38 | namespace Opie { | 38 | namespace Opie { |
39 | namespace Ui { | 39 | namespace Ui { |
40 | 40 | ||
41 | /** | 41 | /** |
diff --git a/libopie2/opieui/otabwidget.cpp b/libopie2/opieui/otabwidget.cpp index 7333f5e..d617a9c 100644 --- a/libopie2/opieui/otabwidget.cpp +++ b/libopie2/opieui/otabwidget.cpp | |||
@@ -25,25 +25,24 @@ | |||
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 | #include <opie2/otabwidget.h> | 31 | #include <opie2/otabwidget.h> |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/oresource.h> | 34 | #include <opie2/oresource.h> |
35 | #include <opie2/otabbar.h> | 35 | #include <opie2/otabbar.h> |
36 | 36 | ||
37 | #include <qpe/applnk.h> | ||
38 | #include <qpe/config.h> | 37 | #include <qpe/config.h> |
39 | 38 | ||
40 | /* QT */ | 39 | /* QT */ |
41 | #include <qcombobox.h> | 40 | #include <qcombobox.h> |
42 | #include <qwidgetstack.h> | 41 | #include <qwidgetstack.h> |
43 | 42 | ||
44 | using namespace Opie::Ui; | 43 | using namespace Opie::Ui; |
45 | 44 | ||
46 | OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPosition p ) | 45 | OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPosition p ) |
47 | : QWidget( parent, name ) | 46 | : QWidget( parent, name ) |
48 | , m_currTab( 0l ) | 47 | , m_currTab( 0l ) |
49 | , m_tabBarStyle( Global ) | 48 | , m_tabBarStyle( Global ) |