From 440c3466dd007b2de9cc33cb6923691021ea2fb2 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Sat, 3 Nov 2012 03:45:15 +0100 Subject: [PATCH] Woops, forgot to save a few files --- src/widgets/SlideSwitchButton.cpp | 50 +++++++++++++++++++++++++++++++ src/widgets/UnstyledFrame.cpp | 7 +++++ 2 files changed, 57 insertions(+) diff --git a/src/widgets/SlideSwitchButton.cpp b/src/widgets/SlideSwitchButton.cpp index b453179e5..4b79d2ec0 100644 --- a/src/widgets/SlideSwitchButton.cpp +++ b/src/widgets/SlideSwitchButton.cpp @@ -281,3 +281,53 @@ SlideSwitchButton::createKnob() p.drawRoundedRect( m_knob.rect(), ROUNDING_RADIUS-1, ROUNDING_RADIUS-1 ); } + +QSize +SlideSwitchButton::minimumSizeHint() const +{ + return sizeHint(); +} + + +void +SlideSwitchButton::setKnobX(qreal x) +{ + m_knobX = x; + repaint(); +} + + +qreal +SlideSwitchButton::knobX() const +{ + return m_knobX; +} + + +void +SlideSwitchButton::setBaseColorTop(const QColor& color) +{ + m_baseColorTop = color; + repaint(); +} + + +QColor +SlideSwitchButton::baseColorTop() const +{ + return m_baseColorTop; +} + + +void +SlideSwitchButton::setBaseColorBottom(const QColor& color) +{ + m_baseColorBottom = color; +} + + +QColor +SlideSwitchButton::baseColorBottom() const +{ + return m_baseColorBottom; +} diff --git a/src/widgets/UnstyledFrame.cpp b/src/widgets/UnstyledFrame.cpp index a56fab17b..7a25078df 100644 --- a/src/widgets/UnstyledFrame.cpp +++ b/src/widgets/UnstyledFrame.cpp @@ -36,3 +36,10 @@ UnstyledFrame::paintEvent( QPaintEvent* event ) p.drawRect( contentsRect() ); p.end(); } + + +void UnstyledFrame::setFrameColor(const QColor& color) +{ + m_frameColor = color; + repaint(); +}