summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp2
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp32
-rw-r--r--microkde/KDGanttMinimizeSplitter.h2
3 files changed, 34 insertions, 2 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 09d70f1..15e094d 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -1212,13 +1212,13 @@ void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
mEventPos = e->pos();
mEventGlobalPos = e->globalPos();
}
KListView::contentsMousePressEvent( e );
if ( e->button() == RightButton ) {
QListViewItem* ci = currentItem();
- clearSelection();
+ //clearSelection();
if ( ci )
ci->setSelected( true );
}
}
void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
{
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index 029f14b..ea3a329 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -186,12 +186,14 @@ void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e )
QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos()))
- mouseOffset;
s->setRubberband( -1 );
s->moveSplitter( pos, id() );
}
}
+ if ( s->rubberBand() )
+ s->rubberBand()->hide();
repaint();
}
int KDGanttSplitterHandle::onButton( const QPoint& p )
{
QValueList<QPointArray> list = buttonRegions();
@@ -431,20 +433,20 @@ static QSize minSizeHint( const QWidget* w )
if ( min.width() > 0 )
s.setWidth( min.width() );
return s.expandedTo(QSize(0,0));
}
-
/*!
Constructs a horizontal splitter with the \a parent and \a
name arguments being passed on to the QFrame constructor.
*/
KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *name )
:QFrame(parent,name,WPaintUnclipped)
{
+ mRubberBand = 0;
mFirstHandle = 0;
#if QT_VERSION >= 232
orient = Horizontal;
init();
#endif
}
@@ -453,12 +455,14 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *n
Constructs a splitter with orientation \a o with the \a parent
and \a name arguments being passed on to the QFrame constructor.
*/
KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent, const char *name )
:QFrame(parent,name,WPaintUnclipped)
{
+
+ mRubberBand = 0;
mFirstHandle = 0;
#if QT_VERSION >= 232
orient = o;
init();
#endif
}
@@ -469,12 +473,14 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent
KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter()
{
#if QT_VERSION >= 232
data->list.setAutoDelete( TRUE );
delete data;
#endif
+ if ( mRubberBand )
+ delete mRubberBand;
}
#if QT_VERSION >= 232
void KDGanttMinimizeSplitter::init()
{
@@ -639,12 +645,13 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c )
/*!
Shows a rubber band at position \a p. If \a p is negative, the
rubber band is removed.
*/
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????
@@ -664,12 +671,35 @@ void KDGanttMinimizeSplitter::setRubberband( int p )
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() ) );
+ }
+ QRect r = contentsRect();
+ const int rBord = 5; //Themable????
+ 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;
+ mRubberBand->show();
+#endif
}
/*! \reimp */
bool KDGanttMinimizeSplitter::event( QEvent *e )
{
diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h
index 84d3d8e..585298d 100644
--- a/microkde/KDGanttMinimizeSplitter.h
+++ b/microkde/KDGanttMinimizeSplitter.h
@@ -77,12 +77,13 @@ public:
QSize minimumSizeHint() const;
QValueList<int> sizes() const;
void setSizes( QValueList<int> );
KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;}
void expandPos( int id, int* min, int* max );
+ QFrame* rubberBand() { return mRubberBand ;}
public slots:
void toggle();
protected:
void childEvent( QChildEvent * );
bool event( QEvent * );
@@ -96,12 +97,13 @@ protected:
void styleChange( QStyle& );
int adjustPos( int , int );
virtual void setRubberband( int );
void getRange( int id, int*, int* );
private:
+ QFrame* mRubberBand;
void init();
void recalc( bool update = FALSE );
void doResize();
void storeSizes();
void processChildEvents();
QSplitterLayoutStruct *addWidget( QWidget*, bool first = FALSE );