summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 8001c8f..acf43bd 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -346,80 +346,79 @@ void EventIndicator::changeColumns(int columns)
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
@@ -1435,57 +1434,48 @@ void KOAgendaView::setHolidayMasks()
}
#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];