summaryrefslogtreecommitdiff
path: root/libopie/otabbar.cpp
Unidiff
Diffstat (limited to 'libopie/otabbar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/otabbar.cpp81
1 files changed, 0 insertions, 81 deletions
diff --git a/libopie/otabbar.cpp b/libopie/otabbar.cpp
deleted file mode 100644
index 52621ca..0000000
--- a/libopie/otabbar.cpp
+++ b/dev/null
@@ -1,81 +0,0 @@
1/*
2                This file is part of the Opie Project
3
4              Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29
30*/
31
32#include "otabbar.h"
33
34OTabBar::OTabBar( QWidget *parent , const char *name )
35 : QTabBar( parent, name )
36{
37}
38
39void OTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const
40{
41
42 QRect r = br;
43 if ( t->iconset)
44 {
45 QIconSet::Mode mode = (t->enabled && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled;
46 if ( mode == QIconSet::Normal && has_focus ) {
47 mode = QIconSet::Active;
48 }
49 QPixmap pixmap = t->iconset->pixmap( QIconSet::Small, mode );
50 int pixw = pixmap.width();
51 int pixh = pixmap.height();
52 r.setLeft( r.left() + pixw + 2 );
53 p->drawPixmap( br.left()+2, br.center().y()-pixh/2, pixmap );
54 }
55
56 QRect tr = r;
57 if ( t->id == currentTab() )
58 {
59 tr.setBottom( tr.bottom() - style().defaultFrameWidth() );
60 }
61
62 if ( t->enabled && isEnabled() )
63 {
64 p->setPen( colorGroup().foreground() );
65 p->drawText( tr, AlignCenter | ShowPrefix, t->label );
66 }
67 else if ( style() == MotifStyle )
68 {
69 p->setPen( palette().disabled().foreground() );
70 p->drawText( tr, AlignCenter | ShowPrefix, t->label );
71 }
72 else
73 {
74 p->setPen( colorGroup().light() );
75 QRect wr = tr;
76 wr.moveBy( 1, 1 );
77 p->drawText( wr, AlignCenter | ShowPrefix, t->label );
78 p->setPen( palette().disabled().foreground() );
79 p->drawText( tr, AlignCenter | ShowPrefix, t->label );
80 }
81}