summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/kaddressbook/icons16/3leftarrowB.pngbin0 -> 668 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons16/3rightarrowB.pngbin0 -> 673 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons22/3leftarrowB.pngbin0 -> 668 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons22/3rightarrowB.pngbin0 -> 673 bytes
-rw-r--r--korganizer/koagendaview.cpp28
-rw-r--r--korganizer/koagendaview.h3
-rw-r--r--korganizer/koviewmanager.cpp4
-rw-r--r--korganizer/navigatorbar.cpp8
-rw-r--r--libkdepim/kdatepicker.cpp8
9 files changed, 18 insertions, 33 deletions
diff --git a/bin/kdepim/kaddressbook/icons16/3leftarrowB.png b/bin/kdepim/kaddressbook/icons16/3leftarrowB.png
new file mode 100644
index 0000000..5f8fc82
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons16/3leftarrowB.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons16/3rightarrowB.png b/bin/kdepim/kaddressbook/icons16/3rightarrowB.png
new file mode 100644
index 0000000..7fc4b0c
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons16/3rightarrowB.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons22/3leftarrowB.png b/bin/kdepim/kaddressbook/icons22/3leftarrowB.png
new file mode 100644
index 0000000..5f8fc82
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons22/3leftarrowB.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons22/3rightarrowB.png b/bin/kdepim/kaddressbook/icons22/3rightarrowB.png
new file mode 100644
index 0000000..7fc4b0c
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons22/3rightarrowB.png
Binary files differ
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 8001c8f..acf43bd 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -322,128 +322,127 @@ void EventIndicator::drawContents(QPainter *p)
}
}
pa.end();
}
}
void EventIndicator::setXOffset( int x )
{
mXOffset = x;
}
void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w )
{
mPaintWidget = w;
setMaximumHeight(0);
setMinimumHeight(0);
}
void EventIndicator::changeColumns(int columns)
{
mColumns = columns;
mEnabled.resize(mColumns);
update();
}
void EventIndicator::enableColumn(int column, bool enable)
{
mEnabled[column] = enable;
}
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
KOEventView (cal,parent,name)
{
mBlockUpdating = true;
mStartHour = 8;
mSelectedDates.append(QDate::currentDate());
mLayoutDayLabels = 0;
mDayLabelsFrame = 0;
mDayLabels = 0;
bool isRTL = KOGlobals::self()->reverseLayout();
-
+ QPixmap expandPix;
if ( KOPrefs::instance()->mVerticalScreen ) {
- mExpandedPixmap = SmallIcon( "1downarrow" );
- mNotExpandedPixmap = SmallIcon( "1uparrow" );
+ expandPix = SmallIcon( "1updownarrow" );
} else {
- mExpandedPixmap = SmallIcon( isRTL ? "1leftarrow" : "1rightarrow" );
- mNotExpandedPixmap = SmallIcon( isRTL ? "1rightarrow" : "1leftarrow" );
+ expandPix = SmallIcon("1leftrightarrow" );
}
QBoxLayout *topLayout = new QVBoxLayout(this);
// Create day name labels for agenda columns
// Create agenda splitter
mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this);
mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
topLayout->addWidget( mSplitterAgenda );
mAllDayFrame = new QHBox(mSplitterAgenda);
mAllDayFrame->setFocusPolicy(NoFocus);
QWidget *agendaFrame = new QWidget(mSplitterAgenda);
agendaFrame->setFocusPolicy(NoFocus);
// Create all-day agenda widget
mDummyAllDayLeft = new QVBox( mAllDayFrame );
mExpandButton = new QPushButton(mDummyAllDayLeft);
- mExpandButton->setPixmap( mNotExpandedPixmap );
- int widebut = mExpandButton->sizeHint().width();
+ mExpandButton->setPixmap( expandPix );
+ int widebut = mExpandButton->sizeHint().width()+4;
+ int heibut = mExpandButton->sizeHint().height()+4;
+ if ( heibut > widebut )
+ widebut = heibut ;
if ( QApplication::desktop()->width() < 480 )
- widebut = widebut*2;
- else
- widebut = (widebut*3) / 2;
+ widebut = widebut*3/2;
//mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed,
// QSizePolicy::Fixed ) );
mExpandButton->setFixedSize( widebut, widebut);
connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) );
mExpandButton->setFocusPolicy(NoFocus);
mAllDayAgenda = new KOAgenda(1,mAllDayFrame);
mAllDayAgenda->setFocusPolicy(NoFocus);
QLabel *dummyAllDayRight = new QLabel (mAllDayFrame);
// Create event context menu for all day agenda
mAllDayAgendaPopup = eventPopup();
connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
// Create agenda frame
QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3);
// QHBox *agendaFrame = new QHBox(splitterAgenda);
// create event indicator bars
mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame);
#ifndef DESKTOP_VERSION
// FIX
mEventIndicatorTop->setPaintWidget( mSplitterAgenda );
#endif
mDayLabelsFrame = new QHBox(agendaFrame);
//topLayout->addWidget(mDayLabelsFrame);
mDayLabels = new QFrame (mDayLabelsFrame);
mLayoutDayLabels = new QHBoxLayout(mDayLabels);
agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2);
agendaLayout->addWidget(mEventIndicatorTop,1,1);
mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom,
agendaFrame);
agendaLayout->addWidget(mEventIndicatorBottom,3,1);
QWidget *dummyAgendaRight = new QWidget(agendaFrame);
agendaLayout->addWidget(dummyAgendaRight,1,2);
// Create time labels
mTimeLabels = new TimeLabels(24,agendaFrame);
agendaLayout->addWidget(mTimeLabels,2,0);
connect(mTimeLabels,SIGNAL( scaleChanged()),
this,SLOT(updateConfig()));
// Create agenda
mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame);
agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2);
agendaLayout->setColStretch(1,1);
mAgenda->setFocusPolicy(NoFocus);
@@ -1411,105 +1410,96 @@ void KOAgendaView::writeSettings(KConfig *config)
//qDebug("write %d %d ", list[0],list[1] );
//#endif
}
void KOAgendaView::setHolidayMasks()
{
mHolidayMask.resize(mSelectedDates.count());
uint i;
for(i=0;i<mSelectedDates.count();++i) {
QDate date = mSelectedDates[i];
bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6);
bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7);
bool showHoliday = false;
if ( KOPrefs::instance()->mExcludeHolidays ) {
QPtrList<Event> events = calendar()->events( date, true );
Event *event;
for( event = events.first(); event; event = events.next() ) {
if ( event->isHoliday()) {
showHoliday = true;
break;
}
}
}
#ifndef KORG_NOPLUGINS
bool showHoliday = KOPrefs::instance()->mExcludeHolidays &&
!KOCore::self()->holiday(date).isEmpty();
#endif
bool showDay = showSaturday || showSunday || showHoliday;
if (showDay) {
mHolidayMask.at(i) = true;
} else {
mHolidayMask.at(i) = false;
}
}
mAgenda->setHolidayMask(&mHolidayMask);
mAllDayAgenda->setHolidayMask(&mHolidayMask);
}
void KOAgendaView::setContentsPos(int y)
{
mAgenda->setContentsPos(0,y);
}
-void KOAgendaView::setExpandedButton( bool expanded )
-{
- if ( expanded ) {
- mExpandButton->setPixmap( mExpandedPixmap );
- } else {
- mExpandButton->setPixmap( mNotExpandedPixmap );
- }
-}
-
void KOAgendaView::clearSelection()
{
mAgenda->deselectItem();
mAllDayAgenda->deselectItem();
}
void KOAgendaView::newTimeSpanSelectedAllDay(int gxStart, int gyStart,
int gxEnd, int gyEnd)
{
mTimeSpanInAllDay = true;
newTimeSpanSelected(gxStart,gyStart,gxEnd,gyEnd);
}
void KOAgendaView::newTimeSpanSelected(int gxStart, int gyStart,
int gxEnd, int gyEnd)
{
if (!mSelectedDates.count()) return;
QDate dayStart = mSelectedDates[gxStart];
QDate dayEnd = mSelectedDates[gxEnd];
QTime timeStart = mAgenda->gyToTime(gyStart);
QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 );
QDateTime dtStart(dayStart,timeStart);
QDateTime dtEnd(dayEnd,timeEnd);
mTimeSpanBegin = dtStart;
mTimeSpanEnd = dtEnd;
}
void KOAgendaView::deleteSelectedDateTime()
{
mTimeSpanBegin.setDate(QDate());
mTimeSpanEnd.setDate(QDate());
mTimeSpanInAllDay = false;
}
void KOAgendaView::keyPressEvent ( QKeyEvent * e )
{
e->ignore();
}
void KOAgendaView::scrollOneHourUp()
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index 0cb9310..57b4e46 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -158,135 +158,132 @@ class KOAgendaView : public KOEventView {
/** returns the currently selected events */
virtual QPtrList<Incidence> selectedIncidences();
/** returns the currently selected events */
virtual DateList selectedDates();
/** Remove all events from view */
void clearView();
KOAgenda *agenda() { return mAgenda;}
virtual void printPreview(CalPrinter *calPrinter,
const QDate &, const QDate &);
/** start-datetime of selection */
QDateTime selectionStart() {return mTimeSpanBegin;}
/** end-datetime of selection */
QDateTime selectionEnd() {return mTimeSpanEnd;}
/** returns true if selection is for whole day */
bool selectedIsAllDay() {return mTimeSpanInAllDay;}
/** make selected start/end invalid */
void deleteSelectedDateTime();
void repaintAgenda();
public slots:
void setInitStartHour();
virtual void updateView();
virtual void updateConfig();
virtual void showDates(const QDate &start, const QDate &end);
virtual void showEvents(QPtrList<Event> eventList);
void updateTodo( Todo *, int );
void changeEventDisplay(Event *, int);
void clearSelection();
void newTodo(int gx,int gy);
void newEvent(int gx,int gy);
void newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd);
void newEventAllDay(int gx, int gy);
void newTodoAllDay(int gx, int gy);
void startDrag(Event *);
void readSettings();
void readSettings(KConfig *);
void writeSettings(KConfig *);
void setContentsPos(int y);
- void setExpandedButton( bool expanded );
void scrollOneHourUp();
void scrollOneHourDown();
void addToCalSlot(Incidence *, Incidence *);
signals:
void showDateView( int, QDate );
void newTodoSignal( QDateTime ,bool );
void toggleExpand();
void selectWeekNum( int );
void todoMoved( Todo *, int );
void incidenceChanged(Incidence * , int );
// void cloneIncidenceSignal(Incidence *);
protected:
KOAgendaButton* getNewDaylabel();
bool mBlockUpdating;
int mUpcomingWidth;
/** Fill agenda beginning with date startDate */
void fillAgenda(const QDate &startDate);
void resizeEvent( QResizeEvent* e );
/** Fill agenda using the current set value for the start date */
void fillAgenda();
/** Create labels for the selected dates. */
void createDayLabels();
/**
Set the masks on the agenda widgets indicating, which days are holidays.
*/
void setHolidayMasks();
protected slots:
void slotDaylabelClicked( int );
/** Update event belonging to agenda item */
void updateEventDates(KOAgendaItem *item, int mode = -1);
//void updateMovedTodo();
void updateEventIndicatorTop(int newY);
void updateEventIndicatorBottom(int newY);
/** Updates data for selected timespan */
void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd);
/** Updates data for selected timespan for all day event*/
void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd);
private:
// view widgets
QFrame *mDayLabels;
QHBox *mDayLabelsFrame;
QBoxLayout *mLayoutDayLabels;
QFrame *mAllDayFrame;
KOAgenda *mAllDayAgenda;
KOAgenda *mAgenda;
TimeLabels *mTimeLabels;
QWidget *mDummyAllDayLeft;
KDGanttMinimizeSplitter* mSplitterAgenda;
QPushButton *mExpandButton;
DateList mSelectedDates; // List of dates to be displayed
int mViewType;
bool mWeekStartsMonday;
int mStartHour;
KOEventPopupMenu *mAgendaPopup;
KOEventPopupMenu *mAllDayAgendaPopup;
EventIndicator *mEventIndicatorTop;
EventIndicator *mEventIndicatorBottom;
QMemArray<int> mMinY;
QMemArray<int> mMaxY;
QMemArray<bool> mHolidayMask;
- QPixmap mExpandedPixmap;
- QPixmap mNotExpandedPixmap;
QPtrList<KOAgendaButton> mDayLabelsList;
QDateTime mTimeSpanBegin;
QDateTime mTimeSpanEnd;
bool mTimeSpanInAllDay;
void keyPressEvent ( QKeyEvent * e );
};
#endif // KOAGENDAVIEW_H
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 5a2dce3..31ee5e2 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -351,99 +351,97 @@ void KOViewManager::showListView()
mMainView->setBlockShowDates( false );
}
showView(mListView, KOPrefs::instance()->mFullViewTodo);
//mFlagShowNextxDays = temp;
}
void KOViewManager::showAgendaView( bool fullScreen )
{
mMainView->dialogManager()->hideSearchDialog();
// qDebug("KOViewManager::showAgendaView ");
bool full;
full = fullScreen;
if (!mAgendaView) {
full = false;
mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView");
addView(mAgendaView);
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold );
#endif
connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )),
mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) ));
// SIGNALS/SLOTS FOR DAY/WEEK VIEW
connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate )));
connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)),
mMainView, SLOT(newTodoDateTime(QDateTime,bool)));
connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)),
mMainView, SLOT(newEvent(QDateTime)));
connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)),
mMainView, SLOT(newEvent(QDateTime,QDateTime)));
connect(mAgendaView,SIGNAL(newEventSignal(QDate)),
mMainView, SLOT(newEvent(QDate)));
connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)),
mMainView, SLOT(editIncidence(Incidence *)));
connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)),
mMainView, SLOT(showIncidence(Incidence *)));
connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)),
mMainView, SLOT(deleteIncidence(Incidence *)));
connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ),
mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
connect(mAgendaView, SIGNAL( toggleExpand() ),
mMainView, SLOT( toggleExpand() ) );
-
- connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ),
- mAgendaView, SLOT( setExpandedButton( bool ) ) );
+
connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ),
mMainView, SLOT(cloneIncidence(Incidence *) ) ) ;
connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ),
mMainView, SLOT(cancelIncidence(Incidence *) ) ) ;
connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig()));
connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView,
SLOT( updateTodo( Todo *, int ) ) );
connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )),
mMainView, SIGNAL( todoModified( Todo *, int )));
connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
mMainView, SLOT ( moveIncidence( Incidence * ) ) );
connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
mMainView, SLOT ( beamIncidence( Incidence * ) ) );
connect( mAgendaView, SIGNAL( selectWeekNum( int ) ),
mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) );
mAgendaView->readSettings();
mAgendaView->updateConfig();
}
showView( mAgendaView, full);
}
void KOViewManager::showDayView()
{
mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
mFlagShowNextxDays = false;
globalFlagBlockLabel = 1;
globalFlagBlockAgenda = 1;
if ( mCurrentAgendaView != 1 )
mCurrentAgendaView = -1;
showAgendaView();
qApp->processEvents();
globalFlagBlockAgenda = 2;
globalFlagBlockLabel = 0;
mMainView->dateNavigator()->selectDates( 1 );
mCurrentAgendaView = 1 ;
}
void KOViewManager::showWorkWeekView()
{
mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
mFlagShowNextxDays = false;
globalFlagBlockAgenda = 1;
globalFlagBlockLabel = 1;
if ( mCurrentAgendaView != 5 )
mCurrentAgendaView = -1;
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index 06f5ef8..eca7c14 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -29,119 +29,119 @@
#include <qframe.h>
#include <qlabel.h>
#include <qpopupmenu.h>
#include <qapplication.h>
#include <kdebug.h>
#include <klocale.h>
#include <kglobal.h>
#include <kiconloader.h>
#include "libkdepim/kdatepicker.h"
#include <knotifyclient.h>
#include "kdatetbl.h"
#include "koglobals.h"
#include <kglobalsettings.h>
#include "koprefs.h"
#ifndef KORG_NOPLUGINS
#include "kocore.h"
#endif
#include <kcalendarsystem.h>
#include "navigatorbar.h"
NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name )
: QWidget( parent, name )
{
QBoxLayout *topLayout = new QHBoxLayout( this );
// Set up the control buttons and date label
mCtrlFrame = new QFrame( this );
mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised);
mCtrlFrame->setLineWidth(1);
topLayout->addWidget( mCtrlFrame );
bool isRTL = KOGlobals::self()->reverseLayout();
#ifndef DESKTOP_VERSION
bool isDesktop = false;
#else
bool isDesktop = true;
#endif
if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 )
isDesktop = true;
// Create backward navigation buttons
mPrevYear = new QPushButton( mCtrlFrame );
- mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) );
+ mPrevYear->setPixmap( SmallIcon( isDesktop ? "3leftarrowB" : "3leftarrow" ) );
QToolTip::add( mPrevYear, i18n("Previous Year") );
mPrevMonth = new QPushButton( mCtrlFrame );
- mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") );
+ mPrevMonth->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow") );
QToolTip::add( mPrevMonth, i18n("Previous Month") );
// Create forward navigation buttons
mNextMonth = new QPushButton( mCtrlFrame );
- mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") );
+ mNextMonth->setPixmap( SmallIcon( isDesktop ? "2rightarrowB" : "2rightarrow") );
QToolTip::add( mNextMonth, i18n("Next Month") );
mPrevWeek = new QPushButton( mCtrlFrame );
mPrevWeek->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") );
QToolTip::add( mPrevWeek, i18n("Previous Week") );
// Create forward navigation buttons
mNextWeek = new QPushButton( mCtrlFrame );
mNextWeek->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") );
QToolTip::add( mNextWeek, i18n("Next Week") );
mNextYear = new QPushButton( mCtrlFrame );
- mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") );
+ mNextYear->setPixmap( SmallIcon( isDesktop ? "3rightarrowB": "3rightarrow") );
QToolTip::add( mNextYear, i18n("Next Year") );
mSelectMonth = new QPushButton( mCtrlFrame );
// Create month name label
//selectMonth->setFont( tfont );
// selectMonth->setAlignment( AlignCenter );
//mDateLabel = new QLabel( selectMonth );
//mDateLabel->setFont( tfont );
//mDateLabel->setAlignment( AlignCenter );
if ( QString ( name ) == QString("useBigPixmaps") ) {
mNextMonth->setFlat( true);
mNextWeek->setFlat( true);
mNextYear->setFlat( true);
mSelectMonth->setFlat( true);
mPrevYear->setFlat( true);
mPrevMonth->setFlat( true);
mPrevWeek->setFlat( true);
} else {
mPrevWeek->hide();
mNextWeek->hide();
}
resetFont( font() );
// set up control frame layout
QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 );
ctrlLayout->addWidget( mPrevYear, 3 );
ctrlLayout->addWidget( mPrevMonth, 3 );
ctrlLayout->addWidget( mPrevWeek, 3 );
//ctrlLayout->addStretch( 1 );
// ctrlLayout->addSpacing( 1 );
// ctrlLayout->addWidget( mDateLabel );
ctrlLayout->addWidget( mSelectMonth );
// ctrlLayout->addSpacing( 1 );
// ctrlLayout->addStretch( 1 );
ctrlLayout->addWidget( mNextWeek, 3 );
ctrlLayout->addWidget( mNextMonth, 3 );
ctrlLayout->addWidget( mNextYear, 3 );
connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) );
connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) );
connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) );
connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) );
connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) );
connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) );
connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) );
mPrevYear->setFocusPolicy(NoFocus);
mPrevMonth->setFocusPolicy(NoFocus);
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp
index 6cb432b..5d83511 100644
--- a/libkdepim/kdatepicker.cpp
+++ b/libkdepim/kdatepicker.cpp
@@ -18,100 +18,100 @@
Boston, MA 02111-1307, USA.
*/
#include "kdatepicker.h"
#include <kglobal.h>
#include <kapplication.h>
#include <klocale.h>
#include <kiconloader.h>
#include <qframe.h>
#include <qpainter.h>
#include <qdialog.h>
#include <qtoolbutton.h>
#include <qfont.h>
#include <qapplication.h>
#include <qlineedit.h>
#include <qvalidator.h>
#include <kdebug.h>
#include <knotifyclient.h>
#include <kglobalsettings.h>
#include "kdatetbl.h"
#include "kdateedit.h"
//#include "kdatepicker.moc"
KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name)
: QFrame(parent,name),
yearForward(new QToolButton(this)),
yearBackward(new QToolButton(this)),
monthForward(new QToolButton(this)),
monthBackward(new QToolButton(this)),
selectMonth(new QToolButton(this)),
selectYear(new QToolButton(this)),
todayBut(new QToolButton(this)),
//line(new QLineEdit(this)),
val(new KDateValidator(this))
//table(new KDateTable(this)),
//fontsize(1)
{
QFont fo = KGlobalSettings::generalFont();
int add = 2;
if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
add += 4;
fo.setPointSize(fo.pointSize()+add );
setFont( fo );
table = new KDateTable(this);
setFontSize(font().pointSize());
//line->setValidator(val);
lineDate = new KDateEdit( this, "dateediipicker", true );
- yearForward->setPixmap(SmallIcon("2rightarrowB"));
- yearBackward->setPixmap(SmallIcon("2leftarrowB"));
- monthForward->setPixmap(SmallIcon("1rightarrowB"));
- monthBackward->setPixmap(SmallIcon("1leftarrowB"));
+ yearForward->setPixmap(SmallIcon("3rightarrowB"));
+ yearBackward->setPixmap(SmallIcon("3leftarrowB"));
+ monthForward->setPixmap(SmallIcon("2rightarrowB"));
+ monthBackward->setPixmap(SmallIcon("2leftarrowB"));
todayBut->setPixmap(SmallIcon("today"));
setDate(dt); // set button texts
connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate)));
connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot()));
connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked()));
connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked()));
connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked()));
connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked()));
connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked()));
connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked()));
connect(todayBut, SIGNAL(clicked()), SLOT(goToday()));
//connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed()));
connect(lineDate, SIGNAL(dateChanged(QDate)), SLOT(slotSetDate(QDate)));
connect(lineDate, SIGNAL(returnPressed()), SLOT(lineEnterPressed()));
table->setFocus();
}
KDatePicker::~KDatePicker()
{
}
void
KDatePicker::resizeEvent(QResizeEvent*)
{
QWidget *buttons[] = {
yearBackward,
monthBackward,
selectMonth,
selectYear,
monthForward,
yearForward };
const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]);
QSize sizes[NoOfButtons];
int buttonHeight=0;
int count;
int w;
int x=0;
// ----- calculate button row height:
for(count=0; count<NoOfButtons; ++count) {
int xS = buttons[count]->sizeHint().width();
int yS = buttons[count]->sizeHint().height();
if ( QApplication::desktop()->width() < 320 )
sizes[count]=QSize ( xS+4, yS );
else
sizes[count]=QSize ( xS+10, yS );
buttonHeight=QMAX(buttonHeight, sizes[count].height());