Diffstat (limited to 'microkde/kglobalsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kglobalsettings.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index 2e483e9..1f08255 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp | |||
@@ -1,113 +1,114 @@ | |||
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 | #include <QDesktopWidget> | ||
7 | 8 | ||
8 | #ifdef DESKTOP_VERSION | 9 | #ifdef DESKTOP_VERSION |
9 | QColor KGlobalSettings::mAlternate = QColor( 235, 235, 235 ); | 10 | QColor KGlobalSettings::mAlternate = QColor( 235, 235, 235 ); |
10 | #else | 11 | #else |
11 | QColor KGlobalSettings::mAlternate = QColor( 210, 210, 210 ); | 12 | QColor KGlobalSettings::mAlternate = QColor( 210, 210, 210 ); |
12 | #endif | 13 | #endif |
13 | 14 | ||
14 | 15 | ||
15 | QFont KGlobalSettings::generalFont() | 16 | QFont KGlobalSettings::generalFont() |
16 | { | 17 | { |
17 | int size = 12; | 18 | int size = 12; |
18 | if (QApplication::desktop()->width() < 480 ) { | 19 | if (QApplication::desktop()->width() < 480 ) { |
19 | size = 10; | 20 | size = 10; |
20 | } | 21 | } |
21 | #ifndef DESKTOP_VERSION | 22 | #ifndef DESKTOP_VERSION |
22 | else | 23 | else |
23 | if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | 24 | if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) |
24 | size = 18; | 25 | size = 18; |
25 | #endif | 26 | #endif |
26 | QFont f = QApplication::font(); | 27 | QFont f = QApplication::font(); |
27 | //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); | 28 | //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); |
28 | f.setPointSize( size ); | 29 | f.setPointSize( size ); |
29 | return f; | 30 | return f; |
30 | } | 31 | } |
31 | QFont KGlobalSettings::generalMaxFont() | 32 | QFont KGlobalSettings::generalMaxFont() |
32 | { | 33 | { |
33 | int size = 12; | 34 | int size = 12; |
34 | if (QApplication::desktop()->width() < 480 ) { | 35 | if (QApplication::desktop()->width() < 480 ) { |
35 | size = 10; | 36 | size = 10; |
36 | } | 37 | } |
37 | #ifndef DESKTOP_VERSION | 38 | #ifndef DESKTOP_VERSION |
38 | else | 39 | else |
39 | if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | 40 | if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) |
40 | size = 18; | 41 | size = 18; |
41 | #endif | 42 | #endif |
42 | QFont f = QApplication::font(); | 43 | QFont f = QApplication::font(); |
43 | if ( f.pointSize() > size ) | 44 | if ( f.pointSize() > size ) |
44 | f.setPointSize( size ); | 45 | f.setPointSize( size ); |
45 | return f; | 46 | return f; |
46 | } | 47 | } |
47 | 48 | ||
48 | QString KGlobalSettings::timeTrackerDir() | 49 | QString KGlobalSettings::timeTrackerDir() |
49 | { | 50 | { |
50 | static QString dir; | 51 | static QString dir; |
51 | if ( dir.isEmpty() ) { | 52 | if ( dir.isEmpty() ) { |
52 | dir = locateLocal( "data", "timetrackerdir/d.ttl" ); | 53 | dir = locateLocal( "data", "timetrackerdir/d.ttl" ); |
53 | dir = dir.left ( dir.length() - 5); | 54 | dir = dir.left ( dir.length() - 5); |
54 | } | 55 | } |
55 | return dir; | 56 | return dir; |
56 | } | 57 | } |
57 | QString KGlobalSettings::backupDataDir() | 58 | QString KGlobalSettings::backupDataDir() |
58 | { | 59 | { |
59 | static QString dir; | 60 | static QString dir; |
60 | if ( dir.isEmpty() ) { | 61 | if ( dir.isEmpty() ) { |
61 | dir = locateLocal( "data", "backupdir/d.ttl" ); | 62 | dir = locateLocal( "data", "backupdir/d.ttl" ); |
62 | dir = dir.left ( dir.length() - 5); | 63 | dir = dir.left ( dir.length() - 5); |
63 | } | 64 | } |
64 | return dir; | 65 | return dir; |
65 | } | 66 | } |
66 | QString KGlobalSettings::calendarDir() | 67 | QString KGlobalSettings::calendarDir() |
67 | { | 68 | { |
68 | static QString dir; | 69 | static QString dir; |
69 | if ( dir.isEmpty() ) { | 70 | if ( dir.isEmpty() ) { |
70 | dir = locateLocal( "data", "korganizer/d.ttl" ); | 71 | dir = locateLocal( "data", "korganizer/d.ttl" ); |
71 | dir = dir.left ( dir.length() - 5); | 72 | dir = dir.left ( dir.length() - 5); |
72 | } | 73 | } |
73 | return dir; | 74 | return dir; |
74 | } | 75 | } |
75 | 76 | ||
76 | QFont KGlobalSettings::toolBarFont() | 77 | QFont KGlobalSettings::toolBarFont() |
77 | { | 78 | { |
78 | return QApplication::font(); | 79 | return QApplication::font(); |
79 | } | 80 | } |
80 | 81 | ||
81 | QColor KGlobalSettings::toolBarHighlightColor() | 82 | QColor KGlobalSettings::toolBarHighlightColor() |
82 | { | 83 | { |
83 | return QColor( "black" ); | 84 | return QColor( "black" ); |
84 | } | 85 | } |
85 | 86 | ||
86 | QColor KGlobalSettings::alternateBackgroundColor() | 87 | QColor KGlobalSettings::alternateBackgroundColor() |
87 | { | 88 | { |
88 | return mAlternate; | 89 | return mAlternate; |
89 | 90 | ||
90 | } | 91 | } |
91 | void KGlobalSettings::setAlternateBackgroundColor(QColor c) | 92 | void KGlobalSettings::setAlternateBackgroundColor(QColor c) |
92 | { | 93 | { |
93 | mAlternate = c; | 94 | mAlternate = c; |
94 | 95 | ||
95 | } | 96 | } |
96 | 97 | ||
97 | QRect KGlobalSettings::desktopGeometry( QWidget * ) | 98 | QRect KGlobalSettings::desktopGeometry( QWidget * ) |
98 | { | 99 | { |
99 | return QApplication::desktop()->rect(); | 100 | return QApplication::desktop()->rect(); |
100 | } | 101 | } |
101 | 102 | ||
102 | /** | 103 | /** |
103 | * Returns whether KDE runs in single (default) or double click | 104 | * Returns whether KDE runs in single (default) or double click |
104 | * mode. | 105 | * mode. |
105 | * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html | 106 | * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html |
106 | * @return true if single click mode, or false if double click mode. | 107 | * @return true if single click mode, or false if double click mode. |
107 | **/ | 108 | **/ |
108 | bool KGlobalSettings::singleClick() | 109 | bool KGlobalSettings::singleClick() |
109 | { | 110 | { |
110 | KConfig *c = KGlobal::config(); | 111 | KConfig *c = KGlobal::config(); |
111 | KConfigGroupSaver cgs( c, "KDE" ); | 112 | KConfigGroupSaver cgs( c, "KDE" ); |
112 | return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); | 113 | return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); |
113 | } | 114 | } |