Diffstat (limited to 'microkde/KDGanttMinimizeSplitter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index c60b566..029f14b 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp | |||
@@ -91,49 +91,49 @@ QSize KDGanttSplitterHandle::sizeHint() const | |||
91 | 91 | ||
92 | void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) | 92 | void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) |
93 | { | 93 | { |
94 | orient = o; | 94 | orient = o; |
95 | #ifndef QT_NO_CURSOR | 95 | #ifndef QT_NO_CURSOR |
96 | if ( o == KDGanttMinimizeSplitter::Horizontal ) | 96 | if ( o == KDGanttMinimizeSplitter::Horizontal ) |
97 | setCursor( splitHCursor ); | 97 | setCursor( splitHCursor ); |
98 | else | 98 | else |
99 | setCursor( splitVCursor ); | 99 | setCursor( splitVCursor ); |
100 | #endif | 100 | #endif |
101 | } | 101 | } |
102 | 102 | ||
103 | 103 | ||
104 | void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) | 104 | void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) |
105 | { | 105 | { |
106 | updateCursor( e->pos() ); | 106 | updateCursor( e->pos() ); |
107 | if ( !(e->state()&LeftButton) ) | 107 | if ( !(e->state()&LeftButton) ) |
108 | return; | 108 | return; |
109 | 109 | ||
110 | if ( _activeButton != 0) | 110 | if ( _activeButton != 0) |
111 | return; | 111 | return; |
112 | 112 | ||
113 | QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) | 113 | QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) |
114 | - mouseOffset; | 114 | - mouseOffset; |
115 | if ( true /*opaque()*/ ) { | 115 | if ( opaque() ) { |
116 | s->moveSplitter( pos, id() ); | 116 | s->moveSplitter( pos, id() ); |
117 | } else { | 117 | } else { |
118 | int min = pos; int max = pos; | 118 | int min = pos; int max = pos; |
119 | s->getRange( id(), &min, &max ); | 119 | s->getRange( id(), &min, &max ); |
120 | s->setRubberband( QMAX( min, QMIN(max, pos ))); | 120 | s->setRubberband( QMAX( min, QMIN(max, pos ))); |
121 | } | 121 | } |
122 | _collapsed = false; | 122 | _collapsed = false; |
123 | } | 123 | } |
124 | 124 | ||
125 | void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) | 125 | void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) |
126 | { | 126 | { |
127 | if ( e->button() == LeftButton ) { | 127 | if ( e->button() == LeftButton ) { |
128 | _activeButton = onButton( e->pos() ); | 128 | _activeButton = onButton( e->pos() ); |
129 | mouseOffset = s->pick(e->pos()); | 129 | mouseOffset = s->pick(e->pos()); |
130 | mMouseDown = true; | 130 | mMouseDown = true; |
131 | repaint(); | 131 | repaint(); |
132 | updateCursor( e->pos() ); | 132 | updateCursor( e->pos() ); |
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | void KDGanttSplitterHandle::updateCursor( const QPoint& p) | 136 | void KDGanttSplitterHandle::updateCursor( const QPoint& p) |
137 | { | 137 | { |
138 | if ( onButton( p ) != 0 ) { | 138 | if ( onButton( p ) != 0 ) { |
139 | setCursor( arrowCursor ); | 139 | setCursor( arrowCursor ); |
@@ -462,48 +462,53 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent | |||
462 | init(); | 462 | init(); |
463 | #endif | 463 | #endif |
464 | } | 464 | } |
465 | 465 | ||
466 | /*! | 466 | /*! |
467 | Destroys the splitter and any children. | 467 | Destroys the splitter and any children. |
468 | */ | 468 | */ |
469 | KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() | 469 | KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() |
470 | { | 470 | { |
471 | #if QT_VERSION >= 232 | 471 | #if QT_VERSION >= 232 |
472 | data->list.setAutoDelete( TRUE ); | 472 | data->list.setAutoDelete( TRUE ); |
473 | delete data; | 473 | delete data; |
474 | #endif | 474 | #endif |
475 | } | 475 | } |
476 | 476 | ||
477 | 477 | ||
478 | #if QT_VERSION >= 232 | 478 | #if QT_VERSION >= 232 |
479 | void KDGanttMinimizeSplitter::init() | 479 | void KDGanttMinimizeSplitter::init() |
480 | { | 480 | { |
481 | data = new QSplitterData; | 481 | data = new QSplitterData; |
482 | if ( orient == Horizontal ) | 482 | if ( orient == Horizontal ) |
483 | setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) ); | 483 | setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) ); |
484 | else | 484 | else |
485 | setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) ); | 485 | setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) ); |
486 | #ifndef DESKTOP_VERSION | ||
487 | setOpaqueResize( false ); | ||
488 | #else | ||
489 | setOpaqueResize( true ); | ||
490 | #endif | ||
486 | } | 491 | } |
487 | #endif | 492 | #endif |
488 | 493 | ||
489 | 494 | ||
490 | void KDGanttMinimizeSplitter::toggle() | 495 | void KDGanttMinimizeSplitter::toggle() |
491 | { | 496 | { |
492 | if ( mFirstHandle ) | 497 | if ( mFirstHandle ) |
493 | mFirstHandle->toggle(); | 498 | mFirstHandle->toggle(); |
494 | else | 499 | else |
495 | qDebug("KDGanttMinimizeSplitter::toggle::sorry, handle not available "); | 500 | qDebug("KDGanttMinimizeSplitter::toggle::sorry, handle not available "); |
496 | 501 | ||
497 | } | 502 | } |
498 | 503 | ||
499 | 504 | ||
500 | /*! | 505 | /*! |
501 | \brief the orientation of the splitter | 506 | \brief the orientation of the splitter |
502 | 507 | ||
503 | By default the orientation is horizontal (the widgets are side by side). | 508 | By default the orientation is horizontal (the widgets are side by side). |
504 | The possible orientations are Qt:Vertical and Qt::Horizontal (the default). | 509 | The possible orientations are Qt:Vertical and Qt::Horizontal (the default). |
505 | */ | 510 | */ |
506 | void KDGanttMinimizeSplitter::setOrientation( Orientation o ) | 511 | void KDGanttMinimizeSplitter::setOrientation( Orientation o ) |
507 | { | 512 | { |
508 | #if QT_VERSION >= 232 | 513 | #if QT_VERSION >= 232 |
509 | if ( orient == o ) | 514 | if ( orient == o ) |