summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-02 09:05:01 (UTC)
committer zautrix <zautrix>2005-04-02 09:05:01 (UTC)
commite0d51120d2f0c178115746e0c1357af40f95bc77 (patch) (unidiff)
treea94402a08712553fedd1de5b3c604af777279674
parente7cb4c20af8b07bf923c864026481ce316c40e1d (diff)
downloadkdepimpi-e0d51120d2f0c178115746e0c1357af40f95bc77.zip
kdepimpi-e0d51120d2f0c178115746e0c1357af40f95bc77.tar.gz
kdepimpi-e0d51120d2f0c178115746e0c1357af40f95bc77.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index 2a30346..fb5d4e3 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -211,129 +211,129 @@ int KDGanttSplitterHandle::onButton( const QPoint& p )
211 index++; 211 index++;
212 } 212 }
213 return 0; 213 return 0;
214} 214}
215 215
216 216
217QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions() 217QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions()
218{ 218{
219 QValueList<QPointArray> list; 219 QValueList<QPointArray> list;
220 220
221 int sw = 8; 221 int sw = 8;
222 int yyy = 1; 222 int yyy = 1;
223 int xxx = 1; 223 int xxx = 1;
224 int voffset[] = { (int) -sw*3, (int) sw*3 }; 224 int voffset[] = { (int) -sw*3, (int) sw*3 };
225 for ( int i = 0; i < 2; i++ ) { 225 for ( int i = 0; i < 2; i++ ) {
226 QPointArray arr; 226 QPointArray arr;
227 if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right || 227 if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right ||
228 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left) { 228 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left) {
229 int mid = height()/2 + voffset[i]; 229 int mid = height()/2 + voffset[i];
230 arr.setPoints( 3, 230 arr.setPoints( 3,
231 1-xxx, mid - sw + 4, 231 1-xxx, mid - sw + 4,
232 sw-3-xxx, mid, 232 sw-3-xxx, mid,
233 1-xxx, mid + sw -4); 233 1-xxx, mid + sw -4);
234 } 234 }
235 else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left || 235 else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left ||
236 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right ) { 236 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right ) {
237 int mid = height()/2 + voffset[i]; 237 int mid = height()/2 + voffset[i];
238 arr.setPoints( 3, 238 arr.setPoints( 3,
239 sw-4, mid - sw + 4, 239 sw-4, mid - sw + 4,
240 0, mid, 240 0, mid,
241 sw-4, mid + sw - 4); 241 sw-4, mid + sw - 4);
242 } 242 }
243 else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Up || 243 else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Up ||
244 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Down) { 244 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Down) {
245 int mid = width()/2 + voffset[i]; 245 int mid = width()/2 + voffset[i];
246 arr.setPoints( 3, 246 arr.setPoints( 3,
247 mid - sw + 4, sw-4, 247 mid - sw + 4, sw-4,
248 mid, 0, 248 mid, 0,
249 mid + sw - 4, sw-4 ); 249 mid + sw - 4, sw-4 );
250 } 250 }
251 else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Down || 251 else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Down ||
252 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Up ) { 252 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Up ) {
253 int mid = width()/2 + voffset[i]; 253 int mid = width()/2 + voffset[i];
254 arr.setPoints( 3, 254 arr.setPoints( 3,
255 mid - sw + 4, 1-yyy, 255 mid - sw + 4, 1-yyy,
256 mid, sw-3-yyy, 256 mid, sw-3-yyy,
257 mid + sw -4, 1-yyy); 257 mid + sw -4, 1-yyy);
258 } 258 }
259 list.append( arr ); 259 list.append( arr );
260 } 260 }
261 return list; 261 return list;
262} 262}
263 263
264void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) 264void 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 && ! _activeButton)
276 buffer.fill( colorGroup().background().dark() ); 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 col = Qt::white; 291 col = Qt::white;
292 else 292 else
293 col = colorGroup().background().dark( 150 ); 293 col = colorGroup().background().dark( 150 );
294 } 294 }
295 //QColor col = backgroundColor().dark( 130 ); 295 //QColor col = backgroundColor().dark( 130 );
296 p.setBrush( col ); 296 p.setBrush( col );
297 p.setPen( col ); 297 p.setPen( col );
298 298
299 QValueList<QPointArray> list = buttonRegions(); 299 QValueList<QPointArray> list = buttonRegions();
300 int index = 1; 300 int index = 1;
301 if ( mUseOffset ) 301 if ( mUseOffset )
302 p.translate( 0, 1 ); 302 p.translate( 0, 1 );
303 for ( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { 303 for ( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) {
304 if ( index == _activeButton ) { 304 if ( index == _activeButton ) {
305 305
306 /* 306 /*
307 if ( ! _collapsed ) { 307 if ( ! _collapsed ) {
308 p.save(); 308 p.save();
309 // p.translate( parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftHorizontal ), 309 // p.translate( parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftHorizontal ),
310 // parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftVertical ) ); 310 // parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftVertical ) );
311 p.translate( -1, 0 ); 311 p.translate( -1, 0 );
312 p.drawPolygon( *it, true ); 312 p.drawPolygon( *it, true );
313 p.restore(); } else 313 p.restore(); } else
314 */ 314 */
315 p.drawPolygon( *it, true ); 315 p.drawPolygon( *it, true );
316 316
317 } 317 }
318 else { 318 else {
319 /* 319 /*
320 if ( ! _collapsed ) { 320 if ( ! _collapsed ) {
321 p.save(); 321 p.save();
322 p.translate( -1, 0 ); 322 p.translate( -1, 0 );
323 p.drawPolygon( *it, true ); 323 p.drawPolygon( *it, true );
324 p.restore(); 324 p.restore();
325 } else 325 } else
326 */ 326 */
327 p.drawPolygon( *it, true ); 327 p.drawPolygon( *it, true );
328 328
329 } 329 }
330 index++; 330 index++;
331 } 331 }
332 332
333 // Draw the lines between the arrows 333 // Draw the lines between the arrows
334 if ( s->minimizeDirection() == KDGanttMinimizeSplitter::Left || 334 if ( s->minimizeDirection() == KDGanttMinimizeSplitter::Left ||
335 s->minimizeDirection() == KDGanttMinimizeSplitter::Right ) { 335 s->minimizeDirection() == KDGanttMinimizeSplitter::Right ) {
336 int mid = height()/2; 336 int mid = height()/2;
337 p.drawLine ( 1, mid - sw, 1, mid + sw ); 337 p.drawLine ( 1, mid - sw, 1, mid + sw );
338 p.drawLine ( 3, mid - sw, 3, mid + sw ); 338 p.drawLine ( 3, mid - sw, 3, mid + sw );
339 } 339 }