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