author | mickeyl <mickeyl> | 2005-07-03 21:12:13 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-07-03 21:12:13 (UTC) |
commit | 27bee477e2689d9b37d2d4cabce05c8d55295ebd (patch) (unidiff) | |
tree | e1e2406d5e51a36aa8b2e1b747560b77febddac1 | |
parent | 62842736cf871376f947f7b27ebc6f58fbc84fdc (diff) | |
download | opie-27bee477e2689d9b37d2d4cabce05c8d55295ebd.zip opie-27bee477e2689d9b37d2d4cabce05c8d55295ebd.tar.gz opie-27bee477e2689d9b37d2d4cabce05c8d55295ebd.tar.bz2 |
use slightly darker color
-rw-r--r-- | libopie2/opieui/olistview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opieui/olistview.cpp b/libopie2/opieui/olistview.cpp index 4386e0e..a5cf6f3 100644 --- a/libopie2/opieui/olistview.cpp +++ b/libopie2/opieui/olistview.cpp | |||
@@ -1,150 +1,150 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | =. (C) 2003-2004 Michael 'Mickey' Lauer <mickey@Vanille.de> | 3 | =. (C) 2003-2004 Michael 'Mickey' Lauer <mickey@Vanille.de> |
4 | .=l. | 4 | .=l. |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This program is free software; you can | 6 | _;:, .> :=|. This program is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
11 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This program is distributed in the hope that | 13 | .i_,=:_. -<s. This program is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
18 | ..}^=.= = ; Library General Public License for more | 18 | ..}^=.= = ; Library General Public License for more |
19 | ++= -. .` .: details. | 19 | ++= -. .` .: details. |
20 | : = ...= . :.=- | 20 | : = ...= . :.=- |
21 | -. .:....=;==+<; You should have received a copy of the GNU | 21 | -. .:....=;==+<; You should have received a copy of the GNU |
22 | -_. . . )=. = Library General Public License along with | 22 | -_. . . )=. = Library General Public License along with |
23 | -- :-=` this library; see the file COPYING.LIB. | 23 | -- :-=` this library; see the file COPYING.LIB. |
24 | If not, write to the Free Software Foundation, | 24 | If not, write to the Free Software Foundation, |
25 | Inc., 59 Temple Place - Suite 330, | 25 | Inc., 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | /* QT */ | 30 | /* QT */ |
31 | 31 | ||
32 | #include <qpixmap.h> | 32 | #include <qpixmap.h> |
33 | 33 | ||
34 | /* OPIE */ | 34 | /* OPIE */ |
35 | 35 | ||
36 | #include <opie2/odebug.h> | 36 | #include <opie2/odebug.h> |
37 | #include <opie2/olistview.h> | 37 | #include <opie2/olistview.h> |
38 | 38 | ||
39 | using namespace Opie::Core; | 39 | using namespace Opie::Core; |
40 | 40 | ||
41 | 41 | ||
42 | namespace Opie { | 42 | namespace Opie { |
43 | namespace Ui { | 43 | namespace Ui { |
44 | /*====================================================================================== | 44 | /*====================================================================================== |
45 | * OListView | 45 | * OListView |
46 | *======================================================================================*/ | 46 | *======================================================================================*/ |
47 | 47 | ||
48 | OListView::OListView( QWidget *parent, const char *name, WFlags fl ) | 48 | OListView::OListView( QWidget *parent, const char *name, WFlags fl ) |
49 | :QListView( parent, name, fl ) | 49 | :QListView( parent, name, fl ) |
50 | { | 50 | { |
51 | //FIXME: get from global settings and calculate ==> see oglobalsettings.* | 51 | //FIXME: get from global settings and calculate ==> see oglobalsettings.* |
52 | 52 | ||
53 | m_alternateBackground = QColor( 238, 246, 255 ); | 53 | m_alternateBackground = QColor( 228, 236, 245 ); |
54 | m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine ); | 54 | m_columnSeparator = QPen( QColor( 50, 60, 70 ), 0, DotLine ); |
55 | m_fullWidth = true; | 55 | m_fullWidth = true; |
56 | connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); | 56 | connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); |
57 | } | 57 | } |
58 | 58 | ||
59 | OListView::~OListView() | 59 | OListView::~OListView() |
60 | { | 60 | { |
61 | } | 61 | } |
62 | 62 | ||
63 | void OListView::setFullWidth( bool fullWidth ) | 63 | void OListView::setFullWidth( bool fullWidth ) |
64 | { | 64 | { |
65 | m_fullWidth = fullWidth; | 65 | m_fullWidth = fullWidth; |
66 | #if QT_VERSION >= 0x030000 | 66 | #if QT_VERSION >= 0x030000 |
67 | header()->setStretchEnabled( fullWidth, columns()-1 ); | 67 | header()->setStretchEnabled( fullWidth, columns()-1 ); |
68 | #endif | 68 | #endif |
69 | } | 69 | } |
70 | 70 | ||
71 | bool OListView::fullWidth() const | 71 | bool OListView::fullWidth() const |
72 | { | 72 | { |
73 | return m_fullWidth; | 73 | return m_fullWidth; |
74 | } | 74 | } |
75 | 75 | ||
76 | int OListView::addColumn( const QString& label, int width ) | 76 | int OListView::addColumn( const QString& label, int width ) |
77 | { | 77 | { |
78 | int result = QListView::addColumn( label, width ); | 78 | int result = QListView::addColumn( label, width ); |
79 | #if QT_VERSION >= 0x030000 | 79 | #if QT_VERSION >= 0x030000 |
80 | if (m_fullWidth) { | 80 | if (m_fullWidth) { |
81 | header()->setStretchEnabled( false, columns()-2 ); | 81 | header()->setStretchEnabled( false, columns()-2 ); |
82 | header()->setStretchEnabled( true, columns()-1 ); | 82 | header()->setStretchEnabled( true, columns()-1 ); |
83 | } | 83 | } |
84 | #endif | 84 | #endif |
85 | return result; | 85 | return result; |
86 | } | 86 | } |
87 | 87 | ||
88 | int OListView::addColumn( const QIconSet& iconset, const QString& label, int width ) | 88 | int OListView::addColumn( const QIconSet& iconset, const QString& label, int width ) |
89 | { | 89 | { |
90 | int result = QListView::addColumn( iconset, label, width ); | 90 | int result = QListView::addColumn( iconset, label, width ); |
91 | #if QT_VERSION >= 0x030000 | 91 | #if QT_VERSION >= 0x030000 |
92 | if (m_fullWidth) { | 92 | if (m_fullWidth) { |
93 | header()->setStretchEnabled( false, columns()-2 ); | 93 | header()->setStretchEnabled( false, columns()-2 ); |
94 | header()->setStretchEnabled( true, columns()-1 ); | 94 | header()->setStretchEnabled( true, columns()-1 ); |
95 | } | 95 | } |
96 | #endif | 96 | #endif |
97 | return result; | 97 | return result; |
98 | } | 98 | } |
99 | 99 | ||
100 | void OListView::removeColumn( int index ) | 100 | void OListView::removeColumn( int index ) |
101 | { | 101 | { |
102 | QListView::removeColumn(index); | 102 | QListView::removeColumn(index); |
103 | #if QT_VERSION >= 0x030000 | 103 | #if QT_VERSION >= 0x030000 |
104 | if ( m_fullWidth && index == columns() ) | 104 | if ( m_fullWidth && index == columns() ) |
105 | { | 105 | { |
106 | header()->setStretchEnabled( true, columns()-1 ); | 106 | header()->setStretchEnabled( true, columns()-1 ); |
107 | } | 107 | } |
108 | #endif | 108 | #endif |
109 | } | 109 | } |
110 | 110 | ||
111 | const QColor& OListView::alternateBackground() const | 111 | const QColor& OListView::alternateBackground() const |
112 | { | 112 | { |
113 | return m_alternateBackground; | 113 | return m_alternateBackground; |
114 | } | 114 | } |
115 | 115 | ||
116 | void OListView::setAlternateBackground( const QColor &c ) | 116 | void OListView::setAlternateBackground( const QColor &c ) |
117 | { | 117 | { |
118 | m_alternateBackground = c; | 118 | m_alternateBackground = c; |
119 | repaint(); | 119 | repaint(); |
120 | } | 120 | } |
121 | 121 | ||
122 | const QPen& OListView::columnSeparator() const | 122 | const QPen& OListView::columnSeparator() const |
123 | { | 123 | { |
124 | return m_columnSeparator; | 124 | return m_columnSeparator; |
125 | } | 125 | } |
126 | 126 | ||
127 | void OListView::setColumnSeparator( const QPen& p ) | 127 | void OListView::setColumnSeparator( const QPen& p ) |
128 | { | 128 | { |
129 | m_columnSeparator = p; | 129 | m_columnSeparator = p; |
130 | repaint(); | 130 | repaint(); |
131 | } | 131 | } |
132 | 132 | ||
133 | void OListView::expand(QListViewItem *item) | 133 | void OListView::expand(QListViewItem *item) |
134 | { | 134 | { |
135 | ((OListViewItem*)item)->expand(); | 135 | ((OListViewItem*)item)->expand(); |
136 | } | 136 | } |
137 | 137 | ||
138 | OListViewItem* OListView::childFactory() | 138 | OListViewItem* OListView::childFactory() |
139 | { | 139 | { |
140 | return new OListViewItem( this ); | 140 | return new OListViewItem( this ); |
141 | } | 141 | } |
142 | 142 | ||
143 | #ifndef QT_NO_DATASTREAM | 143 | #ifndef QT_NO_DATASTREAM |
144 | void OListView::serializeTo( QDataStream& s ) const | 144 | void OListView::serializeTo( QDataStream& s ) const |
145 | { | 145 | { |
146 | #warning Caution... the binary format is still under construction... | 146 | #warning Caution... the binary format is still under construction... |
147 | odebug << "storing OListView..." << oendl; | 147 | odebug << "storing OListView..." << oendl; |
148 | 148 | ||
149 | // store number of columns and the labels | 149 | // store number of columns and the labels |
150 | s << columns(); | 150 | s << columns(); |