summaryrefslogtreecommitdiffabout
path: root/microkde/kglobalsettings.cpp
Unidiff
Diffstat (limited to 'microkde/kglobalsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kglobalsettings.cpp1
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,102 +1,103 @@
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
15QFont KGlobalSettings::generalFont() 16QFont 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}
31QFont KGlobalSettings::generalMaxFont() 32QFont 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
48QString KGlobalSettings::timeTrackerDir() 49QString 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}
57QString KGlobalSettings::backupDataDir() 58QString 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}
66QString KGlobalSettings::calendarDir() 67QString 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
76QFont KGlobalSettings::toolBarFont() 77QFont KGlobalSettings::toolBarFont()
77{ 78{
78 return QApplication::font(); 79 return QApplication::font();
79} 80}
80 81
81QColor KGlobalSettings::toolBarHighlightColor() 82QColor KGlobalSettings::toolBarHighlightColor()
82{ 83{
83 return QColor( "black" ); 84 return QColor( "black" );
84} 85}
85 86
86QColor KGlobalSettings::alternateBackgroundColor() 87QColor KGlobalSettings::alternateBackgroundColor()
87{ 88{
88 return mAlternate; 89 return mAlternate;
89 90
90} 91}
91void KGlobalSettings::setAlternateBackgroundColor(QColor c) 92void KGlobalSettings::setAlternateBackgroundColor(QColor c)
92{ 93{
93 mAlternate = c; 94 mAlternate = c;
94 95
95} 96}
96 97
97QRect KGlobalSettings::desktopGeometry( QWidget * ) 98QRect KGlobalSettings::desktopGeometry( QWidget * )
98{ 99{
99 return QApplication::desktop()->rect(); 100 return QApplication::desktop()->rect();
100} 101}
101 102
102 /** 103 /**