author | drw <drw> | 2002-12-05 17:13:45 (UTC) |
---|---|---|
committer | drw <drw> | 2002-12-05 17:13:45 (UTC) |
commit | 675ab68194cc25793a18fd9e495958a90aaf0173 (patch) (unidiff) | |
tree | e2599a7dbef3184f015593f0b7ffe533c45a5ba5 | |
parent | 1eb333726ccf7c608b9f987aac1a04d37d35936c (diff) | |
download | opie-675ab68194cc25793a18fd9e495958a90aaf0173.zip opie-675ab68194cc25793a18fd9e495958a90aaf0173.tar.gz opie-675ab68194cc25793a18fd9e495958a90aaf0173.tar.bz2 |
Modified OColorButton to pass color to color dialog. Impacts appearance, launcher settings and liquid settings.
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 64 | ||||
-rw-r--r-- | libopie/ocolorbutton.cpp | 20 | ||||
-rw-r--r-- | libopie/ocolorbutton.h | 14 | ||||
-rw-r--r-- | noncore/settings/appearance2/editScheme.cpp | 7 | ||||
-rw-r--r-- | noncore/styles/liquid/liquidset.cpp | 20 |
5 files changed, 61 insertions, 64 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index 5981d0b..4c9942f 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp | |||
@@ -104,5 +104,5 @@ public: | |||
104 | { | 104 | { |
105 | viewport ( )-> setUpdatesEnabled ( false ); | 105 | viewport ( )-> setUpdatesEnabled ( false ); |
106 | 106 | ||
107 | switch ( m ) { | 107 | switch ( m ) { |
108 | case TabConfig::List: | 108 | case TabConfig::List: |
@@ -183,5 +183,5 @@ public: | |||
183 | setFont ( f ); | 183 | setFont ( f ); |
184 | } | 184 | } |
185 | 185 | ||
186 | void setItemTextPos ( ItemTextPos pos ) | 186 | void setItemTextPos ( ItemTextPos pos ) |
187 | { | 187 | { |
@@ -244,5 +244,5 @@ public: | |||
244 | m_bgcolor = c; | 244 | m_bgcolor = c; |
245 | } | 245 | } |
246 | 246 | ||
247 | void drawBackground ( QPainter *p, const QRect &r ) | 247 | void drawBackground ( QPainter *p, const QRect &r ) |
248 | { | 248 | { |
@@ -264,37 +264,37 @@ private: | |||
264 | 264 | ||
265 | 265 | ||
266 | TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &tc, QWidget *parent, const char *dname, bool modal, WFlags fl ) | 266 | TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &tc, QWidget *parent, const char *dname, bool modal, WFlags fl ) |
267 | : QDialog ( parent, dname, modal, fl | WStyle_ContextHelp ), m_tc ( tc ) | 267 | : QDialog ( parent, dname, modal, fl | WStyle_ContextHelp ), m_tc ( tc ) |
268 | { | 268 | { |
269 | setCaption ( tr( "Edit Tab" )); | 269 | setCaption ( tr( "Edit Tab" )); |
270 | 270 | ||
271 | QVBoxLayout *lay = new QVBoxLayout ( this, 3, 3 ); | 271 | QVBoxLayout *lay = new QVBoxLayout ( this, 3, 3 ); |
272 | 272 | ||
273 | OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); | 273 | OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); |
274 | QWidget *bgtab; | 274 | QWidget *bgtab; |
275 | 275 | ||
276 | tw-> addTab ( bgtab = createBgTab ( tw ), "appearance/backgroundtabicon.png", tr( "Background" )); | 276 | tw-> addTab ( bgtab = createBgTab ( tw ), "appearance/backgroundtabicon.png", tr( "Background" )); |
277 | tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); | 277 | tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); |
278 | tw-> addTab ( createIconTab ( tw ), "appearance/colorstabicon.png", tr( "Icons" ) ); | 278 | tw-> addTab ( createIconTab ( tw ), "appearance/colorstabicon.png", tr( "Icons" ) ); |
279 | 279 | ||
280 | tw-> setCurrentTab ( bgtab ); | 280 | tw-> setCurrentTab ( bgtab ); |
281 | 281 | ||
282 | QWidget *sample = new QVBox ( this ); | 282 | QWidget *sample = new QVBox ( this ); |
283 | QTabBar *tb = new QTabBar ( sample ); | 283 | QTabBar *tb = new QTabBar ( sample ); |
284 | QString name ( tr( "Previewing %1" ). arg ( tabname )); | 284 | QString name ( tr( "Previewing %1" ). arg ( tabname )); |
285 | 285 | ||
286 | tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name )); | 286 | tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name )); |
287 | 287 | ||
288 | m_sample = new SampleView ( sample ); | 288 | m_sample = new SampleView ( sample ); |
289 | 289 | ||
290 | lay-> addWidget ( tw, 10 ); | 290 | lay-> addWidget ( tw, 10 ); |
291 | lay-> addWidget ( sample, 1 ); | 291 | lay-> addWidget ( sample, 1 ); |
292 | 292 | ||
293 | m_iconsize-> setButton ( tc. m_view ); | 293 | m_iconsize-> setButton ( tc. m_view ); |
294 | iconSizeClicked ( tc. m_view ); | 294 | iconSizeClicked ( tc. m_view ); |
295 | m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); | 295 | //m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); |
296 | iconColorClicked ( m_iconcolor-> color ( )); | 296 | iconColorClicked ( m_iconcolor-> color ( )); |
297 | m_bgtype-> setButton ( tc. m_bg_type ); | 297 | m_bgtype-> setButton ( tc. m_bg_type ); |
298 | m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); | 298 | //m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); |
299 | m_bgimage = tc. m_bg_image; | 299 | m_bgimage = tc. m_bg_image; |
300 | bgTypeClicked ( tc. m_bg_type ); | 300 | bgTypeClicked ( tc. m_bg_type ); |
@@ -320,12 +320,12 @@ QWidget *TabDialog::createFontTab ( QWidget *parent ) | |||
320 | vertLayout-> addWidget ( m_fontuse ); | 320 | vertLayout-> addWidget ( m_fontuse ); |
321 | 321 | ||
322 | m_fontselect = new OFontSelector ( false, tab, "fontsel" ); | 322 | m_fontselect = new OFontSelector ( false, tab, "fontsel" ); |
323 | vertLayout-> addWidget ( m_fontselect ); | 323 | vertLayout-> addWidget ( m_fontselect ); |
324 | 324 | ||
325 | connect ( m_fontuse, SIGNAL( toggled ( bool )), m_fontselect, SLOT( setEnabled ( bool ))); | 325 | connect ( m_fontuse, SIGNAL( toggled ( bool )), m_fontselect, SLOT( setEnabled ( bool ))); |
326 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), | 326 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), |
327 | this, SLOT( fontClicked ( const QFont & ))); | 327 | this, SLOT( fontClicked ( const QFont & ))); |
328 | 328 | ||
329 | return tab; | 329 | return tab; |
330 | } | 330 | } |
331 | 331 | ||
@@ -334,5 +334,5 @@ QWidget *TabDialog::createBgTab ( QWidget *parent ) | |||
334 | QWidget *tab = new QWidget( parent, "BgTab" ); | 334 | QWidget *tab = new QWidget( parent, "BgTab" ); |
335 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); | 335 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); |
336 | 336 | ||
337 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 337 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
338 | gridLayout-> setColStretch ( 1, 10 ); | 338 | gridLayout-> setColStretch ( 1, 10 ); |
@@ -353,9 +353,9 @@ QWidget *TabDialog::createBgTab ( QWidget *parent ) | |||
353 | 353 | ||
354 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); | 354 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); |
355 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); | 355 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); |
356 | hb-> addWidget ( rb ); | 356 | hb-> addWidget ( rb ); |
357 | hb-> addSpacing ( 10 ); | 357 | hb-> addSpacing ( 10 ); |
358 | 358 | ||
359 | m_solidcolor = new OColorButton ( tab ); | 359 | m_solidcolor = new OColorButton ( tab, QColor ( m_tc. m_bg_color ) ); |
360 | connect ( m_solidcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( bgColorClicked ( const QColor & ))); | 360 | connect ( m_solidcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( bgColorClicked ( const QColor & ))); |
361 | hb-> addWidget ( m_solidcolor ); | 361 | hb-> addWidget ( m_solidcolor ); |
@@ -366,10 +366,10 @@ QWidget *TabDialog::createBgTab ( QWidget *parent ) | |||
366 | hb = new QHBoxLayout ( ); | 366 | hb = new QHBoxLayout ( ); |
367 | hb-> setSpacing ( 3 ); | 367 | hb-> setSpacing ( 3 ); |
368 | 368 | ||
369 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); | 369 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); |
370 | m_bgtype-> insert ( rb, TabConfig::Image ); | 370 | m_bgtype-> insert ( rb, TabConfig::Image ); |
371 | hb-> addWidget( rb ); | 371 | hb-> addWidget( rb ); |
372 | hb-> addSpacing ( 10 ); | 372 | hb-> addSpacing ( 10 ); |
373 | 373 | ||
374 | m_imagebrowse = new QPushButton ( tr( "Select..." ), tab ); | 374 | m_imagebrowse = new QPushButton ( tr( "Select..." ), tab ); |
375 | connect ( m_imagebrowse, SIGNAL( clicked ( )), this, SLOT( bgImageClicked ( ))); | 375 | connect ( m_imagebrowse, SIGNAL( clicked ( )), this, SLOT( bgImageClicked ( ))); |
@@ -408,5 +408,5 @@ QWidget *TabDialog::createIconTab ( QWidget *parent ) | |||
408 | m_iconsize-> insert ( rb, TabConfig::List ); | 408 | m_iconsize-> insert ( rb, TabConfig::List ); |
409 | gridLayout-> addWidget( rb, 0, 1 ); | 409 | gridLayout-> addWidget( rb, 0, 1 ); |
410 | 410 | ||
411 | rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); | 411 | rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); |
412 | m_iconsize-> insert ( rb, TabConfig::Icon ); | 412 | m_iconsize-> insert ( rb, TabConfig::Icon ); |
@@ -419,11 +419,11 @@ QWidget *TabDialog::createIconTab ( QWidget *parent ) | |||
419 | //gridLayout = new QGridLayout ( vertLayout ); | 419 | //gridLayout = new QGridLayout ( vertLayout ); |
420 | gridLayout-> addRowSpacing ( 2, 8 ); | 420 | gridLayout-> addRowSpacing ( 2, 8 ); |
421 | 421 | ||
422 | label = new QLabel ( tr( "Color:" ), tab ); | 422 | label = new QLabel ( tr( "Color:" ), tab ); |
423 | gridLayout-> addWidget ( label, 3, 0 ); | 423 | gridLayout-> addWidget ( label, 3, 0 ); |
424 | 424 | ||
425 | m_iconcolor = new OColorButton ( tab ); | 425 | m_iconcolor = new OColorButton ( tab, QColor ( m_tc. m_text_color ) ); |
426 | connect ( m_iconcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( iconColorClicked ( const QColor & ))); | 426 | connect ( m_iconcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( iconColorClicked ( const QColor & ))); |
427 | gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); | 427 | gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); |
428 | 428 | ||
429 | vertLayout-> addStretch ( 10 ); | 429 | vertLayout-> addStretch ( 10 ); |
diff --git a/libopie/ocolorbutton.cpp b/libopie/ocolorbutton.cpp index 4734c0c..ddb6c4f 100644 --- a/libopie/ocolorbutton.cpp +++ b/libopie/ocolorbutton.cpp | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <qpixmap.h> | 32 | #include <qpixmap.h> |
33 | #include <qimage.h> | 33 | #include <qimage.h> |
34 | 34 | ||
35 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
36 | 36 | ||
37 | class OColorButtonPrivate { | 37 | class OColorButtonPrivate { |
38 | public: | 38 | public: |
@@ -41,19 +41,19 @@ public: | |||
41 | }; | 41 | }; |
42 | 42 | ||
43 | OColorButton::OColorButton ( QWidget *parent, const char *name ) | 43 | OColorButton::OColorButton ( QWidget *parent, const QColor &color, const char *name ) |
44 | : QPushButton ( parent, name ) | 44 | : QPushButton ( parent, name ) |
45 | { | 45 | { |
46 | d = new OColorButtonPrivate; | 46 | d = new OColorButtonPrivate; |
47 | 47 | ||
48 | d-> m_menu = new ColorPopupMenu ( black, 0, 0 ); | 48 | d-> m_menu = new ColorPopupMenu ( color, 0, 0 ); |
49 | setPopup ( d-> m_menu ); | 49 | setPopup ( d-> m_menu ); |
50 | //setPopupDelay ( 0 ); | 50 | //setPopupDelay ( 0 ); |
51 | connect ( d-> m_menu, SIGNAL( colorSelected ( const QColor & )), this, SLOT( updateColor ( const QColor & ))); | 51 | connect ( d-> m_menu, SIGNAL( colorSelected ( const QColor & )), this, SLOT( updateColor ( const QColor & ))); |
52 | 52 | ||
53 | updateColor ( black ); | 53 | updateColor ( color ); |
54 | 54 | ||
55 | QSize s = sizeHint ( ) + QSize ( 12, 0 ); | 55 | QSize s = sizeHint ( ) + QSize ( 12, 0 ); |
56 | setMinimumSize ( s ); | 56 | setMinimumSize ( s ); |
57 | setMaximumSize ( s. width ( ) * 2, s. height ( )); | 57 | setMaximumSize ( s. width ( ) * 2, s. height ( )); |
58 | } | 58 | } |
59 | 59 | ||
diff --git a/libopie/ocolorbutton.h b/libopie/ocolorbutton.h index ec04833..fe40fae 100644 --- a/libopie/ocolorbutton.h +++ b/libopie/ocolorbutton.h | |||
@@ -28,6 +28,6 @@ | |||
28 | 28 | ||
29 | #ifndef __OPIE_OCOLORBUTTON_H__ | 29 | #ifndef __OPIE_OCOLORBUTTON_H__ |
30 | #define __OPIE_OCOLORBUTTON_H__ | 30 | #define __OPIE_OCOLORBUTTON_H__ |
31 | 31 | ||
32 | #include <qpushbutton.h> | 32 | #include <qpushbutton.h> |
33 | 33 | ||
@@ -38,12 +38,12 @@ class OColorButton : public QPushButton { | |||
38 | Q_OBJECT | 38 | Q_OBJECT |
39 | public: | 39 | public: |
40 | OColorButton ( QWidget *parent = 0, const char *name = 0 ); | 40 | OColorButton ( QWidget *parent = 0, const QColor & = black, const char *name = 0 ); |
41 | virtual ~OColorButton ( ); | 41 | virtual ~OColorButton ( ); |
42 | 42 | ||
43 | QColor color ( ) const; | 43 | QColor color ( ) const; |
44 | 44 | ||
45 | signals: | 45 | signals: |
46 | void colorSelected ( const QColor & ); | 46 | void colorSelected ( const QColor & ); |
47 | 47 | ||
48 | public slots: | 48 | public slots: |
49 | virtual void setColor ( const QColor & ); | 49 | virtual void setColor ( const QColor & ); |
diff --git a/noncore/settings/appearance2/editScheme.cpp b/noncore/settings/appearance2/editScheme.cpp index c2e5355..eefeccc 100644 --- a/noncore/settings/appearance2/editScheme.cpp +++ b/noncore/settings/appearance2/editScheme.cpp | |||
@@ -47,12 +47,11 @@ EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget | |||
47 | m_buttons = new OColorButton * [cnt]; | 47 | m_buttons = new OColorButton * [cnt]; |
48 | m_colors = colors; | 48 | m_colors = colors; |
49 | 49 | ||
50 | for ( int i = 0; i < cnt; i++ ) | 50 | for ( int i = 0; i < cnt; i++ ) |
51 | { | 51 | { |
52 | QLabel *l = new QLabel ( labels [i], this ); | 52 | QLabel *l = new QLabel ( labels [i], this ); |
53 | layout-> addWidget ( l, i, 0 ); | 53 | layout-> addWidget ( l, i, 0 ); |
54 | 54 | ||
55 | m_buttons [i] = new OColorButton ( this ); | 55 | m_buttons [i] = new OColorButton ( this, colors [i] ); |
56 | m_buttons [i]-> setColor ( colors [i] ); | ||
57 | layout-> addWidget ( m_buttons [i], i, 1 ); | 56 | layout-> addWidget ( m_buttons [i], i, 1 ); |
58 | } | 57 | } |
diff --git a/noncore/styles/liquid/liquidset.cpp b/noncore/styles/liquid/liquidset.cpp index 255456c..7747da7 100644 --- a/noncore/styles/liquid/liquidset.cpp +++ b/noncore/styles/liquid/liquidset.cpp | |||
@@ -43,5 +43,5 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
43 | { | 43 | { |
44 | setCaption ( tr( "Liquid Style" ) ); | 44 | setCaption ( tr( "Liquid Style" ) ); |
45 | 45 | ||
46 | Config config ( "qpe" ); | 46 | Config config ( "qpe" ); |
47 | config. setGroup ( "Liquid-Style" ); | 47 | config. setGroup ( "Liquid-Style" ); |
@@ -66,23 +66,21 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
66 | cb-> insertItem ( tr( "Translucent stippled, button color" ), TransStippleBtn ); | 66 | cb-> insertItem ( tr( "Translucent stippled, button color" ), TransStippleBtn ); |
67 | cb-> insertItem ( tr( "Custom translucency" ), Custom ); | 67 | cb-> insertItem ( tr( "Custom translucency" ), Custom ); |
68 | 68 | ||
69 | cb-> setCurrentItem ( m_type ); | 69 | cb-> setCurrentItem ( m_type ); |
70 | vbox-> addWidget ( cb ); | 70 | vbox-> addWidget ( cb ); |
71 | 71 | ||
72 | 72 | ||
73 | QGridLayout *grid = new QGridLayout ( vbox ); | 73 | QGridLayout *grid = new QGridLayout ( vbox ); |
74 | grid-> addColSpacing ( 0, 16 ); | 74 | grid-> addColSpacing ( 0, 16 ); |
75 | grid-> addColSpacing ( 3, 8 ); | 75 | grid-> addColSpacing ( 3, 8 ); |
76 | 76 | ||
77 | grid-> addWidget ( m_menulbl = new QLabel ( tr( "Menu color" ), this ), 0, 1 ); | 77 | grid-> addWidget ( m_menulbl = new QLabel ( tr( "Menu color" ), this ), 0, 1 ); |
78 | grid-> addWidget ( m_textlbl = new QLabel ( tr( "Text color" ), this ), 0, 4 ); | 78 | grid-> addWidget ( m_textlbl = new QLabel ( tr( "Text color" ), this ), 0, 4 ); |
79 | grid-> addWidget ( m_opaclbl = new QLabel ( tr( "Opacity" ), this ), 1, 1 ); | 79 | grid-> addWidget ( m_opaclbl = new QLabel ( tr( "Opacity" ), this ), 1, 1 ); |
80 | 80 | ||
81 | m_menubtn = new OColorButton ( this ); | 81 | m_menubtn = new OColorButton ( this, mcol ); |
82 | m_menubtn-> setColor ( mcol ); | ||
83 | grid-> addWidget ( m_menubtn, 0, 2 ); | 82 | grid-> addWidget ( m_menubtn, 0, 2 ); |
84 | 83 | ||
85 | m_textbtn = new OColorButton ( this ); | 84 | m_textbtn = new OColorButton ( this, tcol ); |
86 | m_textbtn-> setColor ( tcol ); | ||
87 | grid-> addWidget ( m_textbtn, 0, 5 ); | 85 | grid-> addWidget ( m_textbtn, 0, 5 ); |
88 | 86 | ||
@@ -93,7 +91,7 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
93 | m_opacsld-> setTickmarks ( QSlider::Below ); | 91 | m_opacsld-> setTickmarks ( QSlider::Below ); |
94 | grid-> addMultiCellWidget ( m_opacsld, 1, 1, 2, 5 ); | 92 | grid-> addMultiCellWidget ( m_opacsld, 1, 1, 2, 5 ); |
95 | 93 | ||
96 | vbox-> addSpacing ( 4 ); | 94 | vbox-> addSpacing ( 4 ); |
97 | 95 | ||
98 | QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed menu text" ), this ); | 96 | QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed menu text" ), this ); |
99 | shadow-> setChecked ( m_shadow ); | 97 | shadow-> setChecked ( m_shadow ); |