summaryrefslogtreecommitdiffabout
path: root/korganizer/navigatorbar.cpp
authorzautrix <zautrix>2005-02-08 16:40:46 (UTC)
committer zautrix <zautrix>2005-02-08 16:40:46 (UTC)
commit720510bf933a86211f8e9e2465788d141f0f1149 (patch) (unidiff)
tree65fb4d3ab30fed082d8c8b513e1cbed910373178 /korganizer/navigatorbar.cpp
parent78c70cfbbe79243d8b0ec40f8f6438c99046e12b (diff)
downloadkdepimpi-720510bf933a86211f8e9e2465788d141f0f1149.zip
kdepimpi-720510bf933a86211f8e9e2465788d141f0f1149.tar.gz
kdepimpi-720510bf933a86211f8e9e2465788d141f0f1149.tar.bz2
ffff
Diffstat (limited to 'korganizer/navigatorbar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/navigatorbar.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index 2b8fd4f..7ba97c8 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -18,98 +18,104 @@
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 <kglobalsettings.h>
44#include "koprefs.h" 44#include "koprefs.h"
45#ifndef KORG_NOPLUGINS 45#ifndef KORG_NOPLUGINS
46#include "kocore.h" 46#include "kocore.h"
47#endif 47#endif
48 48
49#include <kcalendarsystem.h> 49#include <kcalendarsystem.h>
50 50
51#include "navigatorbar.h" 51#include "navigatorbar.h"
52 52
53NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name ) 53NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name )
54 : QWidget( parent, name ) 54 : QWidget( parent, name )
55{ 55{
56 QBoxLayout *topLayout = new QHBoxLayout( this ); 56 QBoxLayout *topLayout = new QHBoxLayout( this );
57 57
58 // Set up the control buttons and date label 58 // Set up the control buttons and date label
59 mCtrlFrame = new QFrame( this ); 59 mCtrlFrame = new QFrame( this );
60 mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised); 60 mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised);
61 mCtrlFrame->setLineWidth(1); 61 mCtrlFrame->setLineWidth(1);
62 62
63 topLayout->addWidget( mCtrlFrame ); 63 topLayout->addWidget( mCtrlFrame );
64 64
65 QFont tfont = KGlobalSettings::generalFont();//font(); 65 QFont tfont = KGlobalSettings::generalFont();//font();
66 if ( QApplication::desktop()->width() >= 480 ) 66 int add = 0;
67 tfont.setPointSize(tfont.pointSize()+2); 67 if ( QApplication::desktop()->width() >= 480 ) {
68 add = 2;
69 if ( QString ( name ) == QString("useBigPixmaps") )
70 add += 2;
71 }
72 if ( add )
73 tfont.setPointSize(tfont.pointSize()+add);
68 tfont.setBold(true); 74 tfont.setBold(true);
69 75
70 bool isRTL = KOGlobals::self()->reverseLayout(); 76 bool isRTL = KOGlobals::self()->reverseLayout();
71#ifndef DESKTOP_VERSION 77#ifndef DESKTOP_VERSION
72 bool isDesktop = false; 78 bool isDesktop = false;
73#else 79#else
74 bool isDesktop = true; 80 bool isDesktop = true;
75#endif 81#endif
76 if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 ) 82 if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 )
77 isDesktop = true; 83 isDesktop = true;
78 // Create backward navigation buttons 84 // Create backward navigation buttons
79 mPrevYear = new QPushButton( mCtrlFrame ); 85 mPrevYear = new QPushButton( mCtrlFrame );
80 mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) ); 86 mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) );
81 QToolTip::add( mPrevYear, i18n("Previous Year") ); 87 QToolTip::add( mPrevYear, i18n("Previous Year") );
82 88
83 mPrevMonth = new QPushButton( mCtrlFrame ); 89 mPrevMonth = new QPushButton( mCtrlFrame );
84 mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); 90 mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") );
85 QToolTip::add( mPrevMonth, i18n("Previous Month") ); 91 QToolTip::add( mPrevMonth, i18n("Previous Month") );
86 92
87 // Create forward navigation buttons 93 // Create forward navigation buttons
88 mNextMonth = new QPushButton( mCtrlFrame ); 94 mNextMonth = new QPushButton( mCtrlFrame );
89 mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); 95 mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") );
90 QToolTip::add( mNextMonth, i18n("Next Month") ); 96 QToolTip::add( mNextMonth, i18n("Next Month") );
91 97
92 mNextYear = new QPushButton( mCtrlFrame ); 98 mNextYear = new QPushButton( mCtrlFrame );
93 mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); 99 mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") );
94 QToolTip::add( mNextYear, i18n("Next Year") ); 100 QToolTip::add( mNextYear, i18n("Next Year") );
95 mSelectMonth = new QPushButton( mCtrlFrame ); 101 mSelectMonth = new QPushButton( mCtrlFrame );
96 // Create month name label 102 // Create month name label
97 //selectMonth->setFont( tfont ); 103 //selectMonth->setFont( tfont );
98 // selectMonth->setAlignment( AlignCenter ); 104 // selectMonth->setAlignment( AlignCenter );
99 //mDateLabel = new QLabel( selectMonth ); 105 //mDateLabel = new QLabel( selectMonth );
100 //mDateLabel->setFont( tfont ); 106 //mDateLabel->setFont( tfont );
101 //mDateLabel->setAlignment( AlignCenter ); 107 //mDateLabel->setAlignment( AlignCenter );
102 if ( QString ( name ) == QString("useBigPixmaps") ) { 108 if ( QString ( name ) == QString("useBigPixmaps") ) {
103 mNextMonth->setFlat( true); 109 mNextMonth->setFlat( true);
104 mNextYear->setFlat( true); 110 mNextYear->setFlat( true);
105 mSelectMonth->setFlat( true); 111 mSelectMonth->setFlat( true);
106 mPrevYear->setFlat( true); 112 mPrevYear->setFlat( true);
107 mPrevMonth->setFlat( true); 113 mPrevMonth->setFlat( true);
108 } 114 }
109 mSelectMonth->setFont( tfont ); 115 mSelectMonth->setFont( tfont );
110 // Set minimum width to width of widest month name label 116 // Set minimum width to width of widest month name label
111 int i; 117 int i;
112 int maxwidth = 0; 118 int maxwidth = 0;
113 QFontMetrics fm ( mSelectMonth->font() ); 119 QFontMetrics fm ( mSelectMonth->font() );
114 int width = fm.width("September '00" ); 120 int width = fm.width("September '00" );
115// for( i = 1; i <= KOGlobals::self()->calendarSystem()->monthsInYear(date); 121// for( i = 1; i <= KOGlobals::self()->calendarSystem()->monthsInYear(date);