From d47d67b6458edb88ddcd3bed4ed2490509b165a5 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 16 Apr 2024 05:44:42 +0300 Subject: [PATCH] kdeui: drop unused KRuler class Signed-off-by: Ivailo Monev --- includes/CMakeLists.txt | 1 - includes/KRuler | 1 - kdeui/CMakeLists.txt | 2 - kdeui/widgets/kruler.cpp | 747 --------------------------- kdeui/widgets/kruler.h | 395 -------------- kdewidgets/kde.widgets | 5 - kdewidgets/pics/CMakeLists.txt | 4 - kdewidgets/pics/kdualcolorbutton.png | Bin 187 -> 0 bytes kdewidgets/pics/kkeybutton.png | Bin 532 -> 0 bytes kdewidgets/pics/kpalettetable.png | Bin 196 -> 0 bytes kdewidgets/pics/kruler.png | Bin 208 -> 0 bytes 11 files changed, 1155 deletions(-) delete mode 100644 includes/KRuler delete mode 100644 kdeui/widgets/kruler.cpp delete mode 100644 kdeui/widgets/kruler.h delete mode 100644 kdewidgets/pics/kdualcolorbutton.png delete mode 100644 kdewidgets/pics/kkeybutton.png delete mode 100644 kdewidgets/pics/kpalettetable.png delete mode 100644 kdewidgets/pics/kruler.png diff --git a/includes/CMakeLists.txt b/includes/CMakeLists.txt index 3abf7a13..555ed2eb 100644 --- a/includes/CMakeLists.txt +++ b/includes/CMakeLists.txt @@ -212,7 +212,6 @@ install( KReplace KReplaceDialog KRestrictedLine - KRuler KRun KSaveFile KSelectAction diff --git a/includes/KRuler b/includes/KRuler deleted file mode 100644 index b4d0b803..00000000 --- a/includes/KRuler +++ /dev/null @@ -1 +0,0 @@ -#include "../kruler.h" diff --git a/kdeui/CMakeLists.txt b/kdeui/CMakeLists.txt index 96483008..3ad4dd38 100644 --- a/kdeui/CMakeLists.txt +++ b/kdeui/CMakeLists.txt @@ -208,7 +208,6 @@ set(kdeui_LIB_SRCS widgets/kratingpainter.cpp widgets/kratingwidget.cpp widgets/krestrictedline.cpp - widgets/kruler.cpp widgets/kselector.cpp widgets/kseparator.cpp widgets/kshortcutwidget.cpp @@ -478,7 +477,6 @@ install( widgets/ktitlewidget.h widgets/ktabbar.h widgets/ktabwidget.h - widgets/kruler.h widgets/kselector.h widgets/kshortcutwidget.h widgets/kstatusbar.h diff --git a/kdeui/widgets/kruler.cpp b/kdeui/widgets/kruler.cpp deleted file mode 100644 index b22b255f..00000000 --- a/kdeui/widgets/kruler.cpp +++ /dev/null @@ -1,747 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 1998 Jörg Habenicht (j.habenicht@europemail.com) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - - -#include "kruler.h" - -#include -#include -#include - -#define INIT_VALUE 0 -#define INIT_MIN_VALUE 0 -#define INIT_MAX_VALUE 100 -#define INIT_TINY_MARK_DISTANCE 1 -#define INIT_LITTLE_MARK_DISTANCE 5 -#define INIT_MIDDLE_MARK_DISTANCE (INIT_LITTLE_MARK_DISTANCE * 2) -#define INIT_BIG_MARK_DISTANCE (INIT_LITTLE_MARK_DISTANCE * 10) -#define INIT_SHOW_TINY_MARK false -#define INIT_SHOW_LITTLE_MARK true -#define INIT_SHOW_MEDIUM_MARK true -#define INIT_SHOW_BIG_MARK true -#define INIT_SHOW_END_MARK true -#define INIT_SHOW_POINTER true -#define INIT_SHOW_END_LABEL true - -#define INIT_PIXEL_PER_MARK (double)10.0 /* distance between 2 base marks in pixel */ -#define INIT_OFFSET (-20) -#define INIT_LENGTH_FIX true -#define INIT_END_OFFSET 0 - -#define FIX_WIDTH 20 /* widget width in pixel */ -#define LINE_END (FIX_WIDTH - 3) -#define END_MARK_LENGTH (FIX_WIDTH - 6) -#define END_MARK_X2 LINE_END -#define END_MARK_X1 (END_MARK_X2 - END_MARK_LENGTH) -#define BIG_MARK_LENGTH (END_MARK_LENGTH*3/4) -#define BIG_MARK_X2 LINE_END -#define BIG_MARK_X1 (BIG_MARK_X2 - BIG_MARK_LENGTH) -#define MIDDLE_MARK_LENGTH (END_MARK_LENGTH/2) -#define MIDDLE_MARK_X2 LINE_END -#define MIDDLE_MARK_X1 (MIDDLE_MARK_X2 - MIDDLE_MARK_LENGTH) -#define LITTLE_MARK_LENGTH (MIDDLE_MARK_LENGTH/2) -#define LITTLE_MARK_X2 LINE_END -#define LITTLE_MARK_X1 (LITTLE_MARK_X2 - LITTLE_MARK_LENGTH) -#define BASE_MARK_LENGTH (LITTLE_MARK_LENGTH/2) -#define BASE_MARK_X2 LINE_END -#define BASE_MARK_X1 (BASE_MARK_X2 - BASE_MARK_LENGTH) - -#define LABEL_SIZE 8 -#define END_LABEL_X 4 -#define END_LABEL_Y (END_LABEL_X + LABEL_SIZE - 2) - -#undef PROFILING - -#ifdef PROFILING -# include -#endif - -class KRuler::KRulerPrivate -{ -public: - int endOffset_length; /* marks the offset at the end of the ruler - * i.e. right side at horizontal and down side - * at vertical rulers. - * the ruler end mark is moved endOffset_length - * ticks away from the widget end. - * positive offset moves end mark inside the ruler. - * if lengthFix is true, endOffset_length holds the - * length of the ruler. - */ - int fontWidth; // ONLY valid for vertical rulers - - QAbstractSlider range; - Qt::Orientation dir; - int tmDist; - int lmDist; - int mmDist; - int bmDist; - int offset; - bool showtm : 1; /* show tiny, little, medium, big, endmarks */ - bool showlm : 1; - bool showmm : 1; - bool showbm : 1; - bool showem : 1; - - bool showpointer : 1; - bool showEndL : 1; - bool lengthFix : 1; - - double ppm; /* pixel per mark */ - - QString endlabel; -}; - - - -KRuler::KRuler(QWidget *parent) - : QAbstractSlider(parent) - , d( new KRulerPrivate ) -{ - setRange(INIT_MIN_VALUE, INIT_MAX_VALUE); - setPageStep(10); - setValue(INIT_VALUE); - init(Qt::Horizontal); - setFixedHeight(FIX_WIDTH); -} - - -KRuler::KRuler(Qt::Orientation orient, - QWidget *parent, Qt::WindowFlags f) - : QAbstractSlider(parent) - , d( new KRulerPrivate ) -{ - setRange(INIT_MIN_VALUE, INIT_MAX_VALUE); - setPageStep(10); - setValue(INIT_VALUE); - setWindowFlags(f); - init(orient); - if (orient == Qt::Horizontal) - setFixedHeight(FIX_WIDTH); - else - setFixedWidth(FIX_WIDTH); -} - - -KRuler::KRuler(Qt::Orientation orient, int widgetWidth, - QWidget *parent, Qt::WindowFlags f) - : QAbstractSlider(parent) - , d( new KRulerPrivate ) -{ - setRange(INIT_MIN_VALUE, INIT_MAX_VALUE); - setPageStep(10); - setValue(INIT_VALUE); - setWindowFlags(f); - init(orient); - if (orient == Qt::Horizontal) - setFixedHeight(widgetWidth); - else - setFixedWidth(widgetWidth); -} - - -void KRuler::init(Qt::Orientation orientation) -{ - #warning FIXME setFrameStyle(WinPanel | Raised); - - d->showpointer = INIT_SHOW_POINTER; - d->showEndL = INIT_SHOW_END_LABEL; - d->lengthFix = INIT_LENGTH_FIX; - d->endOffset_length = INIT_END_OFFSET; - - d->tmDist = INIT_TINY_MARK_DISTANCE; - d->lmDist = INIT_LITTLE_MARK_DISTANCE; - d->mmDist = INIT_MIDDLE_MARK_DISTANCE; - d->bmDist = INIT_BIG_MARK_DISTANCE; - d->offset= INIT_OFFSET; - d->showtm = INIT_SHOW_TINY_MARK; - d->showlm = INIT_SHOW_LITTLE_MARK; - d->showmm = INIT_SHOW_MEDIUM_MARK; - d->showbm = INIT_SHOW_BIG_MARK; - d->showem = INIT_SHOW_END_MARK; - d->ppm = INIT_PIXEL_PER_MARK; - d->dir = orientation; -} - - -KRuler::~KRuler() -{ - delete d; -} - - - - - -void -KRuler::setTinyMarkDistance(int dist) -{ - if (dist != d->tmDist) { - d->tmDist = dist; - update(contentsRect()); - } -} - -int -KRuler::tinyMarkDistance() const -{ return d->tmDist; } - -void -KRuler::setLittleMarkDistance(int dist) -{ - if (dist != d->lmDist) { - d->lmDist = dist; - update(contentsRect()); - } -} - -int -KRuler::littleMarkDistance() const -{ return d->lmDist; } - -void -KRuler::setMediumMarkDistance(int dist) -{ - if (dist != d->mmDist) { - d->mmDist = dist; - update(contentsRect()); - } -} - -int -KRuler::mediumMarkDistance() const -{ return d->mmDist; } - -void -KRuler::setBigMarkDistance(int dist) -{ - if (dist != d->bmDist) { - d->bmDist = dist; - update(contentsRect()); - } -} - -int -KRuler::bigMarkDistance() const -{ return d->bmDist; } - -void -KRuler::setShowTinyMarks(bool show) -{ - if (show != d->showtm) { - d->showtm = show; - update(contentsRect()); - } -} - -bool -KRuler::showTinyMarks() const -{ - return d->showtm; -} - -void -KRuler::setShowLittleMarks(bool show) -{ - if (show != d->showlm) { - d->showlm = show; - update(contentsRect()); - } -} - -bool -KRuler::showLittleMarks() const -{ - return d->showlm; -} - -void -KRuler::setShowMediumMarks(bool show) -{ - if (show != d->showmm) { - d->showmm = show; - update(contentsRect()); - } -} - -bool -KRuler::showMediumMarks() const -{ - return d->showmm; -} - -void -KRuler::setShowBigMarks(bool show) -{ - if (show != d->showbm) { - d->showbm = show; - update(contentsRect()); - } -} - - -bool -KRuler::showBigMarks() const -{ - return d->showbm; -} - -void -KRuler::setShowEndMarks(bool show) -{ - if (show != d->showem) { - d->showem = show; - update(contentsRect()); - } -} - -bool -KRuler::showEndMarks() const -{ - return d->showem; -} - -void -KRuler::setShowPointer(bool show) -{ - if (show != d->showpointer) { - d->showpointer = show; - update(contentsRect()); - } -} - - -bool -KRuler::showPointer() const -{ - return d->showpointer; -} - -void -KRuler::setFrameStyle(int) -{ -#warning implement me (jowenn) -} - -void -KRuler::setShowEndLabel(bool show) -{ - if (d->showEndL != show) { - d->showEndL = show; - update(contentsRect()); - } -} - - -bool -KRuler::showEndLabel() const -{ - return d->showEndL; -} - - -void -KRuler::setEndLabel(const QString& label) -{ - d->endlabel = label; - - // premeasure the fontwidth and save it - if (d->dir == Qt::Vertical) { - QFont font = this->font(); - font.setPointSize(LABEL_SIZE); - QFontMetrics fm(font); - d->fontWidth = fm.width(d->endlabel); - } - update(contentsRect()); -} - -QString KRuler::endLabel() const -{ - return d->endlabel; -} - -void -KRuler::setRulerMetricStyle(KRuler::MetricStyle style) -{ - switch (style) { - default: /* fall through */ - case Custom: - return; - case Pixel: - setLittleMarkDistance(1); - setMediumMarkDistance(5); - setBigMarkDistance(10); - - setShowTinyMarks(false); - setShowLittleMarks(true); - setShowMediumMarks(true); - setShowBigMarks(true); - setShowEndMarks(true); - - update(contentsRect()); - setPixelPerMark(10.0); - - break; - case Inch: - setTinyMarkDistance(1); - setLittleMarkDistance(2); - setMediumMarkDistance(4); - setBigMarkDistance(8); - - setShowTinyMarks(true); - setShowLittleMarks(true); - setShowMediumMarks(true); - setShowBigMarks(true); - setShowEndMarks(true); - - update(contentsRect()); - setPixelPerMark(9.0); - - break; - case Millimetres: /* fall through */ - case Centimetres: /* fall through */ - case Metres: - setLittleMarkDistance(1); - setMediumMarkDistance(5); - setBigMarkDistance(10); - - setShowTinyMarks(false); - setShowLittleMarks(true); - setShowMediumMarks(true); - setShowBigMarks(true); - setShowEndMarks(true); - - update(contentsRect()); - setPixelPerMark(3.0); - } - switch (style) { - case Pixel: - setEndLabel(QLatin1String("pixel")); - break; - case Inch: - setEndLabel(QLatin1String("inch")); - break; - case Millimetres: - setEndLabel(QLatin1String("mm")); - break; - case Centimetres: - setEndLabel(QLatin1String("cm")); - break; - case Metres: - setEndLabel(QLatin1String("m")); - default: /* never reached, see above switch */ - /* empty command */; - } - // if the style changes one of the values, - // update would have been called inside the methods - // -> no update() call needed here ! -} - -void -KRuler::setPixelPerMark(double rate) -{ // never compare floats against each other :) - d->ppm = rate; - update(contentsRect()); -} - -double -KRuler::pixelPerMark() const -{ return d->ppm; } - -void -KRuler::setLength(int length) -{ - int tmp; - if (d->lengthFix) { - tmp = length; - } - else { - tmp = width() - length; - } - if (tmp != d->endOffset_length) { - d->endOffset_length = tmp; - update(contentsRect()); - } -} - -int -KRuler::length() const -{ - if (d->lengthFix) { - return d->endOffset_length; - } - return (width() - d->endOffset_length); -} - - -void -KRuler::setLengthFixed(bool fix) -{ - d->lengthFix = fix; -} - -bool -KRuler::lengthFixed() const -{ - return d->lengthFix; -} - -void -KRuler::setOffset(int _offset) -{// debug("set offset %i", _offset); - if (d->offset != _offset) { - d->offset = _offset; - update(contentsRect()); - } -} - -int -KRuler::offset() const -{ return d->offset; } - -int -KRuler::endOffset() const -{ - if (d->lengthFix) { - return (width() - d->endOffset_length); - } - return d->endOffset_length; -} - - -void -KRuler::slideUp(int count) -{ - if (count) { - d->offset += count; - update(contentsRect()); - } -} - -void -KRuler::slideDown(int count) -{ - if (count) { - d->offset -= count; - update(contentsRect()); - } -} - - -void -KRuler::slotNewValue(int _value) -{ - int oldvalue = value(); - if (oldvalue == _value) { - return; - } - // setValue(_value); - setValue(_value); - if (value() == oldvalue) { - return; - } - // get the rectangular of the old and the new ruler pointer - // and repaint only him - if (d->dir == Qt::Horizontal) { - QRect oldrec(-5+oldvalue,10, 11,6); - QRect newrec(-5+_value,10, 11,6); - repaint( oldrec.united(newrec) ); - } - else { - QRect oldrec(10,-5+oldvalue, 6,11); - QRect newrec(10,-5+_value, 6,11); - repaint( oldrec.united(newrec) ); - } -} - -void -KRuler::slotNewOffset(int _offset) -{ - if (d->offset != _offset) { - //setOffset(_offset); - d->offset = _offset; - repaint(contentsRect()); - } -} - - -void -KRuler::slotEndOffset(int offset) -{ - int tmp; - if (d->lengthFix) { - tmp = width() - offset; - } - else { - tmp = offset; - } - if (d->endOffset_length != tmp) { - d->endOffset_length = tmp; - repaint(contentsRect()); - } -} - -void -KRuler::paintEvent(QPaintEvent * /*e*/) -{ - // debug ("KRuler::drawContents, %s",(horizontal==dir)?"horizontal":"vertical"); - - QStylePainter p(this); -#ifdef PROFILING - QTime time; - time.start(); - for (int profile=0; profile<10; profile++) { -#endif - - int value = this->value(), - minval = minimum(), - maxval; - if (d->dir == Qt::Horizontal) { - maxval = maximum() - + d->offset - - (d->lengthFix?(height()-d->endOffset_length):d->endOffset_length); - } - else - { - maxval = maximum() - + d->offset - - (d->lengthFix?(width()-d->endOffset_length):d->endOffset_length); - } - //ioffsetval = value-offset; - // pixelpm = (int)ppm; - // left = clip.left(), - // right = clip.right(); - double f, fend, - offsetmin=(double)(minval-d->offset), - offsetmax=(double)(maxval-d->offset), - fontOffset = (((double)minval)>offsetmin)?(double)minval:offsetmin; - - // draw labels - QFont font = p.font(); - font.setPointSize(LABEL_SIZE); - p.setFont( font ); - // draw littlemarklabel - - // draw mediummarklabel - - // draw bigmarklabel - - // draw endlabel - if (d->showEndL) { - if (d->dir == Qt::Horizontal) { - p.translate( fontOffset, 0 ); - p.drawText( END_LABEL_X, END_LABEL_Y, d->endlabel ); - } - else { // rotate text +pi/2 and move down a bit - //QFontMetrics fm(font); -#ifdef KRULER_ROTATE_TEST - p.rotate( -90.0 + rotate ); - p.translate( -8.0 - fontOffset - d->fontWidth + xtrans, - ytrans ); -#else - p.rotate( -90.0 ); - p.translate( -8.0 - fontOffset - d->fontWidth, 0.0 ); -#endif - p.drawText( END_LABEL_X, END_LABEL_Y, d->endlabel ); - } - p.resetMatrix(); - } - - // draw the tiny marks - if (d->showtm) { - fend = d->ppm*d->tmDist; - for ( f=offsetmin; fdir == Qt::Horizontal) { - p.drawLine((int)f, BASE_MARK_X1, (int)f, BASE_MARK_X2); - } - else { - p.drawLine(BASE_MARK_X1, (int)f, BASE_MARK_X2, (int)f); - } - } - } - if (d->showlm) { - // draw the little marks - fend = d->ppm*d->lmDist; - for ( f=offsetmin; fdir == Qt::Horizontal) { - p.drawLine((int)f, LITTLE_MARK_X1, (int)f, LITTLE_MARK_X2); - } - else { - p.drawLine(LITTLE_MARK_X1, (int)f, LITTLE_MARK_X2, (int)f); - } - } - } - if (d->showmm) { - // draw medium marks - fend = d->ppm*d->mmDist; - for ( f=offsetmin; fdir == Qt::Horizontal) { - p.drawLine((int)f, MIDDLE_MARK_X1, (int)f, MIDDLE_MARK_X2); - } - else { - p.drawLine(MIDDLE_MARK_X1, (int)f, MIDDLE_MARK_X2, (int)f); - } - } - } - if (d->showbm) { - // draw big marks - fend = d->ppm*d->bmDist; - for ( f=offsetmin; fdir == Qt::Horizontal) { - p.drawLine((int)f, BIG_MARK_X1, (int)f, BIG_MARK_X2); - } - else { - p.drawLine(BIG_MARK_X1, (int)f, BIG_MARK_X2, (int)f); - } - } - } - if (d->showem) { - // draw end marks - if (d->dir == Qt::Horizontal) { - p.drawLine(minval-d->offset, END_MARK_X1, minval-d->offset, END_MARK_X2); - p.drawLine(maxval-d->offset, END_MARK_X1, maxval-d->offset, END_MARK_X2); - } - else { - p.drawLine(END_MARK_X1, minval-d->offset, END_MARK_X2, minval-d->offset); - p.drawLine(END_MARK_X1, maxval-d->offset, END_MARK_X2, maxval-d->offset); - } - } - - // draw pointer - if (d->showpointer) { - QPolygon pa(4); - if (d->dir == Qt::Horizontal) { - pa.setPoints(3, value-5, 10, value+5, 10, value/*+0*/,15); - } - else { - pa.setPoints(3, 10, value-5, 10, value+5, 15, value/*+0*/); - } - p.setBrush( p.background().color() ); - p.drawPolygon( pa ); - } - -#ifdef PROFILING - } - int elapsed = time.elapsed(); - debug("paint time %i",elapsed); -#endif - -} - -#include "moc_kruler.cpp" diff --git a/kdeui/widgets/kruler.h b/kdeui/widgets/kruler.h deleted file mode 100644 index 91e40d33..00000000 --- a/kdeui/widgets/kruler.h +++ /dev/null @@ -1,395 +0,0 @@ -/* -*- c++ -*- */ -/* This file is part of the KDE libraries - Copyright (C) 1998 Jörg Habenicht (j.habenicht@europemail.com) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KRULER_H -#define KRULER_H - -#include - -#include - -/** - * A ruler widget. - * - * The vertical ruler looks similar to this: - * - *\code - * meters inches - * - * ------ <--- end mark ---> ------ - * -- - - * -- <---little mark---> -- - * -- - - * -- --- - * --- <---medium mark - - * -- -- - * -- tiny mark----> - - * -- ---- - * -- - - * ---- <-----big mark -- - * -- - - * |>-- <--ruler pointer--> |>-- - * - * \endcode - * - * There are tiny marks, little marks, medium marks, and big marks along the - * ruler. - * - * To receive mouse clicks or mouse moves, - * the class has to be overloaded. - * - * For performance reasons, the public methods don't call QWidget::repaint(). - * (Slots do, see documentation below.) - * All the changed settings will be painted once after leaving - * to the main event loop. - * For performance painting the slot methods should be used, - * they do a fast QWidget::repaint() call after changing the values. - * For setting multiple values like minValue(), maxValue(), offset() etc. - * using the public methods is recommended - * so the widget will be painted only once when entering the main event loop. - * - * \image html kruler.png "KDE Ruler Widget" - * - * @short A ruler widget. - * @author Jörg Habenicht - */ -class KDEUI_EXPORT KRuler : public QAbstractSlider -{ - Q_OBJECT - Q_PROPERTY( bool showTinyMarks READ showTinyMarks WRITE setShowTinyMarks ) - Q_PROPERTY( bool showLittleMarks READ showLittleMarks WRITE setShowLittleMarks ) - Q_PROPERTY( bool showMediumMarks READ showMediumMarks WRITE setShowMediumMarks ) - Q_PROPERTY( bool showBigMarks READ showBigMarks WRITE setShowBigMarks ) - Q_PROPERTY( bool showPointer READ showPointer WRITE setShowPointer ) - Q_PROPERTY( bool showEndLabel READ showEndLabel WRITE setShowEndLabel ) - Q_PROPERTY( int tinyMarkDistance READ tinyMarkDistance WRITE setTinyMarkDistance ) - Q_PROPERTY( int littleMarkDistance READ littleMarkDistance WRITE setLittleMarkDistance ) - Q_PROPERTY( int mediumMarkDistance READ mediumMarkDistance WRITE setBigMarkDistance ) - Q_PROPERTY( int bigMarkDistance READ bigMarkDistance WRITE setBigMarkDistance ) - Q_PROPERTY( double pixelPerMark READ pixelPerMark WRITE setPixelPerMark ) - Q_PROPERTY( bool lengthFixed READ lengthFixed WRITE setLengthFixed ) - Q_PROPERTY( QString endLabel READ endLabel WRITE setEndLabel ) - Q_ENUMS( MetricStyle ) - Q_PROPERTY( int length READ length WRITE setLength ) - Q_PROPERTY( int offset READ offset ) - Q_PROPERTY( int endOffset READ endOffset ) - -public: - -/* -#define KRULER_ROTATE_TEST KRULER_ROTATE_TEST -#undef KRULER_ROTATE_TEST -#ifdef KRULER_ROTATE_TEST - double xtrans, ytrans, rotate; -# warning tmporaer variablen eingeschaltet -#endif -*/ - - /** - * The types of units used. - **/ - enum MetricStyle { Custom=0, Pixel, Inch, Millimetres, Centimetres, Metres }; - - /** - * The style (or look) of the ruler. - **/ - // enum PaintStyle { Flat, Raised, Sunken }; - - /** - * Constructs a horizontal ruler. - */ - explicit KRuler(QWidget *parent=0); - /** - * Constructs a ruler with orientation @p orient. - * - * @p parent and @p f are passed to QFrame. - * The default look is a raised widget - * but may be changed with the inherited QFrame methods. - * - * @param orient Orientation of the ruler. - * @param parent Will be handed over to QFrame. - * @param f Will be handed over to QFrame. - * - **/ - explicit KRuler(Qt::Orientation orient, QWidget *parent=0, Qt::WindowFlags f=0); - - /** - * Constructs a ruler with orientation @p orient and initial width @p widgetWidth. - * - * The width sets the fixed width of the widget. This is useful if you - * want to draw the ruler bigger or smaller than the default size. - * Note: The size of the marks doesn't change. - * @p parent and @p f are passed to QFrame. - * - * @param orient Orientation of the ruler. - * @param widgetWidth Fixed width of the widget. - * @param parent Will be handed over to QFrame. - * @param f Will be handed over to QFrame. - * - */ - KRuler(Qt::Orientation orient, int widgetWidth, QWidget *parent=0, - Qt::WindowFlags f=0); - - /** - * Destructor. - */ - ~KRuler(); - - /** - * Sets the distance between tiny marks. - * - * This is mostly used in the English system (inches) with distance of 1. - */ - void setTinyMarkDistance(int); - /** - * Returns the distance between tiny marks. - **/ - int tinyMarkDistance() const; - - /** - * Sets the distance between little marks. - * - * The default value is 1 in the metric system and 2 in the English (inches) system. - */ - void setLittleMarkDistance(int); - - /** - * Returns the distance between little marks. - */ - int littleMarkDistance() const; - - /** - * Sets the distance between medium marks. - * - * For English (inches) styles it defaults to twice the little mark distance. - * For metric styles it defaults to five times the little mark distance. - **/ - void setMediumMarkDistance(int); - int mediumMarkDistance() const; - - /** - * Sets distance between big marks. - * - * For English (inches) or metric styles it is twice the medium mark distance. - **/ - void setBigMarkDistance(int); - /** - * Returns the distance between big marks. - **/ - int bigMarkDistance() const; - - /** - * Shows/hides tiny marks. - **/ - void setShowTinyMarks(bool); - bool showTinyMarks() const; - /** - * Shows/hides little marks. - **/ - void setShowLittleMarks(bool); - bool showLittleMarks() const; - /** - * Shows/hides medium marks. - **/ - void setShowMediumMarks(bool); - bool showMediumMarks() const; - /** - * Shows/hides big marks. - **/ - void setShowBigMarks(bool); - bool showBigMarks() const; - /** - * Shows/hides end marks. - **/ - void setShowEndMarks(bool); - bool showEndMarks() const; - /** - * Shows/hides the pointer. - */ - void setShowPointer(bool); - bool showPointer() const; - - - void setFrameStyle(int); - - /** - * Show/hide number values of the little marks. - * - * Default is @p false. - **/ - // void setShowLittleMarkLabel(bool); - - /** - * Show/hide number values of the medium marks. - * - * Default is @p false. - **/ - // void setShowMediumMarkLabel(bool); - - /** - * Show/hide number values of the big marks. - * - * Default is @p false. - **/ - // void showBigMarkLabel(bool); - - /** - * Show/hide number values of the end marks. - * - * Default is @p false. - **/ - void setShowEndLabel(bool); - bool showEndLabel() const; - - /** - * Sets the label this is drawn at the beginning of the visible part - * of the ruler to @p label - **/ - void setEndLabel(const QString&); - QString endLabel() const; - - /** - * Sets up the necessary tasks for the provided styles. - * - * A convenience method. - **/ - void setRulerMetricStyle(KRuler::MetricStyle); - - /** - * Sets the number of pixels between two base marks. - * - * Calling this method stretches or shrinks your ruler. - * - * For pixel display ( MetricStyle) the value is 10.0 marks - * per pixel ;-) - * For English (inches) it is 9.0, and for centimetres ~2.835 -> 3.0 . - * If you want to magnify your part of display, you have to - * adjust the mark distance @p here. - * Notice: The double type is only supported to give the possibility - * of having some double values. - * It should be used with care. Using values below 10.0 - * shows visible jumps of markpositions (e.g. 2.345). - * Using whole numbers is highly recommended. - * To use @p int values use setPixelPerMark((int)your_int_value); - * default: 1 mark per 10 pixels - */ - void setPixelPerMark(double rate); - - /** - * Returns the number of pixels between two base marks. - **/ - double pixelPerMark() const; - - /** - * Sets the length of the ruler, i.e. the difference between - * the begin mark and the end mark of the ruler. - * - * Same as (width() - offset()) - * - * when the length is not locked, it gets adjusted with the - * length of the widget. - */ - void setLength(int); - int length() const; - - /** - * Locks the length of the ruler, i.e. the difference between - * the two end marks doesn't change when the widget is resized. - * - * @param fix fixes the length, if true - */ - void setLengthFixed(bool fix); - bool lengthFixed() const; - - /** - * Sets the number of pixels by which the ruler may slide up or left. - * The number of pixels moved is realive to the previous position. - * The Method makes sense for updating a ruler, which is working with - * a scrollbar. - * - * This doesn't affect the position of the ruler pointer. - * Only the visible part of the ruler is moved. - * - * @param count Number of pixel moving up or left relative to the previous position - **/ - void slideUp(int count = 1); - - /** - * Sets the number of pixels by which the ruler may slide down or right. - * The number of pixels moved is realive to the previous position. - * The Method makes sense for updating a ruler, which is working with - * a scrollbar. - * - * This doesn't affect the position of the ruler pointer. - * Only the visible part of the ruler is moved. - * - * @param count Number of pixel moving up or left relative to the previous position - **/ - void slideDown(int count = 1); - - /** - * Sets the ruler slide offset. - * - * This is like slideup() or slidedown() with an absolute offset - * from the start of the ruler. - * - * @param offset Number of pixel to move the ruler up or left from the beginning - **/ - void setOffset(int offset); - - /** - * Returns the current ruler offset. - **/ - int offset() const; - - int endOffset() const; - -public Q_SLOTS: - - /** - * Sets the pointer to a new position. - * - * The offset is NOT updated. - * QWidget::repaint() is called afterwards. - **/ - void slotNewValue(int); - - /** - * Sets the ruler marks to a new position. - * - * The pointer is NOT updated. - * QWidget::repaint() is called afterwards. - **/ - void slotNewOffset(int); - - void slotEndOffset(int); - -protected: - virtual void paintEvent(QPaintEvent *); - -private: - void init(Qt::Orientation orientation); - -private: - class KRulerPrivate; - KRulerPrivate * const d; -}; - -#endif diff --git a/kdewidgets/kde.widgets b/kdewidgets/kde.widgets index 58eec800..c76600c1 100644 --- a/kdewidgets/kde.widgets +++ b/kdewidgets/kde.widgets @@ -187,11 +187,6 @@ Group=Display (KDE) ToolTip=Line Edit for restricted input (KDE) Group=Input (KDE) -[KRuler] -ToolTip=Measuring Ruler Widget (KDE) -WhatsThis=A measuring ruler widget as seen in KWord for page widths and heights -Group=Display (KDE) - [KSeparator] IncludeFile=kseparator.h ToolTip=Standard horizontal or vertical separator. diff --git a/kdewidgets/pics/CMakeLists.txt b/kdewidgets/pics/CMakeLists.txt index b1099791..2156b002 100644 --- a/kdewidgets/pics/CMakeLists.txt +++ b/kdewidgets/pics/CMakeLists.txt @@ -11,7 +11,6 @@ install( kled.png ksqueezedtextlabel.png kurllabel.png - kruler.png kdoublenuminput.png klistbox.png kactivelabel.png @@ -20,7 +19,6 @@ install( khsselector.png kcolorbutton.png kgradientselector.png - kdualcolorbutton.png kpushbutton.png kcalendarwidget.png kdialog.png @@ -30,8 +28,6 @@ install( krestrictedline.png ktextedit.png kurlcomborequester.png - kkeybutton.png - kpalettetable.png kactionselector.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/kdewidgets/pics ) diff --git a/kdewidgets/pics/kdualcolorbutton.png b/kdewidgets/pics/kdualcolorbutton.png deleted file mode 100644 index f17f27f35948d3f6b1b61254f49522a92701ae80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H3?x5i&EW)6`~f~8uJ`WU12VmQyqX)E|NsA= z&}?uV$Y(4G@(X5gcy=QV$cgfFaSW-rwe+GR*MR^I=Ytu=|Bb`#1!pCN*PeC^5Lg+& zx-4;Spn=ef0Mh9%`+dlcmFUO1=i;wzowrwrbSsYUv1Ek4(HZ03tw g|2Ah`OSjFurl-p#gR&AMXE*51{^d)3aI)y}ll+TPyMtlrYJ-qO9^*3I75 z)!y3G-rC;(|NqUu0v-SW0P#sgK~#9!&6U?q!$1&44?QIG-h&}5Eur^rny>%=hsY8s zRzUK4{FF1=$D^wm&F-QS;E#!pL~6ntR>wKalFKC0)2KkDP1hquDnRO*UC9%PAZ_Vy z5(>coq_ET%NuL$2%}KYgW=`6J2}y7@J$|5V=A}b+@{``FH8}H9{f$xGGp1x}B+gH| zVf~I3FU0~SiyS?%5a_8f`0zDT^HS$ruyjr+}rLo9le6C_xj#SDyAy!gfR z(l^BHI)BQC|MlDTjQ;%nJ^kVN`Sv_>cBLiEG*|z2_^88{Ig`yJ{``6tT2Lrp*6G30 zEkDa#blo-6%^i)L%flrkIjy+oOU+>m=Hig@={dcTQLN-_yq-*ZyQtxVCzmWg7`U6Y z+c`RBwkR@-CB+uhe^;B-#E~5kaQLao>BeX4;@WbkzLb6Mw< G&;$S~%}YZ7