-rw-r--r-- | libopie/otabbar.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie/otabbar.cpp b/libopie/otabbar.cpp index b5b93ba..52621ca 100644 --- a/libopie/otabbar.cpp +++ b/libopie/otabbar.cpp | |||
@@ -2,65 +2,65 @@ | |||
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 "otabbar.h" | 32 | #include "otabbar.h" |
33 | 33 | ||
34 | OTabBar::OTabBar( QWidget *parent = 0, const char *name = 0 ) | 34 | OTabBar::OTabBar( QWidget *parent , const char *name ) |
35 | : QTabBar( parent, name ) | 35 | : QTabBar( parent, name ) |
36 | { | 36 | { |
37 | } | 37 | } |
38 | 38 | ||
39 | void OTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const | 39 | void OTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const |
40 | { | 40 | { |
41 | 41 | ||
42 | QRect r = br; | 42 | QRect r = br; |
43 | if ( t->iconset) | 43 | if ( t->iconset) |
44 | { | 44 | { |
45 | QIconSet::Mode mode = (t->enabled && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled; | 45 | QIconSet::Mode mode = (t->enabled && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled; |
46 | if ( mode == QIconSet::Normal && has_focus ) { | 46 | if ( mode == QIconSet::Normal && has_focus ) { |
47 | mode = QIconSet::Active; | 47 | mode = QIconSet::Active; |
48 | } | 48 | } |
49 | QPixmap pixmap = t->iconset->pixmap( QIconSet::Small, mode ); | 49 | QPixmap pixmap = t->iconset->pixmap( QIconSet::Small, mode ); |
50 | int pixw = pixmap.width(); | 50 | int pixw = pixmap.width(); |
51 | int pixh = pixmap.height(); | 51 | int pixh = pixmap.height(); |
52 | r.setLeft( r.left() + pixw + 2 ); | 52 | r.setLeft( r.left() + pixw + 2 ); |
53 | p->drawPixmap( br.left()+2, br.center().y()-pixh/2, pixmap ); | 53 | p->drawPixmap( br.left()+2, br.center().y()-pixh/2, pixmap ); |
54 | } | 54 | } |
55 | 55 | ||
56 | QRect tr = r; | 56 | QRect tr = r; |
57 | if ( t->id == currentTab() ) | 57 | if ( t->id == currentTab() ) |
58 | { | 58 | { |
59 | tr.setBottom( tr.bottom() - style().defaultFrameWidth() ); | 59 | tr.setBottom( tr.bottom() - style().defaultFrameWidth() ); |
60 | } | 60 | } |
61 | 61 | ||
62 | if ( t->enabled && isEnabled() ) | 62 | if ( t->enabled && isEnabled() ) |
63 | { | 63 | { |
64 | p->setPen( colorGroup().foreground() ); | 64 | p->setPen( colorGroup().foreground() ); |
65 | p->drawText( tr, AlignCenter | ShowPrefix, t->label ); | 65 | p->drawText( tr, AlignCenter | ShowPrefix, t->label ); |
66 | } | 66 | } |