summaryrefslogtreecommitdiff
authorsandman <sandman>2002-10-31 03:07:50 (UTC)
committer sandman <sandman>2002-10-31 03:07:50 (UTC)
commitd9d6cc6b3a537439affc8095dedd046c86f09d9e (patch) (side-by-side diff)
tree3b18a42dfc9f32eecc799104b3fea201ff8a14ba
parent035eaf63bb2156ea7facd6b50f8891503d1f7bed (diff)
downloadopie-d9d6cc6b3a537439affc8095dedd046c86f09d9e.zip
opie-d9d6cc6b3a537439affc8095dedd046c86f09d9e.tar.gz
opie-d9d6cc6b3a537439affc8095dedd046c86f09d9e.tar.bz2
- added a "[x] Use custom font" checkbox -- if this is not checked
(default), then launcher uses the global font for the tabs. - reworked the internal handling of "All tabs", to make it possible to use this information for newly added tabs (still missing)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/tabconfig.h13
-rw-r--r--core/settings/launcher/tabdialog.cpp45
-rw-r--r--core/settings/launcher/tabdialog.h2
-rw-r--r--core/settings/launcher/tabssettings.cpp69
-rw-r--r--core/settings/launcher/taskbarsettings.cpp3
5 files changed, 86 insertions, 46 deletions
diff --git a/core/settings/launcher/tabconfig.h b/core/settings/launcher/tabconfig.h
index eebfd36..9086341 100644
--- a/core/settings/launcher/tabconfig.h
+++ b/core/settings/launcher/tabconfig.h
@@ -45,2 +45,3 @@ struct TabConfig {
QString m_text_color;
+ bool m_font_use;
QString m_font_family;
@@ -58,6 +59,10 @@ struct TabConfig {
( m_text_color == tc. m_text_color ) &&
- ( m_font_family == tc. m_font_family ) &&
- ( m_font_size == tc. m_font_size ) &&
- ( m_font_weight == tc. m_font_weight ) &&
- ( m_font_italic == tc. m_font_italic );
+ ( m_font_use == tc. m_font_use ) &&
+ ( m_font_use ? (
+ ( m_font_family == tc. m_font_family ) &&
+ ( m_font_size == tc. m_font_size ) &&
+ ( m_font_weight == tc. m_font_weight ) &&
+ ( m_font_italic == tc. m_font_italic )
+ ) : true );
+
}
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp
index a90ba7d..d20412a 100644
--- a/core/settings/launcher/tabdialog.cpp
+++ b/core/settings/launcher/tabdialog.cpp
@@ -41,2 +41,3 @@
#include <qwhatsthis.h>
+#include <qcheckbox.h>
@@ -269,3 +270,3 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig
- QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
+ QVBoxLayout *lay = new QVBoxLayout ( this, 3, 3 );
@@ -299,3 +300,5 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig
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 ( ));
@@ -312,4 +315,12 @@ QWidget *TabDialog::createFontTab ( QWidget *parent )
{
- m_fontselect = new OFontSelector ( false, parent, "FontTab" );
+ 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 & )),
@@ -317,3 +328,3 @@ QWidget *TabDialog::createFontTab ( QWidget *parent )
- return m_fontselect;
+ return tab;
}
@@ -322,4 +333,4 @@ QWidget *TabDialog::createBgTab ( QWidget *parent )
{
- QWidget *tab = new QWidget( parent, "AdvancedTab" );
- QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 );
+ QWidget *tab = new QWidget( parent, "BgTab" );
+ QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 );
@@ -340,3 +351,3 @@ QWidget *TabDialog::createBgTab ( QWidget *parent )
QHBoxLayout *hb = new QHBoxLayout ( );
- hb-> setSpacing ( 4 );
+ hb-> setSpacing ( 3 );
@@ -355,3 +366,3 @@ QWidget *TabDialog::createBgTab ( QWidget *parent )
hb = new QHBoxLayout ( );
- hb-> setSpacing ( 4 );
+ hb-> setSpacing ( 3 );
@@ -382,4 +393,4 @@ QWidget *TabDialog::createIconTab ( QWidget *parent )
{
- QWidget *tab = new QWidget( parent, "AdvancedTab" );
- QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 );
+ QWidget *tab = new QWidget( parent, "IconTab" );
+ QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 );
@@ -491,9 +502,13 @@ void TabDialog::accept ( )
m_tc. m_text_color = m_iconcolor-> color ( ). name ( );
+
+ m_tc. m_font_use = m_fontuse-> isChecked ( );
+
+ if ( m_tc. m_font_use ) {
+ QFont f = m_fontselect-> selectedFont ( );
- 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 ( );
+ 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 ( );
+ }
diff --git a/core/settings/launcher/tabdialog.h b/core/settings/launcher/tabdialog.h
index b0afd47..892a3ad 100644
--- a/core/settings/launcher/tabdialog.h
+++ b/core/settings/launcher/tabdialog.h
@@ -38,2 +38,3 @@ class OColorButton;
class QPushButton;
+class QCheckBox;
@@ -73,2 +74,3 @@ private:
QButtonGroup *m_bgtype;
+ QCheckBox *m_fontuse;
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp
index a5afaf2..9d6e8c1 100644
--- a/core/settings/launcher/tabssettings.cpp
+++ b/core/settings/launcher/tabssettings.cpp
@@ -49,3 +49,3 @@
-#define GLOBALID "_launchersettings_global_dummy_"
+#define GLOBALID ".global."
@@ -126,13 +126,24 @@ void TabsSettings::readTabSettings ( Config &cfg )
+ TabConfig global_def;
+ global_def. m_view = TabConfig::Icon;
+ global_def. m_bg_type = TabConfig::Ruled;
+ global_def. m_bg_image = "launcher/opie-background";
+ global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( );
+ global_def. m_text_color = colorGroup ( ). color ( QColorGroup::Text ). name ( );
+ global_def. m_font_use = false;
+ global_def. m_font_family = font ( ). family ( );
+ global_def. m_font_size = font ( ). pointSize ( );
+ global_def. m_font_weight = 50;
+ global_def. m_font_italic = false;
+ global_def. m_changed = false;
+
+
for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
- TabConfig tc;
- tc. m_view = TabConfig::Icon;
- tc. m_bg_type = TabConfig::Ruled;
- tc. m_changed = false;
+ TabConfig tc = ( it != m_ids. begin ( )) ? m_tabs [GLOBALID] : global_def;
cfg. setGroup ( grp. arg ( *it ));
- if ( *it == GLOBALID )
- cfg. clearGroup ( );
- QString view = cfg. readEntry ( "View", "Icon" );
+ QString view = cfg. readEntry ( "View" );
+ if ( view == "Icon" ) // No tr
+ tc. m_view = TabConfig::Icon;
if ( view == "List" ) // No tr
@@ -140,4 +151,6 @@ void TabsSettings::readTabSettings ( Config &cfg )
- QString bgType = cfg. readEntry ( "BackgroundType", "Image" );
- if ( bgType == "SolidColor" )
+ QString bgType = cfg. readEntry ( "BackgroundType" );
+ if ( bgType == "Image" )
+ tc. m_bg_type = TabConfig::Image;
+ else if ( bgType == "SolidColor" )
tc. m_bg_type = TabConfig::SolidColor;
@@ -146,7 +159,8 @@ void TabsSettings::readTabSettings ( Config &cfg )
- tc. m_bg_image = cfg. readEntry ( "BackgroundImage", "launcher/opie-background" );
- tc. m_bg_color = cfg. readEntry ( "BackgroundColor", colorGroup ( ). color ( QColorGroup::Base ). name ( ));
- tc. m_text_color = cfg. readEntry ( "TextColor", colorGroup ( ). color ( QColorGroup::Text ). name ( ));
+ tc. m_bg_image = cfg. readEntry ( "BackgroundImage", tc. m_bg_image );
+ tc. m_bg_color = cfg. readEntry ( "BackgroundColor", tc. m_bg_color );
+ tc. m_text_color = cfg. readEntry ( "TextColor", tc. m_text_color );
QStringList f = cfg. readListEntry ( "Font", ',' );
if ( f. count ( ) == 4 ) {
+ tc. m_font_use = true;
tc. m_font_family = f [0];
@@ -155,9 +169,3 @@ void TabsSettings::readTabSettings ( Config &cfg )
tc. m_font_italic = ( f [3]. toInt ( ));
- } else {
- tc. m_font_family = font ( ). family ( );
- tc. m_font_size = font ( ). pointSize ( );
- tc. m_font_weight = 50;
- tc. m_font_italic = false;
- }
-
+ }
m_tabs [*it] = tc;
@@ -178,4 +186,6 @@ void TabsSettings::readTabSettings ( Config &cfg )
}
- if ( same )
+ if ( same ) {
m_tabs [GLOBALID] = *first;
+ m_tabs [GLOBALID]. m_changed = true;
+ }
}
@@ -193,3 +203,3 @@ void TabsSettings::accept ( )
- if ( !tc. m_changed || ( *it == GLOBALID ))
+ if ( !tc. m_changed )
continue;
@@ -213,4 +223,9 @@ void TabsSettings::accept ( )
- QString f = tc. m_font_family + "," + QString::number ( tc. m_font_size ) + "," + QString::number ( tc. m_font_weight ) + "," + ( tc. m_font_italic ? "1" : "0" );
- cfg. writeEntry ( "Font", f );
+ if ( tc. m_font_use ) {
+ QString f = tc. m_font_family + "," + QString::number ( tc. m_font_size ) + "," + QString::number ( tc. m_font_weight ) + "," + ( tc. m_font_italic ? "1" : "0" );
+ cfg. writeEntry ( "Font", f );
+ }
+ else
+ cfg. removeEntry ( "Font" );
+
QCopEnvelope be ( "QPE/Launcher", "setTabBackground(QString,int,QString)" );
@@ -236,5 +251,7 @@ void TabsSettings::accept ( )
QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" );
- fe << *it << tc. m_font_family;
+ fe << *it;
+ fe << ( tc. m_font_use ? tc. m_font_family : QString::null );
fe << tc. m_font_size;
- fe << tc. m_font_weight << ( tc. m_font_italic ? 1 : 0 );
+ fe << tc. m_font_weight;
+ fe << ( tc. m_font_italic ? 1 : 0 );
diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp
index 5bc5ad2..b3e302a 100644
--- a/core/settings/launcher/taskbarsettings.cpp
+++ b/core/settings/launcher/taskbarsettings.cpp
@@ -137,2 +137,3 @@ void TaskbarSettings::accept ( )
cfg. setGroup ( "Applets" );
+
if ( m_applets_changed ) {
@@ -150,3 +151,3 @@ void TaskbarSettings::accept ( )
if ( m_applets_changed ) {
- QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" );
+ QCopEnvelope e ( "QPE/TaskBar", "reloadApplets()" );
m_applets_changed = false;