author | zautrix <zautrix> | 2005-04-13 23:54:32 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-13 23:54:32 (UTC) |
commit | 5ea16ef9058a21016402dd5affc0a7f82857e606 (patch) (unidiff) | |
tree | 3c147e24c3bd51208a8055a94e4a487a1708d337 /microkde/kglobalsettings.cpp | |
parent | 93b536533e1c908085adb61553907615c31786c0 (diff) | |
download | kdepimpi-5ea16ef9058a21016402dd5affc0a7f82857e606.zip kdepimpi-5ea16ef9058a21016402dd5affc0a7f82857e606.tar.gz kdepimpi-5ea16ef9058a21016402dd5affc0a7f82857e606.tar.bz2 |
fix
Diffstat (limited to 'microkde/kglobalsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kglobalsettings.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index 92a2b48..5976aae 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp | |||
@@ -1,86 +1,95 @@ | |||
1 | #include "kglobalsettings.h" | 1 | #include "kglobalsettings.h" |
2 | #include "kconfig.h" | 2 | #include "kconfig.h" |
3 | #include "kglobal.h" | 3 | #include "kglobal.h" |
4 | #include "kconfigbase.h" | 4 | #include "kconfigbase.h" |
5 | 5 | ||
6 | #include <qapplication.h> | 6 | #include <qapplication.h> |
7 | 7 | ||
8 | #ifdef DESKTOP_VERSION | ||
9 | QColor KGlobalSettings::mAlternate = QColor( 235, 235, 235 ); | ||
10 | #else | ||
11 | QColor KGlobalSettings::mAlternate = QColor( 210, 210, 210 ); | ||
12 | #endif | ||
13 | |||
14 | |||
8 | QFont KGlobalSettings::generalFont() | 15 | QFont KGlobalSettings::generalFont() |
9 | { | 16 | { |
10 | int size = 12; | 17 | int size = 12; |
11 | if (QApplication::desktop()->width() < 480 ) { | 18 | if (QApplication::desktop()->width() < 480 ) { |
12 | size = 10; | 19 | size = 10; |
13 | } | 20 | } |
14 | #ifndef DESKTOP_VERSION | 21 | #ifndef DESKTOP_VERSION |
15 | else | 22 | else |
16 | if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | 23 | if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) |
17 | size = 18; | 24 | size = 18; |
18 | #endif | 25 | #endif |
19 | QFont f = QApplication::font(); | 26 | QFont f = QApplication::font(); |
20 | //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); | 27 | //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); |
21 | f.setPointSize( size ); | 28 | f.setPointSize( size ); |
22 | return f; | 29 | return f; |
23 | } | 30 | } |
24 | QFont KGlobalSettings::generalMaxFont() | 31 | QFont KGlobalSettings::generalMaxFont() |
25 | { | 32 | { |
26 | int size = 12; | 33 | int size = 12; |
27 | if (QApplication::desktop()->width() < 480 ) { | 34 | if (QApplication::desktop()->width() < 480 ) { |
28 | size = 10; | 35 | size = 10; |
29 | } | 36 | } |
30 | #ifndef DESKTOP_VERSION | 37 | #ifndef DESKTOP_VERSION |
31 | else | 38 | else |
32 | if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | 39 | if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) |
33 | size = 18; | 40 | size = 18; |
34 | #endif | 41 | #endif |
35 | QFont f = QApplication::font(); | 42 | QFont f = QApplication::font(); |
36 | if ( f.pointSize() > size ) | 43 | if ( f.pointSize() > size ) |
37 | f.setPointSize( size ); | 44 | f.setPointSize( size ); |
38 | return f; | 45 | return f; |
39 | } | 46 | } |
40 | 47 | ||
41 | QString KGlobalSettings::timeTrackerDir() | 48 | QString KGlobalSettings::timeTrackerDir() |
42 | { | 49 | { |
43 | static QString dir; | 50 | static QString dir; |
44 | if ( dir.isEmpty() ) { | 51 | if ( dir.isEmpty() ) { |
45 | dir = locateLocal( "data", "timetrackerdir/d.ttl" ); | 52 | dir = locateLocal( "data", "timetrackerdir/d.ttl" ); |
46 | dir = dir.left ( dir.length() - 5); | 53 | dir = dir.left ( dir.length() - 5); |
47 | } | 54 | } |
48 | return dir; | 55 | return dir; |
49 | } | 56 | } |
50 | 57 | ||
51 | QFont KGlobalSettings::toolBarFont() | 58 | QFont KGlobalSettings::toolBarFont() |
52 | { | 59 | { |
53 | return QApplication::font(); | 60 | return QApplication::font(); |
54 | } | 61 | } |
55 | 62 | ||
56 | QColor KGlobalSettings::toolBarHighlightColor() | 63 | QColor KGlobalSettings::toolBarHighlightColor() |
57 | { | 64 | { |
58 | return QColor( "black" ); | 65 | return QColor( "black" ); |
59 | } | 66 | } |
60 | 67 | ||
61 | QColor KGlobalSettings::alternateBackgroundColor() | 68 | QColor KGlobalSettings::alternateBackgroundColor() |
62 | { | 69 | { |
63 | #ifdef DESKTOP_VERSION | 70 | return mAlternate; |
64 | return QColor( 235, 235, 235 ); | 71 | |
65 | #else | 72 | } |
66 | return QColor( 220, 220, 220 ); | 73 | void KGlobalSettings::setAlternateBackgroundColor(QColor c) |
67 | #endif | 74 | { |
75 | mAlternate = c; | ||
76 | |||
68 | } | 77 | } |
69 | 78 | ||
70 | QRect KGlobalSettings::desktopGeometry( QWidget * ) | 79 | QRect KGlobalSettings::desktopGeometry( QWidget * ) |
71 | { | 80 | { |
72 | return QApplication::desktop()->rect(); | 81 | return QApplication::desktop()->rect(); |
73 | } | 82 | } |
74 | 83 | ||
75 | /** | 84 | /** |
76 | * Returns whether KDE runs in single (default) or double click | 85 | * Returns whether KDE runs in single (default) or double click |
77 | * mode. | 86 | * mode. |
78 | * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html | 87 | * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html |
79 | * @return true if single click mode, or false if double click mode. | 88 | * @return true if single click mode, or false if double click mode. |
80 | **/ | 89 | **/ |
81 | bool KGlobalSettings::singleClick() | 90 | bool KGlobalSettings::singleClick() |
82 | { | 91 | { |
83 | KConfig *c = KGlobal::config(); | 92 | KConfig *c = KGlobal::config(); |
84 | KConfigGroupSaver cgs( c, "KDE" ); | 93 | KConfigGroupSaver cgs( c, "KDE" ); |
85 | return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); | 94 | return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); |
86 | } | 95 | } |