summaryrefslogtreecommitdiffabout
path: root/korganizer/navigatorbar.cpp
Unidiff
Diffstat (limited to 'korganizer/navigatorbar.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/navigatorbar.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index f05e6f6..4a31c77 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -1,112 +1,113 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24 24
25#include <qstring.h> 25#include <qstring.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qframe.h> 29#include <qframe.h>
30#include <qlabel.h> 30#include <qlabel.h>
31#include <qpopupmenu.h> 31#include <qpopupmenu.h>
32#include <qapplication.h> 32#include <qapplication.h>
33 33
34#include <kdebug.h> 34#include <kdebug.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kglobal.h> 36#include <kglobal.h>
37#include <kiconloader.h> 37#include <kiconloader.h>
38#include "libkdepim/kdatepicker.h" 38#include "libkdepim/kdatepicker.h"
39#include <knotifyclient.h> 39#include <knotifyclient.h>
40#include "kdatetbl.h" 40#include "kdatetbl.h"
41 41
42#include "koglobals.h" 42#include "koglobals.h"
43#include <kglobalsettings.h>
43#include "koprefs.h" 44#include "koprefs.h"
44#ifndef KORG_NOPLUGINS 45#ifndef KORG_NOPLUGINS
45#include "kocore.h" 46#include "kocore.h"
46#endif 47#endif
47 48
48#include <kcalendarsystem.h> 49#include <kcalendarsystem.h>
49 50
50#include "navigatorbar.h" 51#include "navigatorbar.h"
51 52
52NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name ) 53NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name )
53 : QWidget( parent, name ) 54 : QWidget( parent, name )
54{ 55{
55 QBoxLayout *topLayout = new QHBoxLayout( this ); 56 QBoxLayout *topLayout = new QHBoxLayout( this );
56 57
57 // Set up the control buttons and date label 58 // Set up the control buttons and date label
58 mCtrlFrame = new QFrame( this ); 59 mCtrlFrame = new QFrame( this );
59 mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised); 60 mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised);
60 mCtrlFrame->setLineWidth(1); 61 mCtrlFrame->setLineWidth(1);
61 62
62 topLayout->addWidget( mCtrlFrame ); 63 topLayout->addWidget( mCtrlFrame );
63 64
64 QFont tfont = font(); 65 QFont tfont = KGlobalSettings::generalFont();//font();
65 if ( QApplication::desktop()->width() >= 480 ) 66 if ( QApplication::desktop()->width() >= 480 )
66 tfont.setPointSize(tfont.pointSize()+2); 67 tfont.setPointSize(tfont.pointSize()+2);
67 tfont.setBold(true); 68 tfont.setBold(true);
68 69
69 bool isRTL = KOGlobals::self()->reverseLayout(); 70 bool isRTL = KOGlobals::self()->reverseLayout();
70#ifndef DESKTOP_VERSION 71#ifndef DESKTOP_VERSION
71 bool isDesktop = false; 72 bool isDesktop = false;
72#else 73#else
73 bool isDesktop = true; 74 bool isDesktop = true;
74#endif 75#endif
75 if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 ) 76 if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 )
76 isDesktop = true; 77 isDesktop = true;
77 // Create backward navigation buttons 78 // Create backward navigation buttons
78 mPrevYear = new QPushButton( mCtrlFrame ); 79 mPrevYear = new QPushButton( mCtrlFrame );
79 mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) ); 80 mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) );
80 QToolTip::add( mPrevYear, i18n("Previous Year") ); 81 QToolTip::add( mPrevYear, i18n("Previous Year") );
81 82
82 mPrevMonth = new QPushButton( mCtrlFrame ); 83 mPrevMonth = new QPushButton( mCtrlFrame );
83 mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); 84 mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") );
84 QToolTip::add( mPrevMonth, i18n("Previous Month") ); 85 QToolTip::add( mPrevMonth, i18n("Previous Month") );
85 86
86 // Create forward navigation buttons 87 // Create forward navigation buttons
87 mNextMonth = new QPushButton( mCtrlFrame ); 88 mNextMonth = new QPushButton( mCtrlFrame );
88 mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); 89 mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") );
89 QToolTip::add( mNextMonth, i18n("Next Month") ); 90 QToolTip::add( mNextMonth, i18n("Next Month") );
90 91
91 mNextYear = new QPushButton( mCtrlFrame ); 92 mNextYear = new QPushButton( mCtrlFrame );
92 mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); 93 mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") );
93 QToolTip::add( mNextYear, i18n("Next Year") ); 94 QToolTip::add( mNextYear, i18n("Next Year") );
94 mSelectMonth = new QPushButton( mCtrlFrame ); 95 mSelectMonth = new QPushButton( mCtrlFrame );
95 // Create month name label 96 // Create month name label
96 //selectMonth->setFont( tfont ); 97 //selectMonth->setFont( tfont );
97 // selectMonth->setAlignment( AlignCenter ); 98 // selectMonth->setAlignment( AlignCenter );
98 //mDateLabel = new QLabel( selectMonth ); 99 //mDateLabel = new QLabel( selectMonth );
99 //mDateLabel->setFont( tfont ); 100 //mDateLabel->setFont( tfont );
100 //mDateLabel->setAlignment( AlignCenter ); 101 //mDateLabel->setAlignment( AlignCenter );
101 if ( QString ( name ) == QString("useBigPixmaps") ) { 102 if ( QString ( name ) == QString("useBigPixmaps") ) {
102 mNextMonth->setFlat( true); 103 mNextMonth->setFlat( true);
103 mNextYear->setFlat( true); 104 mNextYear->setFlat( true);
104 mSelectMonth->setFlat( true); 105 mSelectMonth->setFlat( true);
105 mPrevYear->setFlat( true); 106 mPrevYear->setFlat( true);
106 mPrevMonth->setFlat( true); 107 mPrevMonth->setFlat( true);
107 } 108 }
108 mSelectMonth->setFont( tfont ); 109 mSelectMonth->setFont( tfont );
109 // Set minimum width to width of widest month name label 110 // Set minimum width to width of widest month name label
110 int i; 111 int i;
111 int maxwidth = 0; 112 int maxwidth = 0;
112 QFontMetrics fm ( mSelectMonth->font() ); 113 QFontMetrics fm ( mSelectMonth->font() );