-rw-r--r-- | core/settings/launcher/launchersettings.cpp | 9 | ||||
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 82 |
2 files changed, 46 insertions, 45 deletions
diff --git a/core/settings/launcher/launchersettings.cpp b/core/settings/launcher/launchersettings.cpp index 7b85602..cb6e98a 100644 --- a/core/settings/launcher/launchersettings.cpp +++ b/core/settings/launcher/launchersettings.cpp | |||
@@ -1,2 +1,3 @@ | |||
1 | |||
1 | /* | 2 | /* |
2 | =. This file is part of the OPIE Project | 3 | =. This file is part of the OPIE Project |
@@ -16,5 +17,5 @@ | |||
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: | 19 | ++= -. .` .: |
19 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
@@ -50,8 +51,8 @@ LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false, | |||
50 | m_menu = new MenuSettings ( tw ); | 51 | m_menu = new MenuSettings ( tw ); |
51 | 52 | ||
52 | tw-> addTab ( m_taskbar, "launchersettings/taskbartab.png", tr( "Taskbar" )); | 53 | tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" )); |
53 | tw-> addTab ( m_menu, "launchersettings/menutab.png", tr( "O-Menu" )); | 54 | tw-> addTab ( m_menu, "go", tr( "O-Menu" )); |
54 | tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); | 55 | tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); |
55 | 56 | ||
56 | tw-> setCurrentTab ( m_taskbar ); | 57 | tw-> setCurrentTab ( m_taskbar ); |
57 | } | 58 | } |
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index 4c9942f..5f68010 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp | |||
@@ -16,5 +16,5 @@ | |||
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; |
@@ -53,9 +53,9 @@ class SampleItem : public QIconViewItem { | |||
53 | public: | 53 | public: |
54 | 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 ) |
55 | { | 55 | { |
56 | m_large = pix; | 56 | m_large = pix; |
57 | 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 )); |
58 | } | 58 | } |
59 | 59 | ||
60 | void sizeChange ( ) | 60 | void sizeChange ( ) |
61 | { | 61 | { |
@@ -63,13 +63,13 @@ public: | |||
63 | repaint ( ); | 63 | repaint ( ); |
64 | } | 64 | } |
65 | 65 | ||
66 | QPixmap *pixmap ( ) const | 66 | QPixmap *pixmap ( ) const |
67 | { | 67 | { |
68 | if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) | 68 | if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) |
69 | return (QPixmap *) &m_small; | 69 | return (QPixmap *) &m_small; |
70 | else | 70 | else |
71 | return (QPixmap *) &m_large; | 71 | return (QPixmap *) &m_large; |
72 | } | 72 | } |
73 | 73 | ||
74 | private: | 74 | private: |
75 | QPixmap m_large, m_small; | 75 | QPixmap m_large, m_small; |
@@ -92,12 +92,12 @@ public: | |||
92 | 92 | ||
93 | 93 | ||
94 | new SampleItem ( this, tr( "Sample 1" ), Resource::loadPixmap ( "DateBook" )); | 94 | new SampleItem ( this, tr( "Sample 1" ), Resource::loadPixmap ( "datebook/DateBook" )); |
95 | new SampleItem ( this, tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" )); | 95 | new SampleItem ( this, tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" )); |
96 | new SampleItem ( this, tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" )); | 96 | new SampleItem ( this, tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" )); |
97 | 97 | ||
98 | setBackgroundType ( TabConfig::Ruled, QString::null ); | 98 | setBackgroundType ( TabConfig::Ruled, QString::null ); |
99 | 99 | ||
100 | setMaximumHeight ( firstItem ( )-> height ( ) + 16 ); | 100 | setMaximumHeight ( firstItem ( )-> height ( ) + 16 ); |
101 | } | 101 | } |
102 | 102 | ||
103 | void setViewMode ( TabConfig::ViewMode m ) | 103 | void setViewMode ( TabConfig::ViewMode m ) |
@@ -106,5 +106,5 @@ public: | |||
106 | 106 | ||
107 | switch ( m ) { | 107 | switch ( m ) { |
108 | case TabConfig::List: | 108 | case TabConfig::List: |
109 | setItemTextPos( QIconView::Right ); | 109 | setItemTextPos( QIconView::Right ); |
110 | break; | 110 | break; |
@@ -120,5 +120,5 @@ public: | |||
120 | viewport ( )-> setUpdatesEnabled ( true ); | 120 | viewport ( )-> setUpdatesEnabled ( true ); |
121 | update ( ); | 121 | update ( ); |
122 | } | 122 | } |
123 | 123 | ||
124 | 124 | ||
@@ -189,5 +189,5 @@ public: | |||
189 | QIconView::setItemTextPos( pos ); | 189 | QIconView::setItemTextPos( pos ); |
190 | } | 190 | } |
191 | 191 | ||
192 | void calculateGrid ( ItemTextPos pos ) | 192 | void calculateGrid ( ItemTextPos pos ) |
193 | { | 193 | { |
@@ -203,5 +203,5 @@ public: | |||
203 | setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); | 203 | setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); |
204 | setGridY ( fontMetrics ( ). height ( ) * 2 + 24 ); | 204 | setGridY ( fontMetrics ( ). height ( ) * 2 + 24 ); |
205 | } | 205 | } |
206 | else { | 206 | else { |
207 | int cols = 2; | 207 | int cols = 2; |
@@ -215,13 +215,13 @@ public: | |||
215 | } | 215 | } |
216 | } | 216 | } |
217 | 217 | ||
218 | void paletteChange( const QPalette &p ) | 218 | void paletteChange( const QPalette &p ) |
219 | { | 219 | { |
220 | static bool excllock = false; | 220 | static bool excllock = false; |
221 | 221 | ||
222 | if ( excllock ) | 222 | if ( excllock ) |
223 | return; | 223 | return; |
224 | excllock = true; | 224 | excllock = true; |
225 | 225 | ||
226 | unsetPalette ( ); | 226 | unsetPalette ( ); |
227 | QIconView::paletteChange ( p ); | 227 | QIconView::paletteChange ( p ); |
@@ -231,14 +231,14 @@ public: | |||
231 | cg.setColor ( QColorGroup::Text, m_textcolor ); | 231 | cg.setColor ( QColorGroup::Text, m_textcolor ); |
232 | setPalette ( QPalette ( cg, cg, cg )); | 232 | setPalette ( QPalette ( cg, cg, cg )); |
233 | 233 | ||
234 | excllock = false; | 234 | excllock = false; |
235 | } | 235 | } |
236 | 236 | ||
237 | void setBackgroundPixmap ( const QPixmap &pm ) | 237 | void setBackgroundPixmap ( const QPixmap &pm ) |
238 | { | 238 | { |
239 | m_bgpix = pm; | 239 | m_bgpix = pm; |
240 | } | 240 | } |
241 | 241 | ||
242 | void setBackgroundColor ( const QColor &c ) | 242 | void setBackgroundColor ( const QColor &c ) |
243 | { | 243 | { |
244 | m_bgcolor = c; | 244 | m_bgcolor = c; |
@@ -248,11 +248,11 @@ public: | |||
248 | { | 248 | { |
249 | if ( !m_bgpix. isNull ( )) { | 249 | if ( !m_bgpix. isNull ( )) { |
250 | p-> drawTiledPixmap ( r, m_bgpix, QPoint (( r. x ( ) + contentsX ( )) % m_bgpix. width ( ), | 250 | p-> drawTiledPixmap ( r, m_bgpix, QPoint (( r. x ( ) + contentsX ( )) % m_bgpix. width ( ), |
251 | ( r. y ( ) + contentsY ( )) % m_bgpix. height ( ))); | 251 | ( r. y ( ) + contentsY ( )) % m_bgpix. height ( ))); |
252 | } | 252 | } |
253 | else | 253 | else |
254 | p-> fillRect ( r, m_bgcolor ); | 254 | p-> fillRect ( r, m_bgcolor ); |
255 | } | 255 | } |
256 | 256 | ||
257 | private: | 257 | private: |
258 | QColor m_textcolor; | 258 | QColor m_textcolor; |
@@ -274,7 +274,7 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig | |||
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/color", tr( "Background" )); |
277 | tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); | 277 | tw-> addTab ( createFontTab ( tw ), "font", tr( "Font" )); |
278 | tw-> addTab ( createIconTab ( tw ), "appearance/colorstabicon.png", tr( "Icons" ) ); | 278 | tw-> addTab ( createIconTab ( tw ), "pixmap", tr( "Icons" ) ); |
279 | 279 | ||
280 | tw-> setCurrentTab ( bgtab ); | 280 | tw-> setCurrentTab ( bgtab ); |
@@ -376,8 +376,8 @@ QWidget *TabDialog::createBgTab ( QWidget *parent ) | |||
376 | hb-> addWidget ( m_imagebrowse ); | 376 | hb-> addWidget ( m_imagebrowse ); |
377 | hb-> addStretch ( 10 ); | 377 | hb-> addStretch ( 10 ); |
378 | 378 | ||
379 | gridLayout-> addLayout ( hb, 2, 1 ); | 379 | gridLayout-> addLayout ( hb, 2, 1 ); |
380 | 380 | ||
381 | QPushButton *p = new QPushButton ( tr( "Default" ), tab ); | 381 | QPushButton *p = new QPushButton ( tr( "Default" ), tab ); |
382 | connect ( p, SIGNAL( clicked ( )), this, SLOT( bgDefaultClicked ( ))); | 382 | connect ( p, SIGNAL( clicked ( )), this, SLOT( bgDefaultClicked ( ))); |
383 | gridLayout-> addWidget ( p, 3, 1 ); | 383 | gridLayout-> addWidget ( p, 3, 1 ); |
@@ -394,5 +394,5 @@ QWidget *TabDialog::createIconTab ( QWidget *parent ) | |||
394 | QWidget *tab = new QWidget( parent, "IconTab" ); | 394 | QWidget *tab = new QWidget( parent, "IconTab" ); |
395 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); | 395 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); |
396 | 396 | ||
397 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 397 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
398 | gridLayout-> setColStretch ( 1, 10 ); | 398 | gridLayout-> setColStretch ( 1, 10 ); |
@@ -449,5 +449,5 @@ void TabDialog::bgTypeClicked ( int t ) | |||
449 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) | 449 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) |
450 | m_bgtype-> setButton ( t ); | 450 | m_bgtype-> setButton ( t ); |
451 | 451 | ||
452 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); | 452 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); |
453 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); | 453 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); |
@@ -457,5 +457,5 @@ void TabDialog::bgTypeClicked ( int t ) | |||
457 | else if ( t == TabConfig::Image ) | 457 | else if ( t == TabConfig::Image ) |
458 | s = Resource::findPixmap ( m_bgimage ); | 458 | s = Resource::findPixmap ( m_bgimage ); |
459 | 459 | ||
460 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); | 460 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); |
461 | } | 461 | } |
@@ -478,12 +478,12 @@ void TabDialog::bgImageClicked ( ) | |||
478 | MimeTypes types; | 478 | MimeTypes types; |
479 | QStringList list; | 479 | QStringList list; |
480 | list << "image/*"; | 480 | list << "image/*"; |
481 | types. insert ( "Images", list ); | 481 | types. insert ( "Images", list ); |
482 | 482 | ||
483 | QString file = OFileDialog::getOpenFileName ( 1, "/", QString::null, types ); | 483 | QString file = OFileDialog::getOpenFileName ( 1, "/", QString::null, types ); |
484 | if ( !file. isEmpty ( )) { | 484 | if ( !file. isEmpty ( )) { |
485 | m_bgimage = DocLnk ( file ). file ( ); | 485 | m_bgimage = DocLnk ( file ). file ( ); |
486 | bgTypeClicked ( TabConfig::Image ); | 486 | bgTypeClicked ( TabConfig::Image ); |
487 | } | 487 | } |
488 | } | 488 | } |
489 | 489 | ||
@@ -501,10 +501,10 @@ void TabDialog::accept ( ) | |||
501 | m_tc. m_bg_image = m_bgimage; | 501 | m_tc. m_bg_image = m_bgimage; |
502 | m_tc. m_text_color = m_iconcolor-> color ( ). name ( ); | 502 | m_tc. m_text_color = m_iconcolor-> color ( ). name ( ); |
503 | 503 | ||
504 | m_tc. m_font_use = m_fontuse-> isChecked ( ); | 504 | m_tc. m_font_use = m_fontuse-> isChecked ( ); |
505 | 505 | ||
506 | if ( m_tc. m_font_use ) { | 506 | if ( m_tc. m_font_use ) { |
507 | QFont f = m_fontselect-> selectedFont ( ); | 507 | QFont f = m_fontselect-> selectedFont ( ); |
508 | 508 | ||
509 | m_tc. m_font_family = f. family ( ); | 509 | m_tc. m_font_family = f. family ( ); |
510 | m_tc. m_font_size = f. pointSize ( ); | 510 | m_tc. m_font_size = f. pointSize ( ); |
@@ -512,5 +512,5 @@ void TabDialog::accept ( ) | |||
512 | m_tc. m_font_italic = f. italic ( ); | 512 | m_tc. m_font_italic = f. italic ( ); |
513 | } | 513 | } |
514 | 514 | ||
515 | QDialog::accept ( ); | 515 | QDialog::accept ( ); |
516 | } | 516 | } |