author | zautrix <zautrix> | 2005-02-08 16:40:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-08 16:40:46 (UTC) |
commit | 720510bf933a86211f8e9e2465788d141f0f1149 (patch) (unidiff) | |
tree | 65fb4d3ab30fed082d8c8b513e1cbed910373178 | |
parent | 78c70cfbbe79243d8b0ec40f8f6438c99046e12b (diff) | |
download | kdepimpi-720510bf933a86211f8e9e2465788d141f0f1149.zip kdepimpi-720510bf933a86211f8e9e2465788d141f0f1149.tar.gz kdepimpi-720510bf933a86211f8e9e2465788d141f0f1149.tar.bz2 |
ffff
-rw-r--r-- | korganizer/navigatorbar.cpp | 10 | ||||
-rw-r--r-- | libkdepim/kdatepicker.cpp | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 2b8fd4f..7ba97c8 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp | |||
@@ -42,50 +42,56 @@ | |||
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 | ||
53 | NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name ) | 53 | NavigatorBar::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 | ||
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index d6e9b51..c13734f 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp | |||
@@ -31,54 +31,56 @@ | |||
31 | #include <qapplication.h> | 31 | #include <qapplication.h> |
32 | #include <qlineedit.h> | 32 | #include <qlineedit.h> |
33 | #include <qvalidator.h> | 33 | #include <qvalidator.h> |
34 | #include <kdebug.h> | 34 | #include <kdebug.h> |
35 | #include <knotifyclient.h> | 35 | #include <knotifyclient.h> |
36 | #include <kglobalsettings.h> | 36 | #include <kglobalsettings.h> |
37 | #include "kdatetbl.h" | 37 | #include "kdatetbl.h" |
38 | #include "kdateedit.h" | 38 | #include "kdateedit.h" |
39 | //#include "kdatepicker.moc" | 39 | //#include "kdatepicker.moc" |
40 | 40 | ||
41 | 41 | ||
42 | KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) | 42 | KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) |
43 | : QFrame(parent,name), | 43 | : QFrame(parent,name), |
44 | yearForward(new QToolButton(this)), | 44 | yearForward(new QToolButton(this)), |
45 | yearBackward(new QToolButton(this)), | 45 | yearBackward(new QToolButton(this)), |
46 | monthForward(new QToolButton(this)), | 46 | monthForward(new QToolButton(this)), |
47 | monthBackward(new QToolButton(this)), | 47 | monthBackward(new QToolButton(this)), |
48 | selectMonth(new QToolButton(this)), | 48 | selectMonth(new QToolButton(this)), |
49 | selectYear(new QToolButton(this)), | 49 | selectYear(new QToolButton(this)), |
50 | //line(new QLineEdit(this)), | 50 | //line(new QLineEdit(this)), |
51 | val(new KDateValidator(this)) | 51 | val(new KDateValidator(this)) |
52 | //table(new KDateTable(this)), | 52 | //table(new KDateTable(this)), |
53 | //fontsize(1) | 53 | //fontsize(1) |
54 | { | 54 | { |
55 | setFont ( KGlobalSettings::generalFont() ); | 55 | QFont fo = KGlobalSettings::generalFont(); |
56 | table = new KDateTable(this); | ||
57 | int add = 2; | 56 | int add = 2; |
58 | if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | 57 | if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) |
59 | add += 4; | 58 | add += 4; |
60 | setFontSize(font().pointSize()+add); | 59 | fo.setPointSize(fo.pointSize()+add ); |
60 | setFont( fo ); | ||
61 | table = new KDateTable(this); | ||
62 | setFontSize(font().pointSize()); | ||
61 | //line->setValidator(val); | 63 | //line->setValidator(val); |
62 | lineDate = new KDateEdit( this, "dateediipicker", true ); | 64 | lineDate = new KDateEdit( this, "dateediipicker", true ); |
63 | yearForward->setPixmap(SmallIcon("2rightarrowB")); | 65 | yearForward->setPixmap(SmallIcon("2rightarrowB")); |
64 | yearBackward->setPixmap(SmallIcon("2leftarrowB")); | 66 | yearBackward->setPixmap(SmallIcon("2leftarrowB")); |
65 | monthForward->setPixmap(SmallIcon("1rightarrowB")); | 67 | monthForward->setPixmap(SmallIcon("1rightarrowB")); |
66 | monthBackward->setPixmap(SmallIcon("1leftarrowB")); | 68 | monthBackward->setPixmap(SmallIcon("1leftarrowB")); |
67 | setDate(dt); // set button texts | 69 | setDate(dt); // set button texts |
68 | connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate))); | 70 | connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate))); |
69 | connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot())); | 71 | connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot())); |
70 | connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked())); | 72 | connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked())); |
71 | connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked())); | 73 | connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked())); |
72 | connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked())); | 74 | connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked())); |
73 | connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked())); | 75 | connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked())); |
74 | connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); | 76 | connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); |
75 | connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); | 77 | connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); |
76 | //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); | 78 | //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); |
77 | connect(lineDate, SIGNAL(dateChanged(QDate)), SLOT(slotSetDate(QDate))); | 79 | connect(lineDate, SIGNAL(dateChanged(QDate)), SLOT(slotSetDate(QDate))); |
78 | connect(lineDate, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); | 80 | connect(lineDate, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); |
79 | table->setFocus(); | 81 | table->setFocus(); |
80 | 82 | ||
81 | } | 83 | } |
82 | 84 | ||
83 | KDatePicker::~KDatePicker() | 85 | KDatePicker::~KDatePicker() |
84 | { | 86 | { |