author | zautrix <zautrix> | 2005-04-02 08:36:37 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-02 08:36:37 (UTC) |
commit | e7cb4c20af8b07bf923c864026481ce316c40e1d (patch) (unidiff) | |
tree | c88b2d0c01ce683e73ea9f4657f4d5c6fbe6f922 | |
parent | 7aefe488d1fe0c34cf29460f48a9a97d632f615e (diff) | |
download | kdepimpi-e7cb4c20af8b07bf923c864026481ce316c40e1d.zip kdepimpi-e7cb4c20af8b07bf923c864026481ce316c40e1d.tar.gz kdepimpi-e7cb4c20af8b07bf923c864026481ce316c40e1d.tar.bz2 |
more fixes
-rw-r--r-- | korganizer/koagendaview.cpp | 86 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 8 | ||||
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 10 | ||||
-rw-r--r-- | microkde/kdialogbase.cpp | 8 |
4 files changed, 88 insertions, 24 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 2b05d37..8d32152 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -101,32 +101,95 @@ TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : | |||
101 | void TimeLabels::setCellHeight(int height) | 101 | void TimeLabels::setCellHeight(int height) |
102 | { | 102 | { |
103 | mCellHeight = height; | 103 | mCellHeight = height; |
104 | } | 104 | } |
105 | 105 | ||
106 | /* | 106 | /* |
107 | Optimization so that only the "dirty" portion of the scroll view | 107 | Optimization so that only the "dirty" portion of the scroll view |
108 | is redrawn. Unfortunately, this is not called by default paintEvent() method. | 108 | is redrawn. Unfortunately, this is not called by default paintEvent() method. |
109 | */ | 109 | */ |
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; |
124 | cw = contentsWidth() ; | 187 | cw = contentsWidth() ; |
125 | // end of workaround | 188 | // end of workaround |
126 | 189 | ||
127 | int cell = ((int)(cy/mCellHeight)); | 190 | int cell = ((int)(cy/mCellHeight)); |
128 | int y = cell * mCellHeight; | 191 | int y = cell * mCellHeight; |
129 | QFontMetrics fm = fontMetrics(); | 192 | QFontMetrics fm = fontMetrics(); |
130 | QString hour; | 193 | QString hour; |
131 | QString suffix; | 194 | QString suffix; |
132 | int timeHeight = fm.ascent(); | 195 | int timeHeight = fm.ascent(); |
@@ -183,24 +246,25 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
183 | p->drawText( offset, y+ sHei, suffix); | 246 | p->drawText( offset, y+ sHei, suffix); |
184 | 247 | ||
185 | // increment indices | 248 | // increment indices |
186 | y += mCellHeight; | 249 | y += mCellHeight; |
187 | cell++; | 250 | cell++; |
188 | } | 251 | } |
189 | } else { | 252 | } else { |
190 | //qDebug("NO redraw "); | 253 | //qDebug("NO redraw "); |
191 | } | 254 | } |
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 | /** |
198 | Calculates the minimum width. | 262 | Calculates the minimum width. |
199 | */ | 263 | */ |
200 | int TimeLabels::minimumWidth() const | 264 | int TimeLabels::minimumWidth() const |
201 | { | 265 | { |
202 | return mMiniWidth; | 266 | return mMiniWidth; |
203 | } | 267 | } |
204 | 268 | ||
205 | /** updates widget's internal state */ | 269 | /** updates widget's internal state */ |
206 | void TimeLabels::updateConfig() | 270 | void TimeLabels::updateConfig() |
@@ -209,25 +273,25 @@ void TimeLabels::updateConfig() | |||
209 | // set the font | 273 | // set the font |
210 | // config->setGroup("Fonts"); | 274 | // config->setGroup("Fonts"); |
211 | // QFont font = config->readFontEntry("TimeBar Font"); | 275 | // QFont font = config->readFontEntry("TimeBar Font"); |
212 | setFont(KOPrefs::instance()->mTimeBarFont); | 276 | setFont(KOPrefs::instance()->mTimeBarFont); |
213 | QString test = "20"; | 277 | QString test = "20"; |
214 | if (KGlobal::locale()->use12Clock()) | 278 | if (KGlobal::locale()->use12Clock()) |
215 | test = "12"; | 279 | test = "12"; |
216 | mMiniWidth = fontMetrics().width(test); | 280 | mMiniWidth = fontMetrics().width(test); |
217 | if (KGlobal::locale()->use12Clock()) | 281 | if (KGlobal::locale()->use12Clock()) |
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 | } |
225 | QFont sFont = font(); | 289 | QFont sFont = font(); |
226 | sFont.setPointSize( sFont.pointSize()/2 ); | 290 | sFont.setPointSize( sFont.pointSize()/2 ); |
227 | QFontMetrics fmS( sFont ); | 291 | QFontMetrics fmS( sFont ); |
228 | mMiniWidth += fmS.width( test ) + frameWidth()*2 +4 ; | 292 | mMiniWidth += fmS.width( test ) + frameWidth()*2 +4 ; |
229 | // update geometry restrictions based on new settings | 293 | // update geometry restrictions based on new settings |
230 | setFixedWidth( mMiniWidth ); | 294 | setFixedWidth( mMiniWidth ); |
231 | 295 | ||
232 | // update HourSize | 296 | // update HourSize |
233 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 297 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
@@ -665,24 +729,26 @@ void KOAgendaView::createDayLabels() | |||
665 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { | 729 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { |
666 | // qDebug(" KOAgendaView::createDayLabels() blocked "); | 730 | // qDebug(" KOAgendaView::createDayLabels() blocked "); |
667 | return; | 731 | return; |
668 | 732 | ||
669 | } | 733 | } |
670 | int newHight; | 734 | int newHight; |
671 | 735 | ||
672 | // ### Before deleting and recreating we could check if mSelectedDates changed... | 736 | // ### Before deleting and recreating we could check if mSelectedDates changed... |
673 | // It would remove some flickering and gain speed (since this is called by | 737 | // It would remove some flickering and gain speed (since this is called by |
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; |
680 | 746 | ||
681 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; | 747 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; |
682 | QFontMetrics fm ( dlf ); | 748 | QFontMetrics fm ( dlf ); |
683 | int selCount = mSelectedDates.count(); | 749 | int selCount = mSelectedDates.count(); |
684 | QString dayTest = "Mon 20"; | 750 | QString dayTest = "Mon 20"; |
685 | //QString dayTest = "Mon 20"; | 751 | //QString dayTest = "Mon 20"; |
686 | int wid = fm.width( dayTest ); | 752 | int wid = fm.width( dayTest ); |
687 | //maxWid -= ( selCount * 3 ); //working for QLabels | 753 | //maxWid -= ( selCount * 3 ); //working for QLabels |
688 | maxWid -= ( selCount * 3 ); //working for QPushButton | 754 | maxWid -= ( selCount * 3 ); //working for QPushButton |
@@ -723,27 +789,29 @@ void KOAgendaView::createDayLabels() | |||
723 | // QFont lFont = dlf; | 789 | // QFont lFont = dlf; |
724 | bool appendLabels = false; | 790 | bool appendLabels = false; |
725 | KOAgendaButton *dayLabel; | 791 | KOAgendaButton *dayLabel; |
726 | dayLabel = mDayLabelsList.first(); | 792 | dayLabel = mDayLabelsList.first(); |
727 | if ( !dayLabel ) { | 793 | if ( !dayLabel ) { |
728 | appendLabels = true; | 794 | appendLabels = true; |
729 | dayLabel = getNewDaylabel(); | 795 | dayLabel = getNewDaylabel(); |
730 | } | 796 | } |
731 | dayLabel->setFixedWidth( mTimeLabels->width()+mAgenda->frameWidth() ); | 797 | dayLabel->setFixedWidth( mTimeLabels->width()+mAgenda->frameWidth() ); |
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; |
741 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); | 809 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); |
742 | int counter = -1; | 810 | int counter = -1; |
743 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { | 811 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { |
744 | ++counter; | 812 | ++counter; |
745 | QDate date = *dit; | 813 | QDate date = *dit; |
746 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); | 814 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); |
747 | if ( ! appendLabels ) { | 815 | if ( ! appendLabels ) { |
748 | dayLabel = mDayLabelsList.next(); | 816 | dayLabel = mDayLabelsList.next(); |
749 | if ( !dayLabel ) | 817 | if ( !dayLabel ) |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index b8a0f09..8affe50 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -758,40 +758,40 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
758 | if ( colModulo ) { | 758 | if ( colModulo ) { |
759 | int colt1 = mSelEndT%7; | 759 | int colt1 = mSelEndT%7; |
760 | //qDebug("colt1 %d ", colt1 ); | 760 | //qDebug("colt1 %d ", colt1 ); |
761 | if ( colt1 >= 7 - colModulo ) | 761 | if ( colt1 >= 7 - colModulo ) |
762 | addCol = colt1 - 7 + colModulo+1; | 762 | addCol = colt1 - 7 + colModulo+1; |
763 | int colt = mSelStartT%7; | 763 | int colt = mSelStartT%7; |
764 | if ( colt >= 7 - colModulo ) | 764 | if ( colt >= 7 - colModulo ) |
765 | addCol2 = colt - 7 + colModulo; | 765 | addCol2 = colt - 7 + colModulo; |
766 | addCol -= addCol2; | 766 | addCol -= addCol2; |
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 { |
775 | // draw first row to the right | 775 | // draw first row to the right |
776 | if ( colModulo ) { | 776 | if ( colModulo ) { |
777 | if ( col >= 7 - colModulo ) | 777 | if ( col >= 7 - colModulo ) |
778 | addCol2 = col - 7 + colModulo; | 778 | addCol2 = col - 7 + colModulo; |
779 | } | 779 | } |
780 | if ( rowModulo ) { | 780 | if ( rowModulo ) { |
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); |
789 | // draw full block till last line | 789 | // draw full block till last line |
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 ); | 796 | //qDebug("%d %d %d ",selh, row, addRow ); |
797 | int addrow2 = addRow-selh+1; | 797 | int addrow2 = addRow-selh+1; |
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index 253175e..2a30346 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp | |||
@@ -264,44 +264,40 @@ QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions() | |||
264 | void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) | 264 | void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) |
265 | { | 265 | { |
266 | QPixmap buffer( size() ); | 266 | QPixmap buffer( size() ); |
267 | QPainter p( &buffer ); | 267 | QPainter p( &buffer ); |
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 | #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() ); |
280 | //buffer.fill( backgroundColor() ); | 280 | //buffer.fill( backgroundColor() ); |
281 | // parentWidget()->style().drawPrimitive( QStyle::PE_Panel, &p, rect(), parentWidget()->colorGroup()); | 281 | // parentWidget()->style().drawPrimitive( QStyle::PE_Panel, &p, rect(), parentWidget()->colorGroup()); |
282 | 282 | ||
283 | 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 |
284 | 284 | ||
285 | // arrow color | 285 | // arrow color |
286 | QColor col; | 286 | QColor col; |
287 | if ( _activeButton ) | 287 | if ( _activeButton ) |
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 | 291 | col = Qt::white; |
292 | col = QColor( 178,18,188);//QColor( 242,27,255 );//Qt::white; | ||
293 | #else | ||
294 | col = Qt::white; | ||
295 | #endif | ||
296 | else | 292 | else |
297 | col = colorGroup().background().dark( 150 ); | 293 | col = colorGroup().background().dark( 150 ); |
298 | } | 294 | } |
299 | //QColor col = backgroundColor().dark( 130 ); | 295 | //QColor col = backgroundColor().dark( 130 ); |
300 | p.setBrush( col ); | 296 | p.setBrush( col ); |
301 | p.setPen( col ); | 297 | p.setPen( col ); |
302 | 298 | ||
303 | QValueList<QPointArray> list = buttonRegions(); | 299 | QValueList<QPointArray> list = buttonRegions(); |
304 | int index = 1; | 300 | int index = 1; |
305 | if ( mUseOffset ) | 301 | if ( mUseOffset ) |
306 | p.translate( 0, 1 ); | 302 | p.translate( 0, 1 ); |
307 | for ( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { | 303 | for ( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { |
@@ -679,25 +675,25 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) | |||
679 | if ( opaqueOldPos >= 0 ) | 675 | if ( opaqueOldPos >= 0 ) |
680 | paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord, | 676 | paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord, |
681 | r.width(), 2*rBord ); | 677 | r.width(), 2*rBord ); |
682 | if ( p >= 0 ) | 678 | if ( p >= 0 ) |
683 | paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord ); | 679 | paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord ); |
684 | } | 680 | } |
685 | opaqueOldPos = p; | 681 | opaqueOldPos = p; |
686 | #else | 682 | #else |
687 | if ( !mRubberBand ) { | 683 | if ( !mRubberBand ) { |
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???? |
695 | if ( !rBord ) { | 691 | if ( !rBord ) { |
696 | if (QApplication::desktop()->width() <= 320 ) | 692 | if (QApplication::desktop()->width() <= 320 ) |
697 | rBord = 3; | 693 | rBord = 3; |
698 | else | 694 | else |
699 | rBord = 4; | 695 | rBord = 4; |
700 | } | 696 | } |
701 | int sw = style().splitterWidth(); | 697 | int sw = style().splitterWidth(); |
702 | if ( orient == Horizontal ) { | 698 | if ( orient == Horizontal ) { |
703 | if ( p >= 0 ) { | 699 | if ( p >= 0 ) { |
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp index e6144de..11635e1 100644 --- a/microkde/kdialogbase.cpp +++ b/microkde/kdialogbase.cpp | |||
@@ -127,41 +127,41 @@ void KDialogBase::hideButtons() | |||
127 | if ( mOkButton ) mOkButton->hide() ; | 127 | if ( mOkButton ) mOkButton->hide() ; |
128 | if ( mApplyButton ) mApplyButton->hide() ; | 128 | if ( mApplyButton ) mApplyButton->hide() ; |
129 | if ( mDefaultButton ) mDefaultButton->hide(); | 129 | if ( mDefaultButton ) mDefaultButton->hide(); |
130 | if ( mCancelButton ) mCancelButton->hide() ; | 130 | if ( mCancelButton ) mCancelButton->hide() ; |
131 | if ( mCloseButton ) mCloseButton->hide() ; | 131 | if ( mCloseButton ) mCloseButton->hide() ; |
132 | 132 | ||
133 | } | 133 | } |
134 | void KDialogBase::initLayout() | 134 | void KDialogBase::initLayout() |
135 | { | 135 | { |
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 | ||
144 | QBoxLayout *buttonLayout = new QHBoxLayout; | 144 | QBoxLayout *buttonLayout = new QHBoxLayout; |
145 | mTopLayout->addLayout( buttonLayout ); | 145 | mTopLayout->addLayout( buttonLayout ); |
146 | 146 | ||
147 | if ( mUser1Button ) buttonLayout->addWidget( mUser1Button ); | 147 | if ( mUser1Button ) buttonLayout->addWidget( mUser1Button ); |
148 | if ( mUser2Button ) buttonLayout->addWidget( mUser2Button ); | 148 | if ( mUser2Button ) buttonLayout->addWidget( mUser2Button ); |
149 | if ( mOkButton ) buttonLayout->addWidget( mOkButton ); | 149 | if ( mOkButton ) buttonLayout->addWidget( mOkButton ); |
150 | if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); | 150 | if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); |
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 ) |
159 | { | 159 | { |
160 | // kdDebug() << "KDialogBase::addPage(): " << name << endl; | 160 | // kdDebug() << "KDialogBase::addPage(): " << name << endl; |
161 | QFrame *frame = new QFrame( tabWidget() ); | 161 | QFrame *frame = new QFrame( tabWidget() ); |
162 | tabWidget()->addTab( frame, name ); | 162 | tabWidget()->addTab( frame, name ); |
163 | return frame; | 163 | return frame; |
164 | } | 164 | } |
165 | 165 | ||
166 | QFrame *KDialogBase::addPage( const QString &name, int, const QPixmap & ) | 166 | QFrame *KDialogBase::addPage( const QString &name, int, const QPixmap & ) |
167 | { | 167 | { |