-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 12 | ||||
-rw-r--r-- | microkde/kdialogbase.cpp | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index ea3a329..d675517 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp @@ -649,82 +649,90 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) void KDGanttMinimizeSplitter::setRubberband( int p ) { #ifdef DESKTOP_VERSION QPainter paint( this ); paint.setPen( gray ); paint.setBrush( gray ); paint.setRasterOp( XorROP ); QRect r = contentsRect(); const int rBord = 3; //Themable???? #if QT_VERSION >= 0x030000 int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); #else int sw = style().splitterWidth(); #endif if ( orient == Horizontal ) { if ( opaqueOldPos >= 0 ) paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(), 2*rBord, r.height() ); if ( p >= 0 ) paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() ); } else { if ( opaqueOldPos >= 0 ) paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord, r.width(), 2*rBord ); if ( p >= 0 ) paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord ); } opaqueOldPos = p; #else if ( !mRubberBand ) { mRubberBand = new QFrame( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); mRubberBand->setFrameStyle( Box | Raised ); - mRubberBand->setPalette( QPalette ( Qt::green.light(),Qt::green.dark() ) ); + mRubberBand->setPalette( QPalette ( Qt::red.light(),Qt::red.dark() ) ); } QRect r = contentsRect(); - const int rBord = 5; //Themable???? + static int rBord = 0; //Themable???? + if ( !rBord ) { + if (QApplication::desktop()->width() <= 320 ) + rBord = 4; + else + rBord = 5; + } int sw = style().splitterWidth(); if ( orient == Horizontal ) { if ( p >= 0 ) { QPoint geo = mapToGlobal (QPoint ( p + sw/2 - rBord, r.y())); mRubberBand->setGeometry( geo.x(), geo.y(), 2*rBord, r.height() ); } } else { if ( p >= 0 ) { QPoint geo = mapToGlobal (QPoint ( r.x(), p + sw/2 - rBord)); mRubberBand->setGeometry( geo.x(), geo.y(), r.width(), 2*rBord); } } opaqueOldPos = p; + if ( ! mRubberBand->isVisible() ) { mRubberBand->show(); + } #endif } /*! \reimp */ bool KDGanttMinimizeSplitter::event( QEvent *e ) { if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) { recalc( isVisible() ); if ( e->type() == QEvent::Show ) data->firstShow = FALSE; } return QWidget::event( e ); } /*! \obsolete Draws the splitter handle in the rectangle described by \a x, \a y, \a w, \a h using painter \a p. \sa QStyle::drawPrimitive() */ void KDGanttMinimizeSplitter::drawSplitter( QPainter *p, QCOORD x, QCOORD y, QCOORD w, QCOORD h ) { #if 0 // LR style().drawPrimitive(QStyle::PE_Splitter, p, QRect(x, y, w, h), colorGroup(), (orientation() == Qt::Horizontal ? QStyle::Style_Horizontal : 0)); #endif diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp index f453331..e6144de 100644 --- a/microkde/kdialogbase.cpp +++ b/microkde/kdialogbase.cpp @@ -122,64 +122,66 @@ QTabWidget *KDialogBase::tabWidget() void KDialogBase::hideButtons() { if ( mUser1Button ) mUser1Button->hide() ; if ( mUser2Button ) mUser2Button->hide() ; if ( mOkButton ) mOkButton->hide() ; if ( mApplyButton ) mApplyButton->hide() ; if ( mDefaultButton ) mDefaultButton->hide(); if ( mCancelButton ) mCancelButton->hide() ; if ( mCloseButton ) mCloseButton->hide() ; } void KDialogBase::initLayout() { delete mTopLayout; mTopLayout = new QVBoxLayout( this ); mTopLayout->setMargin( marginHint() ); mTopLayout->setSpacing( spacingHint() ); mTopLayout->addWidget( mMainWidget ); QBoxLayout *buttonLayout = new QHBoxLayout; mTopLayout->addLayout( buttonLayout ); if ( mUser1Button ) buttonLayout->addWidget( mUser1Button ); if ( mUser2Button ) buttonLayout->addWidget( mUser2Button ); if ( mOkButton ) buttonLayout->addWidget( mOkButton ); if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton ); if ( mCancelButton ) buttonLayout->addWidget( mCancelButton ); if ( mCloseButton ) buttonLayout->addWidget( mCloseButton ); + buttonLayout->setMargin( 0 ); + buttonLayout->setSpacing( spacingHint() ); } QFrame *KDialogBase::addPage( const QString &name ) { // kdDebug() << "KDialogBase::addPage(): " << name << endl; QFrame *frame = new QFrame( tabWidget() ); tabWidget()->addTab( frame, name ); return frame; } QFrame *KDialogBase::addPage( const QString &name, int, const QPixmap & ) { return addPage( name ); } void KDialogBase::setMainWidget( QWidget *widget ) { kdDebug() << "KDialogBase::setMainWidget()" << endl; mMainWidget = widget; initLayout(); } void KDialogBase::setButtonText( ButtonCode id, const QString &text ) { QPushButton *button = findButton( id ); if ( button ) { button->setText( text ); } } |