diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 2bda8f7717adf28da4af0d34fb82f63d2868c31d (patch) | |
tree | 8d927b7b47a90c4adb646482a52613f58acd6f8c /khexedit/lib/kbordercolumn.cpp | |
download | tdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.tar.gz tdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khexedit/lib/kbordercolumn.cpp')
-rw-r--r-- | khexedit/lib/kbordercolumn.cpp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/khexedit/lib/kbordercolumn.cpp b/khexedit/lib/kbordercolumn.cpp new file mode 100644 index 0000000..c590246 --- /dev/null +++ b/khexedit/lib/kbordercolumn.cpp @@ -0,0 +1,82 @@ +/*************************************************************************** + kbordercolumn.cpp - description + ------------------- + begin : Mit Mai 21 2003 + copyright : (C) 2003 by Friedrich W. H. Kossebau + email : Friedrich.W.H@Kossebau.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License version 2 as published by the Free Software Foundation. * + * * + ***************************************************************************/ + + +// qt specific +#include <qpainter.h> +#include <qstyle.h> +// lib specific +#include "kcolumnsview.h" +#include "kbordercolumn.h" + + +using namespace KHE; + +static const KPixelX DefaultWidth = 9; +static const KPixelX LineX = DefaultWidth / 2; + + +KBorderColumn::KBorderColumn( KColumnsView *V, bool M ) + : KColumn( V ), + Middle( M ) +{ + setWidth( M?DefaultWidth:LineX-1 ); +} + +KBorderColumn::~KBorderColumn() +{ +} + + +void KBorderColumn::paintLine( QPainter *P ) +{ + if( LineHeight > 0 ) + { + KColumn::paintBlankLine( P ); + + if( Middle ) + { + int GridColor = View->style().styleHint( QStyle::SH_Table_GridLineColor, View ); + P->setPen( GridColor != -1 ? (QRgb)GridColor : View->colorGroup().mid() ); + P->drawLine( LineX, 0, LineX, LineHeight-1 ) ; + } + } +} + + +void KBorderColumn::paintFirstLine( QPainter *P, KPixelXs , int ) +{ + paintLine( P ); +} + + +void KBorderColumn::paintNextLine( QPainter *P ) +{ + paintLine( P ); +} + +void KBorderColumn::paintEmptyColumn( QPainter *P, KPixelXs Xs, KPixelYs Ys ) +{ + KColumn::paintEmptyColumn( P,Xs,Ys ); + + KPixelX LX = x() + LineX; + if( Middle && Xs.includes(LX) ) + { + int GridColor = View->style().styleHint( QStyle::SH_Table_GridLineColor, View ); + P->setPen( GridColor != -1 ? (QRgb)GridColor : View->colorGroup().mid() ); + P->drawLine( LX, Ys.start(), LX, Ys.end() ) ; + } +} |