-rw-r--r-- | korganizer/koagendaview.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 1627dba..2b05d37 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -132,8 +132,12 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
132 | int timeHeight = fm.ascent(); | 132 | int timeHeight = fm.ascent(); |
133 | QFont nFont = p->font(); | 133 | QFont nFont = p->font(); |
134 | 134 | ||
135 | if (!KGlobal::locale()->use12Clock()) | 135 | if (!KGlobal::locale()->use12Clock()) { |
136 | suffix = "00"; | 136 | if ( QApplication::desktop()->width() <= 320 ) |
137 | suffix = ""; | ||
138 | else | ||
139 | suffix = "00"; | ||
140 | } | ||
137 | 141 | ||
138 | if ( timeHeight > mCellHeight ) { | 142 | if ( timeHeight > mCellHeight ) { |
139 | timeHeight = mCellHeight-1; | 143 | timeHeight = mCellHeight-1; |
@@ -159,7 +163,6 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
159 | while (y < cy + ch) { | 163 | while (y < cy + ch) { |
160 | p->drawLine(cx,y,cw,y); | 164 | p->drawLine(cx,y,cw,y); |
161 | hour.setNum(cell); | 165 | hour.setNum(cell); |
162 | |||
163 | // handle 24h and am/pm time formats | 166 | // handle 24h and am/pm time formats |
164 | if (KGlobal::locale()->use12Clock()) { | 167 | if (KGlobal::locale()->use12Clock()) { |
165 | if (cell > 11) suffix = "pm"; | 168 | if (cell > 11) suffix = "pm"; |
@@ -213,8 +216,12 @@ void TimeLabels::updateConfig() | |||
213 | mMiniWidth = fontMetrics().width(test); | 216 | mMiniWidth = fontMetrics().width(test); |
214 | if (KGlobal::locale()->use12Clock()) | 217 | if (KGlobal::locale()->use12Clock()) |
215 | test = "pm"; | 218 | test = "pm"; |
216 | else | 219 | else { |
217 | test = "00"; | 220 | if ( QApplication::desktop()->width() <= 320 ) |
221 | test = ""; | ||
222 | else | ||
223 | test = "00"; | ||
224 | } | ||
218 | QFont sFont = font(); | 225 | QFont sFont = font(); |
219 | sFont.setPointSize( sFont.pointSize()/2 ); | 226 | sFont.setPointSize( sFont.pointSize()/2 ); |
220 | QFontMetrics fmS( sFont ); | 227 | QFontMetrics fmS( sFont ); |
@@ -725,7 +732,10 @@ void KOAgendaView::createDayLabels() | |||
725 | dayLabel->setFont( dlf ); | 732 | dayLabel->setFont( dlf ); |
726 | dayLabel->setNum( -1 ); | 733 | dayLabel->setNum( -1 ); |
727 | //dayLabel->setAlignment(QLabel::AlignHCenter); | 734 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
728 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); | 735 | if ( QApplication::desktop()->width() <= 320 ) |
736 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ).left(2) ); | ||
737 | else | ||
738 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); | ||
729 | dayLabel->show(); | 739 | dayLabel->show(); |
730 | DateList::ConstIterator dit; | 740 | DateList::ConstIterator dit; |
731 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); | 741 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); |
@@ -832,7 +842,6 @@ void KOAgendaView::createDayLabels() | |||
832 | dayLabel = getNewDaylabel(); | 842 | dayLabel = getNewDaylabel(); |
833 | } | 843 | } |
834 | //dayLabel->hide();//test only | 844 | //dayLabel->hide();//test only |
835 | qDebug("fremwidd %d ", mAgenda->frameWidth()); | ||
836 | int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()- (mAgenda->frameWidth()*2) ) % mSelectedDates.count() ; | 845 | int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()- (mAgenda->frameWidth()*2) ) % mSelectedDates.count() ; |
837 | if ( offset < 0 ) offset = 0; | 846 | if ( offset < 0 ) offset = 0; |
838 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); | 847 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); |
@@ -842,6 +851,7 @@ void KOAgendaView::createDayLabels() | |||
842 | dayLabel->show(); | 851 | dayLabel->show(); |
843 | dayLabel->setNum( -2 ); | 852 | dayLabel->setNum( -2 ); |
844 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); | 853 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); |
854 | |||
845 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); | 855 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); |
846 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); | 856 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); |
847 | if ( !appendLabels ) { | 857 | if ( !appendLabels ) { |