Commit fe95d283 authored by Sven Langkamp's avatar Sven Langkamp
Browse files

replaced KoColorSlider by KGradientSelector in the color choosers

svn path=/trunk/koffice/; revision=547463
parent b33ca33d
......@@ -24,14 +24,11 @@
#include <QLabel>
#include <QSpinBox>
#include <QColor>
//Added by qt3to4:
#include <Q3GridLayout>
#include <kdebug.h>
#include <kselector.h>
#include "koFrameButton.h"
#include "koColorSlider.h"
#include <kcolordialog.h>
KoGrayWidget::KoGrayWidget(QWidget *parent, const char *name) : super(parent, name)
{
......@@ -42,22 +39,21 @@ KoGrayWidget::KoGrayWidget(QWidget *parent, const char *name) : super(parent, na
Q3GridLayout *mGrid = new Q3GridLayout(this, 3, 5, 5, 2);
/* setup color sliders */
mSlider = new KoColorSlider(this);
mSlider = new KGradientSelector(Qt::Horizontal, this);
mSlider->setFocusPolicy( Qt::ClickFocus );
mSlider->setMaximumHeight(20);
mSlider->slotSetRange(0, 255);
mSlider->slotSetColor1(QColor(255, 255, 255));
mSlider->slotSetColor2(QColor(0, 0, 0));
mSlider->setMaximumHeight(25);
mSlider->setRange(0, 255);
mSlider->setColors(QColor(255, 255, 255), QColor(0, 0, 0));
/* setup slider labels */
mLabel = new QLabel("K:", this);
mLabel->setFixedWidth(12);
mLabel->setFixedHeight(20);
mLabel->setFixedHeight(25);
/* setup spin box */
mIn = new QSpinBox(0, 255, 1, this);
mIn->setFixedWidth(50);
mIn->setFixedHeight(20);
mIn->setFixedHeight(25);
mIn->setFocusPolicy( Qt::ClickFocus );
mGrid->addMultiCellWidget(m_ColorButton, 0, 3, 0, 0, Qt::AlignTop);
......@@ -118,7 +114,7 @@ void KoGrayWidget::update(const QColor & fgColor, const QColor & bgColor)
v /= 3.0;
v = 255.0 - v;
mIn->setValue(static_cast<int>(v));
mSlider->slotSetValue(static_cast<int>(v));
mSlider->setValue(static_cast<int>(v));
mIn->blockSignals(false);
mSlider->blockSignals(false);
......
......@@ -20,20 +20,16 @@
#define KO_GRAY_WIDGET_H
#include "qwidget.h"
//Added by qt3to4:
#include <QLabel>
#include <Q3GridLayout>
#include <koffice_export.h>
#include <kdualcolorbutton.h>
class KoFrameButton;
class Q3GridLayout;
class QColor;
class KoColorSlider;
class QLabel;
class QSpinBox;
class KDualColorButton;
class KGradientSelector;
class KOPAINTER_EXPORT KoGrayWidget
: public QWidget
......@@ -71,7 +67,7 @@ private:
void update(const QColor & fgColor, const QColor & bgColor);
KoColorSlider *mSlider;
KGradientSelector *mSlider;
QLabel *mLabel;
QSpinBox *mIn;
KDualColorButton *m_ColorButton;
......
......@@ -253,7 +253,7 @@ void KoHSVWidget::update(const KoColor & fgColor, const KoColor & bgColor)
mSIn->blockSignals(false);
mVIn->blockSignals(false);
m_VSelector->blockSignals(false);
//m_VSelector->repaint(false);
m_VSelector->repaint(false);
m_colorwheel->blockSignals(false);
}
......
......@@ -32,60 +32,60 @@
#include <kdebug.h>
#include <klocale.h>
#include "koFrameButton.h"
#include "koColorSlider.h"
#include <kcolordialog.h>
#include <kselector.h>
KoRGBWidget::KoRGBWidget(QWidget *parent, const char *name) : super(parent, name)
{
m_ColorButton = new KDualColorButton(this);
m_ColorButton -> setFixedSize(m_ColorButton->sizeHint());
Q3GridLayout *mGrid = new Q3GridLayout(this, 3, 5, 5, 2);
Q3GridLayout *mGrid = new Q3GridLayout(this, 3, 5, 5, 6);
/* setup color sliders */
mRSlider = new KoColorSlider(this);
mRSlider->setMaximumHeight(20);
mRSlider->slotSetRange(0, 255);
mRSlider = new KGradientSelector(Qt::Horizontal, this);
mRSlider->setInvertedAppearance(false);
mRSlider->setMaximumHeight(25);
mRSlider->setRange(0, 255);
mRSlider->setFocusPolicy( Qt::ClickFocus );
mGSlider = new KoColorSlider(this);
mGSlider->setMaximumHeight(20);
mGSlider->slotSetRange(0, 255);
mGSlider = new KGradientSelector(Qt::Horizontal, this);
mGSlider->setInvertedAppearance(false);
mGSlider->setMaximumHeight(25);
mGSlider->setRange(0, 255);
mGSlider->setFocusPolicy( Qt::ClickFocus );
mBSlider = new KoColorSlider(this);
mBSlider->setMaximumHeight(20);
mBSlider->slotSetRange(0, 255);
mBSlider = new KGradientSelector(Qt::Horizontal, this);
mBSlider->setInvertedAppearance(false);
mBSlider->setMaximumHeight(25);
mBSlider->setRange(0, 255);
mBSlider->setFocusPolicy( Qt::ClickFocus );
/* setup slider labels */
mRLabel = new QLabel("R:", this);
mRLabel->setFixedWidth(12);
mRLabel->setFixedHeight(20);
mRLabel->setFixedHeight(25);
mGLabel = new QLabel("G:", this);
mGLabel->setFixedWidth(12);
mGLabel->setFixedHeight(20);
mGLabel->setFixedHeight(25);
mBLabel = new QLabel("B:", this);
mBLabel->setFixedWidth(12);
mBLabel->setFixedHeight(20);
mBLabel->setFixedHeight(25);
/* setup spin box */
mRIn = new QSpinBox(0, 255, 1, this);
mRIn->setFixedWidth(50);
mRIn->setFixedHeight(20);
mRIn->setFixedHeight(25);
mRIn->setFocusPolicy( Qt::ClickFocus );
mRIn->setToolTip( i18n( "Red" ) );
mGIn = new QSpinBox(0, 255, 1, this);
mGIn->setFixedWidth(50);
mGIn->setFixedHeight(20);
mGIn->setFixedHeight(25);
mGIn->setFocusPolicy( Qt::ClickFocus );
mGIn->setToolTip( i18n( "Green" ) );
mBIn = new QSpinBox(0, 255, 1, this);
mBIn->setFixedWidth(50);
mBIn->setFixedHeight(20);
mBIn->setFixedHeight(25);
mBIn->setFocusPolicy( Qt::ClickFocus );
mBIn->setToolTip( i18n( "Blue" ) );
......@@ -174,19 +174,16 @@ void KoRGBWidget::update(const QColor fgColor, const QColor bgColor)
mBSlider->blockSignals(true);
mBIn->blockSignals(true);
mRSlider->slotSetColor1(QColor(0, g, b));
mRSlider->slotSetColor2(QColor(255, g, b));
mRSlider->slotSetValue(r);
mRSlider->setColors(QColor(0, g, b), QColor(255, g, b));
mRSlider->setValue(r);
mRIn->setValue(r);
mGSlider->slotSetColor1(QColor(r, 0, b));
mGSlider->slotSetColor2(QColor(r, 255, b));
mGSlider->slotSetValue(g);
mGSlider->setColors(QColor(r, 0, b), QColor(r, 255, b));
mGSlider->setValue(g);
mGIn->setValue(g);
mBSlider->slotSetColor1(QColor(r, g, 0));
mBSlider->slotSetColor2(QColor(r, g, 255));
mBSlider->slotSetValue(b);
mBSlider->setColors(QColor(r, g, 0), QColor(r, g, 255));
mBSlider->setValue(b);
mBIn->setValue(b);
mRSlider->blockSignals(false);
......
......@@ -20,22 +20,16 @@
#define KO_RGB_WIDGET_H
#include "qwidget.h"
//Added by qt3to4:
#include <QLabel>
#include <Q3GridLayout>
#include <koffice_export.h>
#include <kdualcolorbutton.h>
#include <koffice_export.h>
class KoFrameButton;
class Q3GridLayout;
class QColor;
class KoColorSlider;
class QLabel;
class QSpinBox;
class KDualColorButton;
class KoColorSlider;
class QColor;
class KGradientSelector;
class KOPAINTER_EXPORT KoRGBWidget
: public QWidget
......@@ -79,9 +73,9 @@ private:
private:
KoColorSlider *mRSlider;
KoColorSlider *mGSlider;
KoColorSlider *mBSlider;
KGradientSelector *mRSlider;
KGradientSelector *mGSlider;
KGradientSelector *mBSlider;
QLabel *mRLabel;
QLabel *mGLabel;
QLabel *mBLabel;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment