Fix includes
This commit is contained in:
parent
3506bdba74
commit
b4baf40ca1
|
@ -34,7 +34,9 @@ SOURCES = \
|
||||||
qtmaterialmenuitem_internal.cpp \
|
qtmaterialmenuitem_internal.cpp \
|
||||||
qtmaterialmenuitem.cpp \
|
qtmaterialmenuitem.cpp \
|
||||||
qtmaterialcollapsiblemenu_internal.cpp \
|
qtmaterialcollapsiblemenu_internal.cpp \
|
||||||
qtmaterialcollapsiblemenu.cpp
|
qtmaterialcollapsiblemenu.cpp \
|
||||||
|
qtmaterialscrollbar_internal.cpp \
|
||||||
|
qtmaterialscrollbar.cpp
|
||||||
HEADERS = \
|
HEADERS = \
|
||||||
qtmaterialavatar_p.h \
|
qtmaterialavatar_p.h \
|
||||||
qtmaterialavatar.h \
|
qtmaterialavatar.h \
|
||||||
|
@ -90,6 +92,9 @@ HEADERS = \
|
||||||
qtmaterialmenuitem.h \
|
qtmaterialmenuitem.h \
|
||||||
qtmaterialcollapsiblemenu_internal.h \
|
qtmaterialcollapsiblemenu_internal.h \
|
||||||
qtmaterialcollapsiblemenu_p.h \
|
qtmaterialcollapsiblemenu_p.h \
|
||||||
qtmaterialcollapsiblemenu.h
|
qtmaterialcollapsiblemenu.h \
|
||||||
|
qtmaterialscrollbar_internal.h \
|
||||||
|
qtmaterialscrollbar_p.h \
|
||||||
|
qtmaterialscrollbar.h
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
resources.qrc
|
resources.qrc
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#include "xx/qtmaterialcollapsiblemenu.h"
|
#include "qtmaterialcollapsiblemenu.h"
|
||||||
#include "xx/qtmaterialcollapsiblemenu_p.h"
|
#include "qtmaterialcollapsiblemenu_p.h"
|
||||||
#include <QScrollArea>
|
#include <QtWidgets/QScrollArea>
|
||||||
#include <QStackedLayout>
|
#include <QtWidgets/QStackedLayout>
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
#include "xx/qtmaterialcollapsiblemenu_internal.h"
|
#include "qtmaterialcollapsiblemenu_internal.h"
|
||||||
#include "xx/qtmaterialmenuitem.h"
|
#include "qtmaterialmenuitem.h"
|
||||||
#include "xx/qtmaterialscrollbar.h"
|
#include "qtmaterialscrollbar.h"
|
||||||
#include "xxlib/qtmaterialstyle.h"
|
#include "lib/qtmaterialstyle.h"
|
||||||
#include "xxlib/qtmaterialstatetransitionevent.h"
|
#include "lib/qtmaterialstatetransitionevent.h"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \class QtMaterialCollapsibleMenuPrivate
|
* \class QtMaterialCollapsibleMenuPrivate
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef QTMATERIALCOLLAPSIBLEMENU_H
|
#ifndef QTMATERIALCOLLAPSIBLEMENU_H
|
||||||
#define QTMATERIALCOLLAPSIBLEMENU_H
|
#define QTMATERIALCOLLAPSIBLEMENU_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QtWidgets/QWidget>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
|
|
||||||
class QtMaterialCollapsibleMenuPrivate;
|
class QtMaterialCollapsibleMenuPrivate;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "xx/qtmaterialcollapsiblemenu_internal.h"
|
#include "qtmaterialcollapsiblemenu_internal.h"
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "xx/qtmaterialcollapsiblemenu.h"
|
#include "qtmaterialcollapsiblemenu.h"
|
||||||
#include "xxlib/qtmaterialstatetransition.h"
|
#include "lib/qtmaterialstatetransition.h"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \class QtMaterialCollapsibleMenuStateMachine
|
* \class QtMaterialCollapsibleMenuStateMachine
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
#define QTMATERIALCOLLAPSIBLEMENU_INTERNAL_H
|
#define QTMATERIALCOLLAPSIBLEMENU_INTERNAL_H
|
||||||
|
|
||||||
#include <QStateMachine>
|
#include <QStateMachine>
|
||||||
#include <QWidget>
|
#include <QtWidgets/QWidget>
|
||||||
#include <QGraphicsDropShadowEffect>
|
#include <QtWidgets/QGraphicsDropShadowEffect>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
class QState;
|
class QState;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include "xx/qtmaterialmenuitem.h"
|
#include "qtmaterialmenuitem.h"
|
||||||
#include "xx/qtmaterialmenuitem_p.h"
|
#include "qtmaterialmenuitem_p.h"
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "xx/qtmaterialmenuitem_internal.h"
|
#include "qtmaterialmenuitem_internal.h"
|
||||||
#include "xxlib/qtmaterialstyle.h"
|
#include "lib/qtmaterialstyle.h"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \class QtMaterialMenuItemPrivate
|
* \class QtMaterialMenuItemPrivate
|
||||||
|
@ -39,7 +39,7 @@ void QtMaterialMenuItemPrivate::init()
|
||||||
font.setStyleName("Regular");
|
font.setStyleName("Regular");
|
||||||
q->setFont(font);
|
q->setFont(font);
|
||||||
|
|
||||||
q->setOverlayStyle(XXMaterial::GrayOverlay);
|
q->setOverlayStyle(Material::GrayOverlay);
|
||||||
q->setForegroundColor(QtMaterialStyle::instance().themeColor("text"));
|
q->setForegroundColor(QtMaterialStyle::instance().themeColor("text"));
|
||||||
q->setCornerRadius(0);
|
q->setCornerRadius(0);
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ void QtMaterialMenuItem::paintForeground(QPainter *painter)
|
||||||
QRect textGeometry(QPoint(14, base.height()/2), textSize);
|
QRect textGeometry(QPoint(14, base.height()/2), textSize);
|
||||||
QRect iconGeometry(QPoint(14, (height()-iconSize().height())/2), iconSize());
|
QRect iconGeometry(QPoint(14, (height()-iconSize().height())/2), iconSize());
|
||||||
|
|
||||||
if (XXMaterial::LeftIcon == iconPlacement()) {
|
if (Material::LeftIcon == iconPlacement()) {
|
||||||
textGeometry.translate(iw, 0);
|
textGeometry.translate(iw, 0);
|
||||||
} else {
|
} else {
|
||||||
iconGeometry.translate(textSize.width() + IconPadding, 0);
|
iconGeometry.translate(textSize.width() + IconPadding, 0);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef QTMATERIALMENUITEM_H
|
#ifndef QTMATERIALMENUITEM_H
|
||||||
#define QTMATERIALMENUITEM_H
|
#define QTMATERIALMENUITEM_H
|
||||||
|
|
||||||
#include "xx/qtmaterialflatbutton.h"
|
#include "qtmaterialflatbutton.h"
|
||||||
|
|
||||||
class QtMaterialMenuItemPrivate;
|
class QtMaterialMenuItemPrivate;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "xx/qtmaterialmenuitem_internal.h"
|
#include "qtmaterialmenuitem_internal.h"
|
||||||
#include <QSignalTransition>
|
#include <QSignalTransition>
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <QStateMachine>
|
#include <QStateMachine>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include "xx/qtmaterialmenuitem.h"
|
#include "qtmaterialmenuitem.h"
|
||||||
|
|
||||||
class QtMaterialMenuItem;
|
class QtMaterialMenuItem;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef QTMATERIALMENUITEM_P_H
|
#ifndef QTMATERIALMENUITEM_P_H
|
||||||
#define QTMATERIALMENUITEM_P_H
|
#define QTMATERIALMENUITEM_P_H
|
||||||
|
|
||||||
#include "xx/qtmaterialflatbutton_p.h"
|
#include "qtmaterialflatbutton_p.h"
|
||||||
|
|
||||||
class QtMaterialMenuItem;
|
class QtMaterialMenuItem;
|
||||||
class QtMaterialMenuItemStateMachine;
|
class QtMaterialMenuItemStateMachine;
|
||||||
|
|
|
@ -0,0 +1,195 @@
|
||||||
|
#include "qtmaterialscrollbar.h"
|
||||||
|
#include "qtmaterialscrollbar_p.h"
|
||||||
|
#include <QPainter>
|
||||||
|
#include "qtmaterialscrollbar_internal.h"
|
||||||
|
#include "lib/qtmaterialstyle.h"
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \class QtMaterialScrollBarPrivate
|
||||||
|
* \internal
|
||||||
|
*/
|
||||||
|
|
||||||
|
QtMaterialScrollBarPrivate::QtMaterialScrollBarPrivate(QtMaterialScrollBar *q)
|
||||||
|
: q_ptr(q)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QtMaterialScrollBarPrivate::~QtMaterialScrollBarPrivate()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialScrollBarPrivate::init()
|
||||||
|
{
|
||||||
|
Q_Q(QtMaterialScrollBar);
|
||||||
|
|
||||||
|
stateMachine = new QtMaterialScrollBarStateMachine(q);
|
||||||
|
hideOnMouseOut = true;
|
||||||
|
useThemeColors = true;
|
||||||
|
|
||||||
|
q->setMouseTracking(true);
|
||||||
|
q->setStyle(&QtMaterialStyle::instance());
|
||||||
|
q->setStyleSheet("QScrollBar:vertical { margin: 0; }"
|
||||||
|
"QScrollBar::add-line:vertical { height: 0; margin: 0; }"
|
||||||
|
"QScrollBar::sub-line:vertical { height: 0; margin: 0; }");
|
||||||
|
|
||||||
|
stateMachine->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \class QtMaterialScrollBar
|
||||||
|
*/
|
||||||
|
|
||||||
|
QtMaterialScrollBar::QtMaterialScrollBar(QWidget *parent)
|
||||||
|
: QScrollBar(parent),
|
||||||
|
d_ptr(new QtMaterialScrollBarPrivate(this))
|
||||||
|
{
|
||||||
|
d_func()->init();
|
||||||
|
}
|
||||||
|
|
||||||
|
QtMaterialScrollBar::~QtMaterialScrollBar()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \reimp
|
||||||
|
*/
|
||||||
|
QSize QtMaterialScrollBar::sizeHint() const
|
||||||
|
{
|
||||||
|
if (Qt::Horizontal == orientation()) {
|
||||||
|
return QSize(1, 10);
|
||||||
|
} else {
|
||||||
|
return QSize(10, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialScrollBar::setUseThemeColors(bool value)
|
||||||
|
{
|
||||||
|
Q_D(QtMaterialScrollBar);
|
||||||
|
|
||||||
|
if (d->useThemeColors == value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
d->useThemeColors = value;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QtMaterialScrollBar::useThemeColors() const
|
||||||
|
{
|
||||||
|
Q_D(const QtMaterialScrollBar);
|
||||||
|
|
||||||
|
return d->useThemeColors;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialScrollBar::setCanvasColor(const QColor &color)
|
||||||
|
{
|
||||||
|
Q_D(QtMaterialScrollBar);
|
||||||
|
|
||||||
|
d->canvasColor = color;
|
||||||
|
setUseThemeColors(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor QtMaterialScrollBar::canvasColor() const
|
||||||
|
{
|
||||||
|
Q_D(const QtMaterialScrollBar);
|
||||||
|
|
||||||
|
if (d->useThemeColors || !d->canvasColor.isValid()) {
|
||||||
|
return parentWidget()->palette().color(backgroundRole());
|
||||||
|
} else {
|
||||||
|
return d->canvasColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialScrollBar::setBackgroundColor(const QColor &color)
|
||||||
|
{
|
||||||
|
Q_D(QtMaterialScrollBar);
|
||||||
|
|
||||||
|
d->backgroundColor = color;
|
||||||
|
setUseThemeColors(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor QtMaterialScrollBar::backgroundColor() const
|
||||||
|
{
|
||||||
|
Q_D(const QtMaterialScrollBar);
|
||||||
|
|
||||||
|
if (d->useThemeColors || !d->backgroundColor.isValid()) {
|
||||||
|
return QtMaterialStyle::instance().themeColor("border");
|
||||||
|
} else {
|
||||||
|
return d->backgroundColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialScrollBar::setSliderColor(const QColor &color)
|
||||||
|
{
|
||||||
|
Q_D(QtMaterialScrollBar);
|
||||||
|
|
||||||
|
d->sliderColor = color;
|
||||||
|
setUseThemeColors(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor QtMaterialScrollBar::sliderColor() const
|
||||||
|
{
|
||||||
|
Q_D(const QtMaterialScrollBar);
|
||||||
|
|
||||||
|
if (d->useThemeColors || !d->sliderColor.isValid()) {
|
||||||
|
return QtMaterialStyle::instance().themeColor("primary1");
|
||||||
|
} else {
|
||||||
|
return d->sliderColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialScrollBar::setHideOnMouseOut(bool value)
|
||||||
|
{
|
||||||
|
Q_D(QtMaterialScrollBar);
|
||||||
|
|
||||||
|
d->hideOnMouseOut = value;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QtMaterialScrollBar::hideOnMouseOut() const
|
||||||
|
{
|
||||||
|
Q_D(const QtMaterialScrollBar);
|
||||||
|
|
||||||
|
return d->hideOnMouseOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \reimp
|
||||||
|
*/
|
||||||
|
void QtMaterialScrollBar::paintEvent(QPaintEvent *event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(event)
|
||||||
|
|
||||||
|
Q_D(QtMaterialScrollBar);
|
||||||
|
|
||||||
|
QPainter painter(this);
|
||||||
|
painter.fillRect(rect(), canvasColor());
|
||||||
|
|
||||||
|
int x, y, w, h;
|
||||||
|
rect().getRect(&x, &y, &w, &h);
|
||||||
|
|
||||||
|
QMargins margins(2, 2, 2, 2);
|
||||||
|
|
||||||
|
QBrush brush;
|
||||||
|
brush.setStyle(Qt::SolidPattern);
|
||||||
|
brush.setColor(backgroundColor());
|
||||||
|
painter.setBrush(brush);
|
||||||
|
painter.setPen(Qt::NoPen);
|
||||||
|
|
||||||
|
if (d->hideOnMouseOut) {
|
||||||
|
painter.setOpacity(d->stateMachine->opacity());
|
||||||
|
}
|
||||||
|
|
||||||
|
painter.drawRect(rect().marginsRemoved(margins));
|
||||||
|
|
||||||
|
const qreal q = h / static_cast<qreal>(maximum()-minimum()+pageStep()-1);
|
||||||
|
|
||||||
|
QRect handle = Qt::Horizontal == orientation()
|
||||||
|
? QRect(sliderPosition()*q, y, pageStep()*q, h)
|
||||||
|
: QRect(x, sliderPosition()*q, w, pageStep()*q);
|
||||||
|
|
||||||
|
brush.setColor(sliderColor());
|
||||||
|
painter.setBrush(brush);
|
||||||
|
|
||||||
|
painter.drawRect(handle.marginsRemoved(margins));
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
#ifndef QTMATERIALSCROLLBAR_H
|
||||||
|
#define QTMATERIALSCROLLBAR_H
|
||||||
|
|
||||||
|
#include <QtWidgets/QScrollBar>
|
||||||
|
|
||||||
|
class QtMaterialScrollBarPrivate;
|
||||||
|
|
||||||
|
class QtMaterialScrollBar : public QScrollBar
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
Q_PROPERTY(QColor canvasColor WRITE setCanvasColor READ canvasColor)
|
||||||
|
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
|
||||||
|
Q_PROPERTY(QColor sliderColor WRITE setSliderColor READ sliderColor)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit QtMaterialScrollBar(QWidget *parent = 0);
|
||||||
|
~QtMaterialScrollBar();
|
||||||
|
|
||||||
|
QSize sizeHint() const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
void setUseThemeColors(bool value);
|
||||||
|
bool useThemeColors() const;
|
||||||
|
|
||||||
|
void setCanvasColor(const QColor &color);
|
||||||
|
QColor canvasColor() const;
|
||||||
|
|
||||||
|
void setBackgroundColor(const QColor &color);
|
||||||
|
QColor backgroundColor() const;
|
||||||
|
|
||||||
|
void setSliderColor(const QColor &color);
|
||||||
|
QColor sliderColor() const;
|
||||||
|
|
||||||
|
void setHideOnMouseOut(bool value);
|
||||||
|
bool hideOnMouseOut() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
const QScopedPointer<QtMaterialScrollBarPrivate> d_ptr;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY(QtMaterialScrollBar)
|
||||||
|
Q_DECLARE_PRIVATE(QtMaterialScrollBar)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QTMATERIALSCROLLBAR_H
|
|
@ -0,0 +1,51 @@
|
||||||
|
#include "qtmaterialscrollbar_internal.h"
|
||||||
|
#include <QPropertyAnimation>
|
||||||
|
#include <QEventTransition>
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \class QtMaterialScrollBarStateMachine
|
||||||
|
* \internal
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \internal
|
||||||
|
*/
|
||||||
|
QtMaterialScrollBarStateMachine::QtMaterialScrollBarStateMachine(QtMaterialScrollBar *parent)
|
||||||
|
: QStateMachine(parent),
|
||||||
|
m_scrollBar(parent),
|
||||||
|
m_focusState(new QState),
|
||||||
|
m_blurState(new QState),
|
||||||
|
m_opacity(0)
|
||||||
|
{
|
||||||
|
Q_ASSERT(parent);
|
||||||
|
|
||||||
|
addState(m_focusState);
|
||||||
|
addState(m_blurState);
|
||||||
|
setInitialState(m_blurState);
|
||||||
|
|
||||||
|
QEventTransition *transition;
|
||||||
|
|
||||||
|
transition = new QEventTransition(parent, QEvent::HoverEnter);
|
||||||
|
transition->setTargetState(m_focusState);
|
||||||
|
m_blurState->addTransition(transition);
|
||||||
|
|
||||||
|
transition = new QEventTransition(parent, QEvent::HoverLeave);
|
||||||
|
transition->setTargetState(m_blurState);
|
||||||
|
m_focusState->addTransition(transition);
|
||||||
|
|
||||||
|
m_focusState->assignProperty(this, "opacity", 1);
|
||||||
|
m_blurState->assignProperty(this, "opacity", 0);
|
||||||
|
|
||||||
|
QPropertyAnimation *animation;
|
||||||
|
|
||||||
|
animation = new QPropertyAnimation(this, "opacity", this);
|
||||||
|
animation->setDuration(340);
|
||||||
|
addDefaultAnimation(animation);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \internal
|
||||||
|
*/
|
||||||
|
QtMaterialScrollBarStateMachine::~QtMaterialScrollBarStateMachine()
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
#ifndef QTMATERIALSCROLLBAR_INTERNAL_H
|
||||||
|
#define QTMATERIALSCROLLBAR_INTERNAL_H
|
||||||
|
|
||||||
|
#include <QStateMachine>
|
||||||
|
#include "qtmaterialscrollbar.h"
|
||||||
|
|
||||||
|
class QtMaterialScrollBarStateMachine : public QStateMachine
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity)
|
||||||
|
|
||||||
|
public:
|
||||||
|
QtMaterialScrollBarStateMachine(QtMaterialScrollBar *parent);
|
||||||
|
~QtMaterialScrollBarStateMachine();
|
||||||
|
|
||||||
|
inline void setOpacity(qreal opacity);
|
||||||
|
inline qreal opacity() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY(QtMaterialScrollBarStateMachine)
|
||||||
|
|
||||||
|
QtMaterialScrollBar *const m_scrollBar;
|
||||||
|
QState *m_focusState;
|
||||||
|
QState *m_blurState;
|
||||||
|
qreal m_opacity;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline void QtMaterialScrollBarStateMachine::setOpacity(qreal opacity)
|
||||||
|
{
|
||||||
|
m_opacity = opacity;
|
||||||
|
m_scrollBar->update();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline qreal QtMaterialScrollBarStateMachine::opacity() const
|
||||||
|
{
|
||||||
|
return m_opacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // QTMATERIALSCROLLBAR_INTERNAL_H
|
|
@ -0,0 +1,30 @@
|
||||||
|
#ifndef QTMATERIALSCROLLBAR_P_H
|
||||||
|
#define QTMATERIALSCROLLBAR_P_H
|
||||||
|
|
||||||
|
#include <QtGlobal>
|
||||||
|
#include <QColor>
|
||||||
|
|
||||||
|
class QtMaterialScrollBar;
|
||||||
|
class QtMaterialScrollBarStateMachine;
|
||||||
|
|
||||||
|
class QtMaterialScrollBarPrivate
|
||||||
|
{
|
||||||
|
Q_DISABLE_COPY(QtMaterialScrollBarPrivate)
|
||||||
|
Q_DECLARE_PUBLIC(QtMaterialScrollBar)
|
||||||
|
|
||||||
|
public:
|
||||||
|
QtMaterialScrollBarPrivate(QtMaterialScrollBar *q);
|
||||||
|
~QtMaterialScrollBarPrivate();
|
||||||
|
|
||||||
|
void init();
|
||||||
|
|
||||||
|
QtMaterialScrollBar *const q_ptr;
|
||||||
|
QtMaterialScrollBarStateMachine *stateMachine;
|
||||||
|
QColor backgroundColor;
|
||||||
|
QColor sliderColor;
|
||||||
|
QColor canvasColor;
|
||||||
|
bool hideOnMouseOut;
|
||||||
|
bool useThemeColors;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QTMATERIALSCROLLBAR_P_H
|
|
@ -1,9 +1,9 @@
|
||||||
#include "yy/selectfieldsettingseditor.h"
|
#include "selectfieldsettingseditor.h"
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
#include "xx/qtmaterialselectfield.h"
|
#include "qtmaterialselectfield.h"
|
||||||
#include "xx/qtmaterialmenuitem.h"
|
#include "qtmaterialmenuitem.h"
|
||||||
|
|
||||||
SelectFieldSettingsEditor::SelectFieldSettingsEditor(QWidget *parent)
|
SelectFieldSettingsEditor::SelectFieldSettingsEditor(QWidget *parent)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
|
|
Loading…
Reference in New Issue