Diffstat (limited to 'core/settings/launcher/tabdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index 763b360..546e229 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp | |||
@@ -4,68 +4,70 @@ | |||
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This file is free software; you can | 5 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This file is distributed in the hope that | 12 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Public License for more details. | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: | 18 | ++= -. .` .: |
19 | : = ...= . :.=- You should have received a copy of the GNU | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; General Public License along with this file; | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "tabdialog.h" | ||
29 | |||
30 | /* OPIE */ | ||
28 | #include <qpe/resource.h> | 31 | #include <qpe/resource.h> |
32 | #include <opie2/ofontselector.h> | ||
33 | #include <opie2/otabwidget.h> | ||
34 | #include <opie2/ocolorbutton.h> | ||
35 | #include <opie2/ofiledialog.h> | ||
36 | #include <opie2/odebug.h> | ||
29 | 37 | ||
38 | /* QT */ | ||
30 | #include <qlayout.h> | 39 | #include <qlayout.h> |
31 | #include <qvbox.h> | 40 | #include <qvbox.h> |
32 | #include <qtabbar.h> | 41 | #include <qtabbar.h> |
33 | #include <qiconview.h> | 42 | #include <qiconview.h> |
34 | #include <qapplication.h> | 43 | #include <qapplication.h> |
35 | #include <qlabel.h> | 44 | #include <qlabel.h> |
36 | #include <qradiobutton.h> | 45 | #include <qradiobutton.h> |
37 | #include <qbuttongroup.h> | 46 | #include <qbuttongroup.h> |
38 | #include <qwhatsthis.h> | 47 | #include <qwhatsthis.h> |
39 | #include <qcheckbox.h> | 48 | #include <qcheckbox.h> |
40 | 49 | ||
41 | #include <opie2/ofontselector.h> | ||
42 | #include <opie2/otabwidget.h> | ||
43 | #include <opie2/ocolorbutton.h> | ||
44 | #include <opie2/ofiledialog.h> | ||
45 | |||
46 | #include "tabdialog.h" | ||
47 | |||
48 | 50 | ||
49 | using namespace Opie::Ui; | 51 | using namespace Opie::Ui; |
50 | class SampleItem : public QIconViewItem { | 52 | class SampleItem : public QIconViewItem { |
51 | public: | 53 | public: |
52 | SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) | 54 | SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) |
53 | { | 55 | { |
54 | m_large = pix; | 56 | m_large = pix; |
55 | m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 )); | 57 | m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 )); |
56 | } | 58 | } |
57 | 59 | ||
58 | void sizeChange ( ) | 60 | void sizeChange ( ) |
59 | { | 61 | { |
60 | calcRect ( ); | 62 | calcRect ( ); |
61 | repaint ( ); | 63 | repaint ( ); |
62 | } | 64 | } |
63 | 65 | ||
64 | QPixmap *pixmap ( ) const | 66 | QPixmap *pixmap ( ) const |
65 | { | 67 | { |
66 | if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) | 68 | if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) |
67 | return (QPixmap *) &m_small; | 69 | return (QPixmap *) &m_small; |
68 | else | 70 | else |
69 | return (QPixmap *) &m_large; | 71 | return (QPixmap *) &m_large; |
70 | } | 72 | } |
71 | 73 | ||
@@ -127,49 +129,49 @@ public: | |||
127 | QPixmap bg ( width ( ), 9 ); | 129 | QPixmap bg ( width ( ), 9 ); |
128 | QPainter painter ( &bg ); | 130 | QPainter painter ( &bg ); |
129 | for ( int i = 0; i < 3; i++ ) { | 131 | for ( int i = 0; i < 3; i++ ) { |
130 | painter. setPen ( white ); | 132 | painter. setPen ( white ); |
131 | painter. drawLine ( 0, i*3, width()-1, i*3 ); | 133 | painter. drawLine ( 0, i*3, width()-1, i*3 ); |
132 | painter. drawLine ( 0, i*3+1, width()-1, i*3+1 ); | 134 | painter. drawLine ( 0, i*3+1, width()-1, i*3+1 ); |
133 | painter. setPen ( colorGroup().background().light(105) ); | 135 | painter. setPen ( colorGroup().background().light(105) ); |
134 | painter. drawLine ( 0, i*3+2, width()-1, i*3+2 ); | 136 | painter. drawLine ( 0, i*3+2, width()-1, i*3+2 ); |
135 | } | 137 | } |
136 | painter.end ( ); | 138 | painter.end ( ); |
137 | setBackgroundPixmap ( bg ); | 139 | setBackgroundPixmap ( bg ); |
138 | break; | 140 | break; |
139 | } | 141 | } |
140 | 142 | ||
141 | case TabConfig::SolidColor: { | 143 | case TabConfig::SolidColor: { |
142 | setBackgroundPixmap ( QPixmap ( )); | 144 | setBackgroundPixmap ( QPixmap ( )); |
143 | if ( val. isEmpty ( )) | 145 | if ( val. isEmpty ( )) |
144 | setBackgroundColor ( colorGroup ( ). base ( )); | 146 | setBackgroundColor ( colorGroup ( ). base ( )); |
145 | else | 147 | else |
146 | setBackgroundColor ( val ); | 148 | setBackgroundColor ( val ); |
147 | break; | 149 | break; |
148 | } | 150 | } |
149 | 151 | ||
150 | case TabConfig::Image: { | 152 | case TabConfig::Image: { |
151 | qDebug( "Loading image: %s", val.latin1() ); | 153 | odebug << "Loading image: " << val << "" << oendl; |
152 | QPixmap bg ( Resource::loadPixmap ( "wallpaper/" + val )); | 154 | QPixmap bg ( Resource::loadPixmap ( "wallpaper/" + val )); |
153 | if ( bg. isNull ( )) { | 155 | if ( bg. isNull ( )) { |
154 | QImageIO imgio; | 156 | QImageIO imgio; |
155 | imgio. setFileName ( val ); | 157 | imgio. setFileName ( val ); |
156 | QSize ds = qApp-> desktop ( )-> size ( ); | 158 | QSize ds = qApp-> desktop ( )-> size ( ); |
157 | QString param ( "Scale( %1, %2, ScaleMin )" ); // No tr | 159 | QString param ( "Scale( %1, %2, ScaleMin )" ); // No tr |
158 | imgio. setParameters ( param. arg ( ds. width ( )). arg ( ds. height ( )). latin1 ( )); | 160 | imgio. setParameters ( param. arg ( ds. width ( )). arg ( ds. height ( )). latin1 ( )); |
159 | imgio. read ( ); | 161 | imgio. read ( ); |
160 | bg = imgio. image ( ); | 162 | bg = imgio. image ( ); |
161 | } | 163 | } |
162 | setBackgroundPixmap ( bg ); | 164 | setBackgroundPixmap ( bg ); |
163 | break; | 165 | break; |
164 | } | 166 | } |
165 | } | 167 | } |
166 | m_bgtype = t; | 168 | m_bgtype = t; |
167 | viewport ( )-> update ( ); | 169 | viewport ( )-> update ( ); |
168 | } | 170 | } |
169 | 171 | ||
170 | void setTextColor ( const QColor &tc ) | 172 | void setTextColor ( const QColor &tc ) |
171 | { | 173 | { |
172 | m_textcolor = tc; | 174 | m_textcolor = tc; |
173 | QColorGroup cg = colorGroup ( ); | 175 | QColorGroup cg = colorGroup ( ); |
174 | cg. setColor ( QColorGroup::Text, tc ); | 176 | cg. setColor ( QColorGroup::Text, tc ); |
175 | setPalette ( QPalette ( cg, cg, cg )); | 177 | setPalette ( QPalette ( cg, cg, cg )); |