summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp24
-rw-r--r--korganizer/kodaymatrix.cpp6
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp13
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
@@ -129,14 +129,18 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
129 QFontMetrics fm = fontMetrics(); 129 QFontMetrics fm = fontMetrics();
130 QString hour; 130 QString hour;
131 QString suffix; 131 QString suffix;
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;
140 int pointS = nFont.pointSize(); 144 int pointS = nFont.pointSize();
141 while ( pointS > 4 ) { 145 while ( pointS > 4 ) {
142 nFont.setPointSize( pointS ); 146 nFont.setPointSize( pointS );
@@ -156,13 +160,12 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
156 //sHei -= (sHei/4-2); 160 //sHei -= (sHei/4-2);
157 int startW = this->width() - frameWidth()-2; 161 int startW = this->width() - frameWidth()-2;
158 int tw2 = fmS.width(suffix); 162 int tw2 = fmS.width(suffix);
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";
166 else 169 else
167 suffix = "am"; 170 suffix = "am";
168 if (cell == 0) hour.setNum(12); 171 if (cell == 0) hour.setNum(12);
@@ -210,14 +213,18 @@ void TimeLabels::updateConfig()
210 QString test = "20"; 213 QString test = "20";
211 if (KGlobal::locale()->use12Clock()) 214 if (KGlobal::locale()->use12Clock())
212 test = "12"; 215 test = "12";
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 );
221 mMiniWidth += fmS.width( test ) + frameWidth()*2 +4 ; 228 mMiniWidth += fmS.width( test ) + frameWidth()*2 +4 ;
222 // update geometry restrictions based on new settings 229 // update geometry restrictions based on new settings
223 setFixedWidth( mMiniWidth ); 230 setFixedWidth( mMiniWidth );
@@ -722,13 +729,16 @@ void KOAgendaView::createDayLabels()
722 dayLabel = getNewDaylabel(); 729 dayLabel = getNewDaylabel();
723 } 730 }
724 dayLabel->setFixedWidth( mTimeLabels->width()+mAgenda->frameWidth() ); 731 dayLabel->setFixedWidth( mTimeLabels->width()+mAgenda->frameWidth() );
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() );
732 int counter = -1; 742 int counter = -1;
733 for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { 743 for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) {
734 ++counter; 744 ++counter;
@@ -829,22 +839,22 @@ void KOAgendaView::createDayLabels()
829 appendLabels = true; 839 appendLabels = true;
830 } 840 }
831 if ( appendLabels ) { 841 if ( appendLabels ) {
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 );
839 dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); 848 dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) );
840 dayLabel->setFont( dlf ); 849 dayLabel->setFont( dlf );
841 dayLabel->setAutoRepeat( true ); 850 dayLabel->setAutoRepeat( true );
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 ) {
848 dayLabel = mDayLabelsList.next(); 858 dayLabel = mDayLabelsList.next();
849 while ( dayLabel ) { 859 while ( dayLabel ) {
850 //qDebug("!dayLabel %d",dayLabel ); 860 //qDebug("!dayLabel %d",dayLabel );
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 5b5703f..b8a0f09 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -790,14 +790,18 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
790 selh = mSelEndT/7-row; 790 selh = mSelEndT/7-row;
791 addRow = 0; 791 addRow = 0;
792 if ( rowModulo ) { 792 if ( rowModulo ) {
793 if ( mSelEndT/7 >= 6 - rowModulo ) 793 if ( mSelEndT/7 >= 6 - rowModulo )
794 addRow = mSelEndT/7 - 5 + rowModulo; 794 addRow = mSelEndT/7 - 5 + rowModulo;
795 } 795 }
796 //qDebug("%d %d %d ",selh, row, addRow );
797 int addrow2 = addRow-selh+1;
798 if ( addrow2 < 0 )
799 addrow2 = 0;
796 if (selh > 1) { 800 if (selh > 1) {
797 p.fillRect(1, (row+1)*dheight, 7*dwidth+colModulo, (selh-1)*dheight+addRow,selcol); 801 p.fillRect(1, (row+1)*dheight+addrow2, 7*dwidth+colModulo, (selh-1)*dheight+addRow,selcol);
798 } 802 }
799 // draw last block from left to mSelEndT 803 // draw last block from left to mSelEndT
800 selw = mSelEndT-7*(mSelEndT/7)+1; 804 selw = mSelEndT-7*(mSelEndT/7)+1;
801 //qDebug("esl %d ",selw ); 805 //qDebug("esl %d ",selw );
802 int add = 0; 806 int add = 0;
803 if ( colModulo ) { 807 if ( colModulo ) {
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index 6cb1f31..253175e 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -268,25 +268,34 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * )
268 268
269 //LR 269 //LR
270 // Draw the splitter rectangle 270 // Draw the splitter rectangle
271 p.setBrush( colorGroup().background() ); 271 p.setBrush( colorGroup().background() );
272 p.setPen( colorGroup().foreground() ); 272 p.setPen( colorGroup().foreground() );
273 //p.drawRect( rect() ); 273 //p.drawRect( rect() );
274 buffer.fill( colorGroup().background() ); 274#ifndef DESKTOP_VERSION
275 if ( mMouseDown )
276 buffer.fill( QColor( 242,27,255 ) );
277 else
278#endif
279 buffer.fill( colorGroup().background() );
275 //buffer.fill( backgroundColor() ); 280 //buffer.fill( backgroundColor() );
276 // parentWidget()->style().drawPrimitive( QStyle::PE_Panel, &p, rect(), parentWidget()->colorGroup()); 281 // parentWidget()->style().drawPrimitive( QStyle::PE_Panel, &p, rect(), parentWidget()->colorGroup());
277 282
278 int sw = 8; // Hardcoded, given I didn't use styles anymore, I didn't like to use their size 283 int sw = 8; // Hardcoded, given I didn't use styles anymore, I didn't like to use their size
279 284
280 // arrow color 285 // arrow color
281 QColor col; 286 QColor col;
282 if ( _activeButton ) 287 if ( _activeButton )
283 col = colorGroup().background().dark( 250 ); 288 col = colorGroup().background().dark( 250 );
284 else { 289 else {
285 if ( mMouseDown ) 290 if ( mMouseDown )
286 col = Qt::white; 291#ifndef DESKTOP_VERSION
292 col = QColor( 178,18,188);//QColor( 242,27,255 );//Qt::white;
293#else
294 col = Qt::white;
295#endif
287 else 296 else
288 col = colorGroup().background().dark( 150 ); 297 col = colorGroup().background().dark( 150 );
289 } 298 }
290 //QColor col = backgroundColor().dark( 130 ); 299 //QColor col = backgroundColor().dark( 130 );
291 p.setBrush( col ); 300 p.setBrush( col );
292 p.setPen( col ); 301 p.setPen( col );