-rw-r--r-- | korganizer/koagendaview.cpp | 24 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 6 | ||||
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 13 |
3 files changed, 33 insertions, 10 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 1627dba..2b05d37 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -131,10 +131,14 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) QString suffix; int timeHeight = fm.ascent(); QFont nFont = p->font(); - if (!KGlobal::locale()->use12Clock()) - suffix = "00"; + if (!KGlobal::locale()->use12Clock()) { + if ( QApplication::desktop()->width() <= 320 ) + suffix = ""; + else + suffix = "00"; + } if ( timeHeight > mCellHeight ) { timeHeight = mCellHeight-1; int pointS = nFont.pointSize(); @@ -158,9 +162,8 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) int tw2 = fmS.width(suffix); while (y < cy + ch) { p->drawLine(cx,y,cw,y); hour.setNum(cell); - // handle 24h and am/pm time formats if (KGlobal::locale()->use12Clock()) { if (cell > 11) suffix = "pm"; else @@ -212,10 +215,14 @@ void TimeLabels::updateConfig() test = "12"; mMiniWidth = fontMetrics().width(test); if (KGlobal::locale()->use12Clock()) test = "pm"; - else - test = "00"; + else { + if ( QApplication::desktop()->width() <= 320 ) + test = ""; + else + test = "00"; + } QFont sFont = font(); sFont.setPointSize( sFont.pointSize()/2 ); QFontMetrics fmS( sFont ); mMiniWidth += fmS.width( test ) + frameWidth()*2 +4 ; @@ -724,9 +731,12 @@ void KOAgendaView::createDayLabels() dayLabel->setFixedWidth( mTimeLabels->width()+mAgenda->frameWidth() ); dayLabel->setFont( dlf ); dayLabel->setNum( -1 ); //dayLabel->setAlignment(QLabel::AlignHCenter); - dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); + if ( QApplication::desktop()->width() <= 320 ) + dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ).left(2) ); + else + dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); dayLabel->show(); DateList::ConstIterator dit; bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); int counter = -1; @@ -831,9 +841,8 @@ void KOAgendaView::createDayLabels() if ( appendLabels ) { dayLabel = getNewDaylabel(); } //dayLabel->hide();//test only - qDebug("fremwidd %d ", mAgenda->frameWidth()); int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()- (mAgenda->frameWidth()*2) ) % mSelectedDates.count() ; if ( offset < 0 ) offset = 0; //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); @@ -841,8 +850,9 @@ void KOAgendaView::createDayLabels() dayLabel->setAutoRepeat( true ); dayLabel->show(); dayLabel->setNum( -2 ); dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); + //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); if ( !appendLabels ) { dayLabel = mDayLabelsList.next(); diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 5b5703f..b8a0f09 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -792,10 +792,14 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) if ( rowModulo ) { if ( mSelEndT/7 >= 6 - rowModulo ) addRow = mSelEndT/7 - 5 + rowModulo; } + //qDebug("%d %d %d ",selh, row, addRow ); + int addrow2 = addRow-selh+1; + if ( addrow2 < 0 ) + addrow2 = 0; if (selh > 1) { - p.fillRect(1, (row+1)*dheight, 7*dwidth+colModulo, (selh-1)*dheight+addRow,selcol); + p.fillRect(1, (row+1)*dheight+addrow2, 7*dwidth+colModulo, (selh-1)*dheight+addRow,selcol); } // draw last block from left to mSelEndT selw = mSelEndT-7*(mSelEndT/7)+1; //qDebug("esl %d ",selw ); diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index 6cb1f31..253175e 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp @@ -270,9 +270,14 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) // Draw the splitter rectangle p.setBrush( colorGroup().background() ); p.setPen( colorGroup().foreground() ); //p.drawRect( rect() ); - buffer.fill( colorGroup().background() ); +#ifndef DESKTOP_VERSION + if ( mMouseDown ) + buffer.fill( QColor( 242,27,255 ) ); + else +#endif + buffer.fill( colorGroup().background() ); //buffer.fill( backgroundColor() ); // parentWidget()->style().drawPrimitive( QStyle::PE_Panel, &p, rect(), parentWidget()->colorGroup()); int sw = 8; // Hardcoded, given I didn't use styles anymore, I didn't like to use their size @@ -282,9 +287,13 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) if ( _activeButton ) col = colorGroup().background().dark( 250 ); else { if ( mMouseDown ) - col = Qt::white; +#ifndef DESKTOP_VERSION + col = QColor( 178,18,188);//QColor( 242,27,255 );//Qt::white; +#else + col = Qt::white; +#endif else col = colorGroup().background().dark( 150 ); } //QColor col = backgroundColor().dark( 130 ); |