summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index d7ea4d4..e029fdb 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -264,16 +264,13 @@ EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name)
mTopLayout = 0;
mPaintWidget = 0;
mXOffset = 0;
if (mLocation == Top) mPixmap = SmallIcon("1uparrow");
else mPixmap = SmallIcon("1downarrow");
mEnabled.resize(mColumns);
- if (mLocation == Top)
- setMaximumHeight(0);
- else
- setMinimumHeight(mPixmap.height());
+ setMinimumHeight(mPixmap.height());
}
EventIndicator::~EventIndicator()
{
}
@@ -287,15 +284,15 @@ void EventIndicator::drawContents(QPainter *p)
if ( ! han ) {
int i;
for(i=0;i<mColumns;++i) {
if (mEnabled[i]) {
int cellWidth = contentsRect().right()/mColumns;
int xOffset = KOGlobals::self()->reverseLayout() ?
- (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 :
- i*cellWidth + cellWidth/2 -mPixmap.width()/2;
- p->drawPixmap(QPoint(xOffset,0),mPixmap);
+ (mColumns - 1 - i)*cellWidth + (cellWidth -mPixmap.width())/2 :
+ i*cellWidth + (cellWidth -mPixmap.width()) /2;
+ p->drawPixmap(QPoint(1+xOffset,0),mPixmap);
}
}
} else {
han->repaint();
//mPaintWidget->setBackgroundColor( red );
@@ -325,12 +322,14 @@ 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);
@@ -407,25 +406,28 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
// 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);
- agendaLayout->addWidget(mEventIndicatorTop,0,1);
-
+#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 ,1,1,0,2);
- mEventIndicatorTop->setPaintWidget( mSplitterAgenda );
+ 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,0,2);
+ 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()));