summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/tabdialog.cpp4
-rw-r--r--core/settings/launcher/tabdialog.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp
index d20412a..5981d0b 100644
--- a/core/settings/launcher/tabdialog.cpp
+++ b/core/settings/launcher/tabdialog.cpp
@@ -202,130 +202,130 @@ public:
setSpacing ( 4 );
setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols );
setGridY ( fontMetrics ( ). height ( ) * 2 + 24 );
}
else {
int cols = 2;
if ( viewerWidth < 150 )
cols = 1;
else if ( viewerWidth >= 400 )
cols = viewerWidth / 150;
setSpacing ( 2 );
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 )
{
m_bgpix = pm;
}
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 ( ),
( r. y ( ) + contentsY ( )) % m_bgpix. height ( )));
}
else
p-> fillRect ( r, m_bgcolor );
}
private:
QColor m_textcolor;
QColor m_bgcolor;
QPixmap m_bgpix;
TabConfig::BackgroundType m_bgtype;
};
-TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &tc, QWidget *parent, const char *name, bool modal, WFlags fl )
- : QDialog ( parent, name, modal, fl | WStyle_ContextHelp ), m_tc ( tc )
+TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &tc, QWidget *parent, const char *dname, bool modal, WFlags fl )
+ : QDialog ( parent, dname, modal, fl | WStyle_ContextHelp ), m_tc ( tc )
{
setCaption ( tr( "Edit Tab" ));
QVBoxLayout *lay = new QVBoxLayout ( this, 3, 3 );
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-> setCurrentTab ( bgtab );
QWidget *sample = new QVBox ( this );
QTabBar *tb = new QTabBar ( sample );
QString name ( tr( "Previewing %1" ). arg ( tabname ));
tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name ));
m_sample = new SampleView ( sample );
lay-> addWidget ( tw, 10 );
lay-> addWidget ( sample, 1 );
m_iconsize-> setButton ( tc. m_view );
iconSizeClicked ( tc. m_view );
m_iconcolor-> setColor ( QColor ( m_tc. m_text_color ));
iconColorClicked ( m_iconcolor-> color ( ));
m_bgtype-> setButton ( tc. m_bg_type );
m_solidcolor-> setColor ( QColor ( tc. m_bg_color ));
m_bgimage = tc. m_bg_image;
bgTypeClicked ( tc. m_bg_type );
m_fontuse-> setChecked ( tc. m_font_use );
m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic ));
m_fontselect-> setEnabled ( m_fontuse-> isChecked ( ));
fontClicked ( m_fontselect-> selectedFont ( ));
QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." ));
}
TabDialog::~TabDialog ( )
{
}
QWidget *TabDialog::createFontTab ( QWidget *parent )
{
QWidget *tab = new QWidget ( parent, "FontTab" );
QVBoxLayout *vertLayout = new QVBoxLayout ( tab, 3, 3 );
m_fontuse = new QCheckBox ( tr( "Use a custom font" ), tab );
vertLayout-> addWidget ( m_fontuse );
m_fontselect = new OFontSelector ( false, tab, "fontsel" );
vertLayout-> addWidget ( m_fontselect );
connect ( m_fontuse, SIGNAL( toggled ( bool )), m_fontselect, SLOT( setEnabled ( bool )));
connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )),
this, SLOT( fontClicked ( const QFont & )));
return tab;
}
diff --git a/core/settings/launcher/tabdialog.h b/core/settings/launcher/tabdialog.h
index 892a3ad..4f99d5d 100644
--- a/core/settings/launcher/tabdialog.h
+++ b/core/settings/launcher/tabdialog.h
@@ -1,81 +1,81 @@
/*
               =. This file is part of the OPIE Project
             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
           .>+-=
 _;:,     .>    :=|. This file is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . 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.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __TABDIALOG_H__
#define __TABDIALOG_H__
#include <qdialog.h>
#include "tabconfig.h"
class QButtonGroup;
class OFontSelector;
class SampleView;
class OColorButton;
class QPushButton;
class QCheckBox;
class TabDialog : public QDialog {
Q_OBJECT
public:
- TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &cfg, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags = 0 );
+ TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &cfg, QWidget *parent = 0, const char *dname = 0, bool modal = false, WFlags = 0 );
virtual ~TabDialog ( );
public slots:
virtual void accept ( );
protected slots:
void iconSizeClicked ( int );
void fontClicked ( const QFont & );
void bgTypeClicked ( int );
void bgColorClicked ( const QColor & );
void iconColorClicked ( const QColor & );
void bgImageClicked ( );
void bgDefaultClicked ( );
private:
QWidget *createBgTab ( QWidget *parent );
QWidget *createFontTab ( QWidget *parent );
QWidget *createIconTab ( QWidget *parent );
private:
SampleView *m_sample;
QButtonGroup *m_iconsize;
OFontSelector *m_fontselect;
OColorButton *m_solidcolor;
OColorButton *m_iconcolor;
QPushButton *m_imagebrowse;
QString m_bgimage;
QButtonGroup *m_bgtype;
QCheckBox *m_fontuse;
TabConfig &m_tc;
};
-#endif \ No newline at end of file
+#endif