summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-03-08 21:40:57 (UTC)
committer harlekin <harlekin>2003-03-08 21:40:57 (UTC)
commita6bf0a8b50265dd667f31fed18a6dcad15ef10b5 (patch) (side-by-side diff)
treeb960cf65353e5b67992c86a8bfa5349c73034e06
parent006850e5841fe3d509845a10bb8a6391c556c1c0 (diff)
downloadopie-a6bf0a8b50265dd667f31fed18a6dcad15ef10b5.zip
opie-a6bf0a8b50265dd667f31fed18a6dcad15ef10b5.tar.gz
opie-a6bf0a8b50265dd667f31fed18a6dcad15ef10b5.tar.bz2
icon changes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/launchersettings.cpp9
-rw-r--r--core/settings/launcher/tabdialog.cpp82
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,4 +1,5 @@
+
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
@@ -14,9 +15,9 @@
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
+++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
@@ -48,12 +49,12 @@ LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false,
m_tabs = new TabsSettings ( tw );
m_taskbar = new TaskbarSettings ( tw );
m_menu = new MenuSettings ( tw );
- tw-> addTab ( m_taskbar, "launchersettings/taskbartab.png", tr( "Taskbar" ));
- tw-> addTab ( m_menu, "launchersettings/menutab.png", tr( "O-Menu" ));
+ tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" ));
+ tw-> addTab ( m_menu, "go", tr( "O-Menu" ));
tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" ));
-
+
tw-> setCurrentTab ( m_taskbar );
}
void LauncherSettings::accept ( )
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
@@ -14,9 +14,9 @@
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
+++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
@@ -51,27 +51,27 @@
class SampleItem : public QIconViewItem {
public:
SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text )
- {
+ {
m_large = pix;
m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 ));
}
-
+
void sizeChange ( )
{
calcRect ( );
repaint ( );
}
-
- QPixmap *pixmap ( ) const
+
+ QPixmap *pixmap ( ) const
{
- if ( iconView ( )-> itemTextPos ( ) == QIconView::Right )
+ if ( iconView ( )-> itemTextPos ( ) == QIconView::Right )
return (QPixmap *) &m_small;
else
return (QPixmap *) &m_large;
}
-
+
private:
QPixmap m_large, m_small;
};
@@ -90,23 +90,23 @@ public:
setViewMode ( TabConfig::Icon );
calculateGrid ( Bottom );
- new SampleItem ( this, tr( "Sample 1" ), Resource::loadPixmap ( "DateBook" ));
+ new SampleItem ( this, tr( "Sample 1" ), Resource::loadPixmap ( "datebook/DateBook" ));
new SampleItem ( this, tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" ));
new SampleItem ( this, tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" ));
-
+
setBackgroundType ( TabConfig::Ruled, QString::null );
-
+
setMaximumHeight ( firstItem ( )-> height ( ) + 16 );
- }
+ }
void setViewMode ( TabConfig::ViewMode m )
{
viewport ( )-> setUpdatesEnabled ( false );
switch ( m ) {
- case TabConfig::List:
+ case TabConfig::List:
setItemTextPos( QIconView::Right );
break;
case TabConfig::Icon:
setItemTextPos( QIconView::Bottom );
@@ -118,9 +118,9 @@ public:
((SampleItem *) it )-> sizeChange ( );
arrangeItemsInGrid ( true );
viewport ( )-> setUpdatesEnabled ( true );
update ( );
- }
+ }
void setBackgroundType( TabConfig::BackgroundType t, const QString &val )
{
@@ -187,9 +187,9 @@ public:
{
calculateGrid ( pos );
QIconView::setItemTextPos( pos );
}
-
+
void calculateGrid ( ItemTextPos pos )
{
int dw = QApplication::desktop ( )-> width ( );
int viewerWidth = dw - style ( ).scrollBarExtent ( ). width ( );
@@ -201,9 +201,9 @@ public:
cols = viewerWidth/96;
setSpacing ( 4 );
setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols );
setGridY ( fontMetrics ( ). height ( ) * 2 + 24 );
- }
+ }
else {
int cols = 2;
if ( viewerWidth < 150 )
cols = 1;
@@ -213,48 +213,48 @@ public:
setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols );
setGridY ( fontMetrics ( ). height ( ) + 2 );
}
}
-
+
void paletteChange( const QPalette &p )
{
static bool excllock = false;
-
+
if ( excllock )
return;
excllock = true;
-
+
unsetPalette ( );
QIconView::paletteChange ( p );
if ( m_bgtype == TabConfig::Ruled )
setBackgroundType ( TabConfig::Ruled, QString::null );
QColorGroup cg = colorGroup ( );
cg.setColor ( QColorGroup::Text, m_textcolor );
setPalette ( QPalette ( cg, cg, cg ));
-
+
excllock = false;
}
-
- void setBackgroundPixmap ( const QPixmap &pm )
+
+ void setBackgroundPixmap ( const QPixmap &pm )
{
m_bgpix = pm;
}
-
- void setBackgroundColor ( const QColor &c )
+
+ void setBackgroundColor ( const QColor &c )
{
m_bgcolor = c;
}
void drawBackground ( QPainter *p, const QRect &r )
{
if ( !m_bgpix. isNull ( )) {
- p-> drawTiledPixmap ( r, m_bgpix, QPoint (( r. x ( ) + contentsX ( )) % m_bgpix. width ( ),
+ p-> drawTiledPixmap ( r, m_bgpix, QPoint (( r. x ( ) + contentsX ( )) % m_bgpix. width ( ),
( r. y ( ) + contentsY ( )) % m_bgpix. height ( )));
- }
+ }
else
p-> fillRect ( r, m_bgcolor );
}
-
+
private:
QColor m_textcolor;
QColor m_bgcolor;
QPixmap m_bgpix;
@@ -272,11 +272,11 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig
OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
QWidget *bgtab;
- tw-> addTab ( bgtab = createBgTab ( tw ), "appearance/backgroundtabicon.png", tr( "Background" ));
- tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" ));
- tw-> addTab ( createIconTab ( tw ), "appearance/colorstabicon.png", tr( "Icons" ) );
+ tw-> addTab ( bgtab = createBgTab ( tw ), "appearance/color", tr( "Background" ));
+ tw-> addTab ( createFontTab ( tw ), "font", tr( "Font" ));
+ tw-> addTab ( createIconTab ( tw ), "pixmap", tr( "Icons" ) );
tw-> setCurrentTab ( bgtab );
QWidget *sample = new QVBox ( this );
@@ -374,12 +374,12 @@ QWidget *TabDialog::createBgTab ( QWidget *parent )
m_imagebrowse = new QPushButton ( tr( "Select..." ), tab );
connect ( m_imagebrowse, SIGNAL( clicked ( )), this, SLOT( bgImageClicked ( )));
hb-> addWidget ( m_imagebrowse );
hb-> addStretch ( 10 );
-
+
gridLayout-> addLayout ( hb, 2, 1 );
- QPushButton *p = new QPushButton ( tr( "Default" ), tab );
+ QPushButton *p = new QPushButton ( tr( "Default" ), tab );
connect ( p, SIGNAL( clicked ( )), this, SLOT( bgDefaultClicked ( )));
gridLayout-> addWidget ( p, 3, 1 );
connect ( m_bgtype, SIGNAL( clicked ( int )), this, SLOT( bgTypeClicked ( int )));
@@ -392,9 +392,9 @@ QWidget *TabDialog::createBgTab ( QWidget *parent )
QWidget *TabDialog::createIconTab ( QWidget *parent )
{
QWidget *tab = new QWidget( parent, "IconTab" );
QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 );
-
+
QGridLayout* gridLayout = new QGridLayout ( vertLayout );
gridLayout-> setColStretch ( 1, 10 );
QLabel* label = new QLabel( tr( "Size:" ), tab );
@@ -447,17 +447,17 @@ void TabDialog::bgTypeClicked ( int t )
QString s;
if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t )
m_bgtype-> setButton ( t );
-
+
m_solidcolor-> setEnabled ( t == TabConfig::SolidColor );
m_imagebrowse-> setEnabled ( t == TabConfig::Image );
if ( t == TabConfig::SolidColor )
s = m_solidcolor-> color ( ). name ( );
else if ( t == TabConfig::Image )
s = Resource::findPixmap ( m_bgimage );
-
+
m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s );
}
void TabDialog::bgColorClicked ( const QColor & )
@@ -476,16 +476,16 @@ void TabDialog::bgImageClicked ( )
// this is just a quick c&p from the old appearance app
MimeTypes types;
QStringList list;
- list << "image/*";
+ list << "image/*";
types. insert ( "Images", list );
-
+
QString file = OFileDialog::getOpenFileName ( 1, "/", QString::null, types );
if ( !file. isEmpty ( )) {
m_bgimage = DocLnk ( file ). file ( );
bgTypeClicked ( TabConfig::Image );
- }
+ }
}
void TabDialog::bgDefaultClicked ( )
{
@@ -499,18 +499,18 @@ void TabDialog::accept ( )
m_tc. m_bg_type = (TabConfig::BackgroundType) m_bgtype-> id ( m_bgtype-> selected ( ));
m_tc. m_bg_color = m_solidcolor-> color ( ). name ( );
m_tc. m_bg_image = m_bgimage;
m_tc. m_text_color = m_iconcolor-> color ( ). name ( );
-
+
m_tc. m_font_use = m_fontuse-> isChecked ( );
- if ( m_tc. m_font_use ) {
+ if ( m_tc. m_font_use ) {
QFont f = m_fontselect-> selectedFont ( );
-
+
m_tc. m_font_family = f. family ( );
m_tc. m_font_size = f. pointSize ( );
m_tc. m_font_weight = f. weight ( );
m_tc. m_font_italic = f. italic ( );
}
-
+
QDialog::accept ( );
}