-rw-r--r-- | korganizer/koagendaview.cpp | 86 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 8 | ||||
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 8 | ||||
-rw-r--r-- | microkde/kdialogbase.cpp | 8 |
4 files changed, 87 insertions, 23 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 2b05d37..8d32152 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -110,14 +110,77 @@ void TimeLabels::setCellHeight(int height) | |||
110 | void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | 110 | void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) |
111 | { | 111 | { |
112 | 112 | ||
113 | // if ( globalFlagBlockAgenda ) | 113 | cx = contentsX() + frameWidth()*2; |
114 | // return; | 114 | cw = contentsWidth() ; |
115 | // bug: the parameters cx, cy, cw, ch are the areas that need to be | 115 | // end of workaround |
116 | // redrawn, not the area of the widget. unfortunately, this | 116 | |
117 | // code assumes the latter... | 117 | int cell = ((int)(cy/mCellHeight)); |
118 | 118 | int y = cell * mCellHeight; | |
119 | // now, for a workaround... | 119 | QFontMetrics fm = fontMetrics(); |
120 | // these two assignments fix the weird redraw bug | 120 | QString hour; |
121 | QString suffix = "am"; | ||
122 | int timeHeight = fm.ascent(); | ||
123 | QFont nFont = p->font(); | ||
124 | |||
125 | if (!KGlobal::locale()->use12Clock()) { | ||
126 | if ( QApplication::desktop()->width() <= 320 ) | ||
127 | suffix = "00"; | ||
128 | else | ||
129 | suffix = "00"; | ||
130 | } | ||
131 | |||
132 | if ( timeHeight > mCellHeight ) { | ||
133 | timeHeight = mCellHeight-1; | ||
134 | int pointS = nFont.pointSize(); | ||
135 | while ( pointS > 4 ) { | ||
136 | nFont.setPointSize( pointS ); | ||
137 | fm = QFontMetrics( nFont ); | ||
138 | if ( fm.ascent() < mCellHeight ) | ||
139 | break; | ||
140 | -- pointS; | ||
141 | } | ||
142 | fm = QFontMetrics( nFont ); | ||
143 | timeHeight = fm.ascent(); | ||
144 | } | ||
145 | //timeHeight -= (timeHeight/4-2); | ||
146 | QFont sFont = nFont; | ||
147 | sFont.setPointSize( sFont.pointSize()/2 ); | ||
148 | QFontMetrics fmS( sFont ); | ||
149 | int sHei = fmS.ascent() ; | ||
150 | //sHei -= (sHei/4-2); | ||
151 | int startW = this->width() - frameWidth()-2; | ||
152 | int tw2 = fmS.width(suffix); | ||
153 | timeHeight = (timeHeight-1) /2 -1; | ||
154 | while (y < cy + ch+mCellHeight) { | ||
155 | p->drawLine(startW-tw2+1 ,y,cw,y); | ||
156 | hour.setNum(cell); | ||
157 | // handle 24h and am/pm time formats | ||
158 | if (KGlobal::locale()->use12Clock()) { | ||
159 | if (cell > 11) suffix = "pm"; | ||
160 | else | ||
161 | suffix = "am"; | ||
162 | if (cell == 0) hour.setNum(12); | ||
163 | if (cell > 12) hour.setNum(cell - 12); | ||
164 | } | ||
165 | |||
166 | // center and draw the time label | ||
167 | int timeWidth = fm.width(hour); | ||
168 | int offset = startW - timeWidth - tw2 ; | ||
169 | p->setFont( nFont ); | ||
170 | p->drawText( offset, y+ timeHeight, hour); | ||
171 | p->setFont( sFont ); | ||
172 | offset = startW - tw2+1; | ||
173 | p->drawText( offset, y -1, suffix); | ||
174 | |||
175 | // increment indices | ||
176 | y += mCellHeight; | ||
177 | cell++; | ||
178 | } | ||
179 | |||
180 | |||
181 | |||
182 | |||
183 | #if 0 | ||
121 | mRedrawNeeded = true; | 184 | mRedrawNeeded = true; |
122 | if ( mRedrawNeeded ) { | 185 | if ( mRedrawNeeded ) { |
123 | cx = contentsX() + frameWidth()*2; | 186 | cx = contentsX() + frameWidth()*2; |
@@ -192,6 +255,7 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
192 | // double buffer not yet implemented | 255 | // double buffer not yet implemented |
193 | //bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP); | 256 | //bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP); |
194 | //mRedrawNeeded = false; | 257 | //mRedrawNeeded = false; |
258 | #endif | ||
195 | } | 259 | } |
196 | 260 | ||
197 | /** | 261 | /** |
@@ -218,7 +282,7 @@ void TimeLabels::updateConfig() | |||
218 | test = "pm"; | 282 | test = "pm"; |
219 | else { | 283 | else { |
220 | if ( QApplication::desktop()->width() <= 320 ) | 284 | if ( QApplication::desktop()->width() <= 320 ) |
221 | test = ""; | 285 | test = "00"; |
222 | else | 286 | else |
223 | test = "00"; | 287 | test = "00"; |
224 | } | 288 | } |
@@ -674,6 +738,8 @@ void KOAgendaView::createDayLabels() | |||
674 | // each updateView() call) | 738 | // each updateView() call) |
675 | 739 | ||
676 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - mAgenda->frameWidth()*2; | 740 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - mAgenda->frameWidth()*2; |
741 | if ( QApplication::desktop()->width() <= 320 ) | ||
742 | maxWid -= 10; | ||
677 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); | 743 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); |
678 | if ( maxWid < 0 ) | 744 | if ( maxWid < 0 ) |
679 | maxWid = 20; | 745 | maxWid = 20; |
@@ -732,9 +798,11 @@ void KOAgendaView::createDayLabels() | |||
732 | dayLabel->setFont( dlf ); | 798 | dayLabel->setFont( dlf ); |
733 | dayLabel->setNum( -1 ); | 799 | dayLabel->setNum( -1 ); |
734 | //dayLabel->setAlignment(QLabel::AlignHCenter); | 800 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
801 | #if 0 | ||
735 | if ( QApplication::desktop()->width() <= 320 ) | 802 | if ( QApplication::desktop()->width() <= 320 ) |
736 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ).left(2) ); | 803 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ).left(2) ); |
737 | else | 804 | else |
805 | #endif | ||
738 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); | 806 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); |
739 | dayLabel->show(); | 807 | dayLabel->show(); |
740 | DateList::ConstIterator dit; | 808 | DateList::ConstIterator dit; |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index b8a0f09..8affe50 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -767,8 +767,8 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
767 | //qDebug("COL %d %d %d %d ",col , colt1 ,addCol ,addCol2 ); | 767 | //qDebug("COL %d %d %d %d ",col , colt1 ,addCol ,addCol2 ); |
768 | } | 768 | } |
769 | // Single row selection | 769 | // Single row selection |
770 | if ( row == 0) | 770 | //if ( row == 0) |
771 | addRow = 1; | 771 | // addRow = 1; |
772 | p.fillRect(isRTL ? (7 - (mSelEndT-mSelStartT+1) - col)*dwidth : col*dwidth+1+addCol2, | 772 | p.fillRect(isRTL ? (7 - (mSelEndT-mSelStartT+1) - col)*dwidth : col*dwidth+1+addCol2, |
773 | row*dheight+addRow, (mSelEndT-mSelStartT+1)*dwidth+addCol, dheight+1, selcol); | 773 | row*dheight+addRow, (mSelEndT-mSelStartT+1)*dwidth+addCol, dheight+1, selcol); |
774 | } else { | 774 | } else { |
@@ -781,8 +781,8 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
781 | if ( row >= 6 - rowModulo ) | 781 | if ( row >= 6 - rowModulo ) |
782 | addRow = row - 5 + rowModulo; | 782 | addRow = row - 5 + rowModulo; |
783 | } | 783 | } |
784 | if ( row == 0) | 784 | //if ( row == 0) |
785 | addRow = 1; | 785 | // addRow = 1; |
786 | int drawWid = width()-(col*dwidth+1+addCol2)-1; | 786 | int drawWid = width()-(col*dwidth+1+addCol2)-1; |
787 | p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, drawWid, | 787 | p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, drawWid, |
788 | dheight+1, selcol); | 788 | dheight+1, selcol); |
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index 253175e..2a30346 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp | |||
@@ -273,7 +273,7 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) | |||
273 | //p.drawRect( rect() ); | 273 | //p.drawRect( rect() ); |
274 | #ifndef DESKTOP_VERSION | 274 | #ifndef DESKTOP_VERSION |
275 | if ( mMouseDown ) | 275 | if ( mMouseDown ) |
276 | buffer.fill( QColor( 242,27,255 ) ); | 276 | buffer.fill( colorGroup().background().dark() ); |
277 | else | 277 | else |
278 | #endif | 278 | #endif |
279 | buffer.fill( colorGroup().background() ); | 279 | buffer.fill( colorGroup().background() ); |
@@ -288,11 +288,7 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) | |||
288 | col = colorGroup().background().dark( 250 ); | 288 | col = colorGroup().background().dark( 250 ); |
289 | else { | 289 | else { |
290 | if ( mMouseDown ) | 290 | if ( mMouseDown ) |
291 | #ifndef DESKTOP_VERSION | ||
292 | col = QColor( 178,18,188);//QColor( 242,27,255 );//Qt::white; | ||
293 | #else | ||
294 | col = Qt::white; | 291 | col = Qt::white; |
295 | #endif | ||
296 | else | 292 | else |
297 | col = colorGroup().background().dark( 150 ); | 293 | col = colorGroup().background().dark( 150 ); |
298 | } | 294 | } |
@@ -688,7 +684,7 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) | |||
688 | mRubberBand = new QFrame( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); | 684 | mRubberBand = new QFrame( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); |
689 | mRubberBand->setFrameStyle( Box | Raised ); | 685 | mRubberBand->setFrameStyle( Box | Raised ); |
690 | //mRubberBand->setPalette( QPalette ( Qt::red.light(),Qt::red.dark() ) ); | 686 | //mRubberBand->setPalette( QPalette ( Qt::red.light(),Qt::red.dark() ) ); |
691 | mRubberBand->setPalette( QPalette ( QColor( 178,18,188), QColor( 242,27,255 ) )); | 687 | mRubberBand->setPalette( QPalette ( colorGroup().background().light(), colorGroup().background().dark() )); |
692 | } | 688 | } |
693 | QRect r = contentsRect(); | 689 | QRect r = contentsRect(); |
694 | static int rBord = 0; //Themable???? | 690 | static int rBord = 0; //Themable???? |
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp index e6144de..11635e1 100644 --- a/microkde/kdialogbase.cpp +++ b/microkde/kdialogbase.cpp | |||
@@ -136,8 +136,8 @@ void KDialogBase::initLayout() | |||
136 | 136 | ||
137 | delete mTopLayout; | 137 | delete mTopLayout; |
138 | mTopLayout = new QVBoxLayout( this ); | 138 | mTopLayout = new QVBoxLayout( this ); |
139 | mTopLayout->setMargin( marginHint() ); | 139 | mTopLayout->setMargin( marginHintSmall() ); |
140 | mTopLayout->setSpacing( spacingHint() ); | 140 | mTopLayout->setSpacing( spacingHintSmall() ); |
141 | 141 | ||
142 | mTopLayout->addWidget( mMainWidget ); | 142 | mTopLayout->addWidget( mMainWidget ); |
143 | 143 | ||
@@ -151,8 +151,8 @@ void KDialogBase::initLayout() | |||
151 | if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton ); | 151 | if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton ); |
152 | if ( mCancelButton ) buttonLayout->addWidget( mCancelButton ); | 152 | if ( mCancelButton ) buttonLayout->addWidget( mCancelButton ); |
153 | if ( mCloseButton ) buttonLayout->addWidget( mCloseButton ); | 153 | if ( mCloseButton ) buttonLayout->addWidget( mCloseButton ); |
154 | buttonLayout->setMargin( 0 ); | 154 | buttonLayout->setMargin( marginHintSmall() ); |
155 | buttonLayout->setSpacing( spacingHint() ); | 155 | buttonLayout->setSpacing( spacingHintSmall() ); |
156 | } | 156 | } |
157 | 157 | ||
158 | QFrame *KDialogBase::addPage( const QString &name ) | 158 | QFrame *KDialogBase::addPage( const QString &name ) |