Merge d649335490 into 3a0e226597
This commit is contained in:
commit
c8470ab9f3
|
|
@ -315,3 +315,11 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU
|
|||
- [ ] Stepper
|
||||
- [ ] Subheaders
|
||||
- [ ] Toolbar
|
||||
|
||||
|
||||
#### Implement Qt Desinger plugin
|
||||
- Tested on Windows 10, Ubuntu
|
||||
- Note: Must build with release mode in Windows
|
||||
- Copy lib to Qt Design plugin folder. Example:
|
||||
+ Ubuntu: /opt/Qt5.12.8/Tools/QtCreator/lib/Qt/plugins/designer/
|
||||
+ Windows 10: C:\Qt\Qt5.12.8\Tools\QtCreator\bin\plugins\designer
|
||||
|
|
|
|||
|
|
@ -1,130 +1,28 @@
|
|||
TEMPLATE = lib
|
||||
CONFIG += staticlib
|
||||
SOURCES = \
|
||||
qtmaterialavatar.cpp \
|
||||
lib/qtmaterialstyle.cpp \
|
||||
lib/qtmaterialtheme.cpp \
|
||||
qtmaterialbadge.cpp \
|
||||
lib/qtmaterialoverlaywidget.cpp \
|
||||
qtmaterialcheckbox.cpp \
|
||||
lib/qtmaterialcheckable_internal.cpp \
|
||||
lib/qtmaterialcheckable.cpp \
|
||||
lib/qtmaterialripple.cpp \
|
||||
lib/qtmaterialrippleoverlay.cpp \
|
||||
qtmaterialfab.cpp \
|
||||
qtmaterialraisedbutton.cpp \
|
||||
qtmaterialflatbutton_internal.cpp \
|
||||
qtmaterialflatbutton.cpp \
|
||||
lib/qtmaterialstatetransition.cpp \
|
||||
qtmaterialiconbutton.cpp \
|
||||
qtmaterialprogress_internal.cpp \
|
||||
qtmaterialprogress.cpp \
|
||||
qtmaterialcircularprogress_internal.cpp \
|
||||
qtmaterialcircularprogress.cpp \
|
||||
qtmaterialslider_internal.cpp \
|
||||
qtmaterialslider.cpp \
|
||||
qtmaterialsnackbar_internal.cpp \
|
||||
qtmaterialsnackbar.cpp \
|
||||
qtmaterialradiobutton.cpp \
|
||||
qtmaterialtoggle_internal.cpp \
|
||||
qtmaterialtoggle.cpp \
|
||||
qtmaterialtextfield_internal.cpp \
|
||||
qtmaterialtextfield.cpp \
|
||||
qtmaterialtabs_internal.cpp \
|
||||
qtmaterialtabs.cpp \
|
||||
qtmaterialscrollbar_internal.cpp \
|
||||
qtmaterialscrollbar.cpp \
|
||||
qtmaterialdialog_internal.cpp \
|
||||
qtmaterialdialog.cpp \
|
||||
qtmaterialdrawer_internal.cpp \
|
||||
qtmaterialdrawer.cpp \
|
||||
qtmaterialappbar.cpp \
|
||||
qtmaterialautocomplete.cpp \
|
||||
qtmaterialpaper.cpp \
|
||||
qtmaterialtable.cpp \
|
||||
layouts/qtmaterialsnackbarlayout.cpp \
|
||||
qtmaterialautocomplete_internal.cpp \
|
||||
qtmaterialmenu.cpp \
|
||||
qtmaterialmenu_internal.cpp \
|
||||
qtmateriallist.cpp \
|
||||
qtmateriallistitem.cpp
|
||||
HEADERS = \
|
||||
qtmaterialavatar_p.h \
|
||||
qtmaterialavatar.h \
|
||||
lib/qtmaterialstyle_p.h \
|
||||
lib/qtmaterialstyle.h \
|
||||
lib/qtmaterialtheme_p.h \
|
||||
lib/qtmaterialtheme.h \
|
||||
qtmaterialbadge_p.h \
|
||||
qtmaterialbadge.h \
|
||||
lib/qtmaterialoverlaywidget.h \
|
||||
qtmaterialcheckbox_p.h \
|
||||
qtmaterialcheckbox.h \
|
||||
lib/qtmaterialcheckable_internal.h \
|
||||
lib/qtmaterialcheckable_p.h \
|
||||
lib/qtmaterialripple.h \
|
||||
lib/qtmaterialrippleoverlay.h \
|
||||
lib/qtmaterialcheckable.h \
|
||||
qtmaterialfab_p.h \
|
||||
qtmaterialfab.h \
|
||||
qtmaterialraisedbutton_p.h \
|
||||
qtmaterialraisedbutton.h \
|
||||
qtmaterialflatbutton_internal.h \
|
||||
qtmaterialflatbutton_p.h \
|
||||
qtmaterialflatbutton.h \
|
||||
lib/qtmaterialstatetransition.h \
|
||||
lib/qtmaterialstatetransitionevent.h \
|
||||
qtmaterialiconbutton_p.h \
|
||||
qtmaterialiconbutton.h \
|
||||
qtmaterialprogress_internal.h \
|
||||
qtmaterialprogress_p.h \
|
||||
qtmaterialprogress.h \
|
||||
qtmaterialcircularprogress_internal.h \
|
||||
qtmaterialcircularprogress_p.h \
|
||||
qtmaterialcircularprogress.h \
|
||||
qtmaterialslider_internal.h \
|
||||
qtmaterialslider_p.h \
|
||||
qtmaterialslider.h \
|
||||
qtmaterialsnackbar_internal.h \
|
||||
qtmaterialsnackbar_p.h \
|
||||
qtmaterialsnackbar.h \
|
||||
qtmaterialradiobutton_p.h \
|
||||
qtmaterialradiobutton.h \
|
||||
qtmaterialtoggle_internal.h \
|
||||
qtmaterialtoggle_p.h \
|
||||
qtmaterialtoggle.h \
|
||||
qtmaterialtextfield_internal.h \
|
||||
qtmaterialtextfield_p.h \
|
||||
qtmaterialtextfield.h \
|
||||
qtmaterialtabs_internal.h \
|
||||
qtmaterialtabs_p.h \
|
||||
qtmaterialtabs.h \
|
||||
qtmaterialscrollbar_internal.h \
|
||||
qtmaterialscrollbar_p.h \
|
||||
qtmaterialscrollbar.h \
|
||||
qtmaterialdialog_internal.h \
|
||||
qtmaterialdialog_p.h \
|
||||
qtmaterialdialog.h \
|
||||
qtmaterialdrawer_internal.h \
|
||||
qtmaterialdrawer_p.h \
|
||||
qtmaterialdrawer.h \
|
||||
qtmaterialappbar.h \
|
||||
qtmaterialappbar_p.h \
|
||||
qtmaterialautocomplete.h \
|
||||
qtmaterialautocomplete_p.h \
|
||||
qtmaterialpaper.h \
|
||||
qtmaterialpaper_p.h \
|
||||
qtmaterialtable.h \
|
||||
qtmaterialtable_p.h \
|
||||
layouts/qtmaterialsnackbarlayout.h \
|
||||
layouts/qtmaterialsnackbarlayout_p.h \
|
||||
qtmaterialautocomplete_internal.h \
|
||||
qtmaterialmenu.h \
|
||||
qtmaterialmenu_p.h \
|
||||
qtmaterialmenu_internal.h \
|
||||
qtmateriallist.h \
|
||||
qtmateriallist_p.h \
|
||||
qtmateriallistitem.h \
|
||||
qtmateriallistitem_p.h
|
||||
RESOURCES += \
|
||||
resources.qrc
|
||||
QT += widgets uiplugin designer
|
||||
CONFIG += plugin #release
|
||||
TEMPLATE = lib
|
||||
|
||||
include(link_components.pri)
|
||||
|
||||
SOURCES += \
|
||||
plugin/qtmaterialplugins.cpp \
|
||||
plugin/qtmaterialtabwidgetcontainerextension.cpp \
|
||||
plugin/qtmaterialtabwidgetextensionfactory.cpp \
|
||||
plugin/qtmaterialtabwidgetplugin.cpp
|
||||
HEADERS += \
|
||||
plugin/plugintemplate.h \
|
||||
plugin/qtmaterialplugins.h \
|
||||
plugin/qtmaterialtabwidgetcontainerextension.h \
|
||||
plugin/qtmaterialtabwidgetextensionfactory.h \
|
||||
plugin/qtmaterialtabwidgetplugin.h
|
||||
|
||||
TARGET = $$qtLibraryTarget(qt-material-widget)
|
||||
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
||||
INSTALLS += target
|
||||
|
||||
OBJECTS_DIR = $$PWD/../../qt-material-widgets-build/components/build/obj
|
||||
MOC_DIR = $$PWD/../../qt-material-widgets-build/components/build/moc
|
||||
RCC_DIR = $$PWD/../../qt-material-widgets-build/components/build/qrc
|
||||
UI_DIR = $$PWD/../../qt-material-widgets-build/components/build/ui
|
||||
DESTDIR = $$PWD/../../qt-material-widgets-build/components/lib
|
||||
|
||||
|
|
|
|||
|
|
@ -2,18 +2,28 @@
|
|||
#define QTMATERIALCHECKABLE_H
|
||||
|
||||
#include <QtWidgets/QAbstractButton>
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialCheckablePrivate;
|
||||
|
||||
class QtMaterialCheckable : public QAbstractButton
|
||||
class QT_MATERIAL_EXPORT QtMaterialCheckable : public QAbstractButton
|
||||
{
|
||||
Q_OBJECT
|
||||
// Q_PROPERTY(LabelPosition labelPosition READ setLabelPosition WRITE labelPosition)
|
||||
// Q_PROPERTY(bool useThemeColors READ setUseThemeColors WRITE useThemeColors)
|
||||
// Q_PROPERTY(QColor checkedColor READ setCheckedColor WRITE checkedColor)
|
||||
// Q_PROPERTY(QColor uncheckedColor READ setUncheckedColor WRITE uncheckedColor)
|
||||
// Q_PROPERTY(QColor textColor READ setTextColor WRITE textColor)
|
||||
// Q_PROPERTY(QColor disabledColor READ setDisabledColor WRITE disabledColor)
|
||||
// Q_PROPERTY(QIcon checkedIcon READ setCheckedIcon WRITE checkedIcon)
|
||||
// Q_PROPERTY(QIcon uncheckedIcon READ setUncheckedIcon WRITE uncheckedIcon)
|
||||
|
||||
public:
|
||||
enum LabelPosition {
|
||||
LabelPositionLeft,
|
||||
LabelPositionRight,
|
||||
};
|
||||
Q_ENUM(LabelPosition)
|
||||
|
||||
explicit QtMaterialCheckable(QWidget *parent = 0);
|
||||
~QtMaterialCheckable();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,329 @@
|
|||
#ifndef QTMATERIALCONST_H
|
||||
#define QTMATERIALCONST_H
|
||||
|
||||
#include <QObject>
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QT_MATERIAL_EXPORT MaterialConst: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
enum ButtonPreset {
|
||||
FlatPreset,
|
||||
CheckablePreset
|
||||
};
|
||||
Q_ENUM(ButtonPreset)
|
||||
|
||||
enum RippleStyle {
|
||||
CenteredRipple,
|
||||
PositionedRipple,
|
||||
NoRipple
|
||||
};
|
||||
Q_ENUM(RippleStyle)
|
||||
|
||||
enum OverlayStyle {
|
||||
NoOverlay = 0,
|
||||
TintedOverlay,
|
||||
GrayOverlay
|
||||
};
|
||||
Q_ENUM(OverlayStyle)
|
||||
|
||||
enum Role {
|
||||
Default,
|
||||
Primary,
|
||||
Secondary
|
||||
};
|
||||
Q_ENUM(Role)
|
||||
|
||||
enum ButtonIconPlacement {
|
||||
LeftIcon,
|
||||
RightIcon
|
||||
};
|
||||
Q_ENUM(ButtonIconPlacement)
|
||||
|
||||
enum ProgressType {
|
||||
DeterminateProgress,
|
||||
IndeterminateProgress
|
||||
};
|
||||
Q_ENUM(ProgressType)
|
||||
|
||||
enum AvatarType {
|
||||
ImageAvatar,
|
||||
IconAvatar,
|
||||
LetterAvatar
|
||||
};
|
||||
Q_ENUM(AvatarType)
|
||||
|
||||
enum Color {
|
||||
red50,
|
||||
red100,
|
||||
red200,
|
||||
red300,
|
||||
red400,
|
||||
red500,
|
||||
red600,
|
||||
red700,
|
||||
red800,
|
||||
red900,
|
||||
redA100,
|
||||
redA200,
|
||||
redA400,
|
||||
redA700,
|
||||
pink50,
|
||||
pink100,
|
||||
pink200,
|
||||
pink300,
|
||||
pink400,
|
||||
pink500,
|
||||
pink600,
|
||||
pink700,
|
||||
pink800,
|
||||
pink900,
|
||||
pinkA100,
|
||||
pinkA200,
|
||||
pinkA400,
|
||||
pinkA700,
|
||||
purple50,
|
||||
purple100,
|
||||
purple200,
|
||||
purple300,
|
||||
purple400,
|
||||
purple500,
|
||||
purple600,
|
||||
purple700,
|
||||
purple800,
|
||||
purple900,
|
||||
purpleA100,
|
||||
purpleA200,
|
||||
purpleA400,
|
||||
purpleA700,
|
||||
deepPurple50,
|
||||
deepPurple100,
|
||||
deepPurple200,
|
||||
deepPurple300,
|
||||
deepPurple400,
|
||||
deepPurple500,
|
||||
deepPurple600,
|
||||
deepPurple700,
|
||||
deepPurple800,
|
||||
deepPurple900,
|
||||
deepPurpleA100,
|
||||
deepPurpleA200,
|
||||
deepPurpleA400,
|
||||
deepPurpleA700,
|
||||
indigo50,
|
||||
indigo100,
|
||||
indigo200,
|
||||
indigo300,
|
||||
indigo400,
|
||||
indigo500,
|
||||
indigo600,
|
||||
indigo700,
|
||||
indigo800,
|
||||
indigo900,
|
||||
indigoA100,
|
||||
indigoA200,
|
||||
indigoA400,
|
||||
indigoA700,
|
||||
blue50,
|
||||
blue100,
|
||||
blue200,
|
||||
blue300,
|
||||
blue400,
|
||||
blue500,
|
||||
blue600,
|
||||
blue700,
|
||||
blue800,
|
||||
blue900,
|
||||
blueA100,
|
||||
blueA200,
|
||||
blueA400,
|
||||
blueA700,
|
||||
lightBlue50,
|
||||
lightBlue100,
|
||||
lightBlue200,
|
||||
lightBlue300,
|
||||
lightBlue400,
|
||||
lightBlue500,
|
||||
lightBlue600,
|
||||
lightBlue700,
|
||||
lightBlue800,
|
||||
lightBlue900,
|
||||
lightBlueA100,
|
||||
lightBlueA200,
|
||||
lightBlueA400,
|
||||
lightBlueA700,
|
||||
cyan50,
|
||||
cyan100,
|
||||
cyan200,
|
||||
cyan300,
|
||||
cyan400,
|
||||
cyan500,
|
||||
cyan600,
|
||||
cyan700,
|
||||
cyan800,
|
||||
cyan900,
|
||||
cyanA100,
|
||||
cyanA200,
|
||||
cyanA400,
|
||||
cyanA700,
|
||||
teal50,
|
||||
teal100,
|
||||
teal200,
|
||||
teal300,
|
||||
teal400,
|
||||
teal500,
|
||||
teal600,
|
||||
teal700,
|
||||
teal800,
|
||||
teal900,
|
||||
tealA100,
|
||||
tealA200,
|
||||
tealA400,
|
||||
tealA700,
|
||||
green50,
|
||||
green100,
|
||||
green200,
|
||||
green300,
|
||||
green400,
|
||||
green500,
|
||||
green600,
|
||||
green700,
|
||||
green800,
|
||||
green900,
|
||||
greenA100,
|
||||
greenA200,
|
||||
greenA400,
|
||||
greenA700,
|
||||
lightGreen50,
|
||||
lightGreen100,
|
||||
lightGreen200,
|
||||
lightGreen300,
|
||||
lightGreen400,
|
||||
lightGreen500,
|
||||
lightGreen600,
|
||||
lightGreen700,
|
||||
lightGreen800,
|
||||
lightGreen900,
|
||||
lightGreenA100,
|
||||
lightGreenA200,
|
||||
lightGreenA400,
|
||||
lightGreenA700,
|
||||
lime50,
|
||||
lime100,
|
||||
lime200,
|
||||
lime300,
|
||||
lime400,
|
||||
lime500,
|
||||
lime600,
|
||||
lime700,
|
||||
lime800,
|
||||
lime900,
|
||||
limeA100,
|
||||
limeA200,
|
||||
limeA400,
|
||||
limeA700,
|
||||
yellow50,
|
||||
yellow100,
|
||||
yellow200,
|
||||
yellow300,
|
||||
yellow400,
|
||||
yellow500,
|
||||
yellow600,
|
||||
yellow700,
|
||||
yellow800,
|
||||
yellow900,
|
||||
yellowA100,
|
||||
yellowA200,
|
||||
yellowA400,
|
||||
yellowA700,
|
||||
amber50,
|
||||
amber100,
|
||||
amber200,
|
||||
amber300,
|
||||
amber400,
|
||||
amber500,
|
||||
amber600,
|
||||
amber700,
|
||||
amber800,
|
||||
amber900,
|
||||
amberA100,
|
||||
amberA200,
|
||||
amberA400,
|
||||
amberA700,
|
||||
orange50,
|
||||
orange100,
|
||||
orange200,
|
||||
orange300,
|
||||
orange400,
|
||||
orange500,
|
||||
orange600,
|
||||
orange700,
|
||||
orange800,
|
||||
orange900,
|
||||
orangeA100,
|
||||
orangeA200,
|
||||
orangeA400,
|
||||
orangeA700,
|
||||
deepOrange50,
|
||||
deepOrange100,
|
||||
deepOrange200,
|
||||
deepOrange300,
|
||||
deepOrange400,
|
||||
deepOrange500,
|
||||
deepOrange600,
|
||||
deepOrange700,
|
||||
deepOrange800,
|
||||
deepOrange900,
|
||||
deepOrangeA100,
|
||||
deepOrangeA200,
|
||||
deepOrangeA400,
|
||||
deepOrangeA700,
|
||||
brown50,
|
||||
brown100,
|
||||
brown200,
|
||||
brown300,
|
||||
brown400,
|
||||
brown500,
|
||||
brown600,
|
||||
brown700,
|
||||
brown800,
|
||||
brown900,
|
||||
blueGrey50,
|
||||
blueGrey100,
|
||||
blueGrey200,
|
||||
blueGrey300,
|
||||
blueGrey400,
|
||||
blueGrey500,
|
||||
blueGrey600,
|
||||
blueGrey700,
|
||||
blueGrey800,
|
||||
blueGrey900,
|
||||
grey50,
|
||||
grey100,
|
||||
grey200,
|
||||
grey300,
|
||||
grey400,
|
||||
grey500,
|
||||
grey600,
|
||||
grey700,
|
||||
grey800,
|
||||
grey900,
|
||||
black,
|
||||
white,
|
||||
transparent,
|
||||
fullBlack,
|
||||
darkBlack,
|
||||
lightBlack,
|
||||
minBlack,
|
||||
faintBlack,
|
||||
fullWhite,
|
||||
darkWhite,
|
||||
lightWhite
|
||||
};
|
||||
Q_ENUM(Color)
|
||||
};
|
||||
|
||||
#endif // QTMATERIALCONST_H
|
||||
|
|
@ -2,8 +2,9 @@
|
|||
#define QTMATERIALOVERLAYWIDGET_H
|
||||
|
||||
#include <QtWidgets/QWidget>
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialOverlayWidget : public QWidget
|
||||
class QT_MATERIAL_EXPORT QtMaterialOverlayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
#include <QPropertyAnimation>
|
||||
#include <QPoint>
|
||||
#include <QBrush>
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialRippleOverlay;
|
||||
|
||||
class QtMaterialRipple : public QParallelAnimationGroup
|
||||
class QT_MATERIAL_EXPORT QtMaterialRipple : public QParallelAnimationGroup
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@
|
|||
|
||||
#include <QPainterPath>
|
||||
#include "lib/qtmaterialoverlaywidget.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialRipple;
|
||||
|
||||
class QtMaterialRippleOverlay : public QtMaterialOverlayWidget
|
||||
class QT_MATERIAL_EXPORT QtMaterialRippleOverlay : public QtMaterialOverlayWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@
|
|||
|
||||
#include <QtWidgets/QCommonStyle>
|
||||
#include "lib/qtmaterialstyle_p.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
#define MATERIAL_DISABLE_THEME_COLORS \
|
||||
if (d->useThemeColors == true) { d->useThemeColors = false; }
|
||||
|
||||
class QtMaterialTheme;
|
||||
|
||||
class QtMaterialStyle : public QCommonStyle
|
||||
class QT_MATERIAL_EXPORT QtMaterialStyle : public QCommonStyle
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -33,19 +33,19 @@ QtMaterialTheme::QtMaterialTheme(QObject *parent)
|
|||
: QObject(parent),
|
||||
d_ptr(new QtMaterialThemePrivate(this))
|
||||
{
|
||||
setColor("primary1", Material::cyan500);
|
||||
setColor("primary2", Material::cyan700);
|
||||
setColor("primary3", Material::lightBlack);
|
||||
setColor("accent1", Material::pinkA200);
|
||||
setColor("accent2", Material::grey100);
|
||||
setColor("accent3", Material::grey500);
|
||||
setColor("text", Material::darkBlack);
|
||||
setColor("alternateText", Material::white);
|
||||
setColor("canvas", Material::white);
|
||||
setColor("border", Material::grey300);
|
||||
setColor("disabled", Material::minBlack);
|
||||
setColor("disabled2", Material::faintBlack);
|
||||
setColor("disabled3", Material::grey300);
|
||||
setColor("primary1", MaterialConst::cyan500);
|
||||
setColor("primary2", MaterialConst::cyan700);
|
||||
setColor("primary3", MaterialConst::lightBlack);
|
||||
setColor("accent1", MaterialConst::pinkA200);
|
||||
setColor("accent2", MaterialConst::grey100);
|
||||
setColor("accent3", MaterialConst::grey500);
|
||||
setColor("text", MaterialConst::darkBlack);
|
||||
setColor("alternateText", MaterialConst::white);
|
||||
setColor("canvas", MaterialConst::white);
|
||||
setColor("border", MaterialConst::grey300);
|
||||
setColor("disabled", MaterialConst::minBlack);
|
||||
setColor("disabled2", MaterialConst::faintBlack);
|
||||
setColor("disabled3", MaterialConst::grey300);
|
||||
}
|
||||
|
||||
QtMaterialTheme::~QtMaterialTheme()
|
||||
|
|
@ -70,7 +70,7 @@ void QtMaterialTheme::setColor(const QString &key, const QColor &color)
|
|||
d->colors.insert(key, color);
|
||||
}
|
||||
|
||||
void QtMaterialTheme::setColor(const QString &key, Material::Color color)
|
||||
void QtMaterialTheme::setColor(const QString &key, MaterialConst::Color color)
|
||||
{
|
||||
Q_D(QtMaterialTheme);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,320 +5,12 @@
|
|||
#include <QScopedPointer>
|
||||
#include <QColor>
|
||||
#include <QIcon>
|
||||
|
||||
namespace Material
|
||||
{
|
||||
enum ButtonPreset {
|
||||
FlatPreset,
|
||||
CheckablePreset
|
||||
};
|
||||
|
||||
enum RippleStyle {
|
||||
CenteredRipple,
|
||||
PositionedRipple,
|
||||
NoRipple
|
||||
};
|
||||
|
||||
enum OverlayStyle {
|
||||
NoOverlay,
|
||||
TintedOverlay,
|
||||
GrayOverlay
|
||||
};
|
||||
|
||||
enum Role {
|
||||
Default,
|
||||
Primary,
|
||||
Secondary
|
||||
};
|
||||
|
||||
enum ButtonIconPlacement {
|
||||
LeftIcon,
|
||||
RightIcon
|
||||
};
|
||||
|
||||
enum ProgressType {
|
||||
DeterminateProgress,
|
||||
IndeterminateProgress
|
||||
};
|
||||
|
||||
enum AvatarType {
|
||||
ImageAvatar,
|
||||
IconAvatar,
|
||||
LetterAvatar
|
||||
};
|
||||
|
||||
enum Color {
|
||||
red50,
|
||||
red100,
|
||||
red200,
|
||||
red300,
|
||||
red400,
|
||||
red500,
|
||||
red600,
|
||||
red700,
|
||||
red800,
|
||||
red900,
|
||||
redA100,
|
||||
redA200,
|
||||
redA400,
|
||||
redA700,
|
||||
pink50,
|
||||
pink100,
|
||||
pink200,
|
||||
pink300,
|
||||
pink400,
|
||||
pink500,
|
||||
pink600,
|
||||
pink700,
|
||||
pink800,
|
||||
pink900,
|
||||
pinkA100,
|
||||
pinkA200,
|
||||
pinkA400,
|
||||
pinkA700,
|
||||
purple50,
|
||||
purple100,
|
||||
purple200,
|
||||
purple300,
|
||||
purple400,
|
||||
purple500,
|
||||
purple600,
|
||||
purple700,
|
||||
purple800,
|
||||
purple900,
|
||||
purpleA100,
|
||||
purpleA200,
|
||||
purpleA400,
|
||||
purpleA700,
|
||||
deepPurple50,
|
||||
deepPurple100,
|
||||
deepPurple200,
|
||||
deepPurple300,
|
||||
deepPurple400,
|
||||
deepPurple500,
|
||||
deepPurple600,
|
||||
deepPurple700,
|
||||
deepPurple800,
|
||||
deepPurple900,
|
||||
deepPurpleA100,
|
||||
deepPurpleA200,
|
||||
deepPurpleA400,
|
||||
deepPurpleA700,
|
||||
indigo50,
|
||||
indigo100,
|
||||
indigo200,
|
||||
indigo300,
|
||||
indigo400,
|
||||
indigo500,
|
||||
indigo600,
|
||||
indigo700,
|
||||
indigo800,
|
||||
indigo900,
|
||||
indigoA100,
|
||||
indigoA200,
|
||||
indigoA400,
|
||||
indigoA700,
|
||||
blue50,
|
||||
blue100,
|
||||
blue200,
|
||||
blue300,
|
||||
blue400,
|
||||
blue500,
|
||||
blue600,
|
||||
blue700,
|
||||
blue800,
|
||||
blue900,
|
||||
blueA100,
|
||||
blueA200,
|
||||
blueA400,
|
||||
blueA700,
|
||||
lightBlue50,
|
||||
lightBlue100,
|
||||
lightBlue200,
|
||||
lightBlue300,
|
||||
lightBlue400,
|
||||
lightBlue500,
|
||||
lightBlue600,
|
||||
lightBlue700,
|
||||
lightBlue800,
|
||||
lightBlue900,
|
||||
lightBlueA100,
|
||||
lightBlueA200,
|
||||
lightBlueA400,
|
||||
lightBlueA700,
|
||||
cyan50,
|
||||
cyan100,
|
||||
cyan200,
|
||||
cyan300,
|
||||
cyan400,
|
||||
cyan500,
|
||||
cyan600,
|
||||
cyan700,
|
||||
cyan800,
|
||||
cyan900,
|
||||
cyanA100,
|
||||
cyanA200,
|
||||
cyanA400,
|
||||
cyanA700,
|
||||
teal50,
|
||||
teal100,
|
||||
teal200,
|
||||
teal300,
|
||||
teal400,
|
||||
teal500,
|
||||
teal600,
|
||||
teal700,
|
||||
teal800,
|
||||
teal900,
|
||||
tealA100,
|
||||
tealA200,
|
||||
tealA400,
|
||||
tealA700,
|
||||
green50,
|
||||
green100,
|
||||
green200,
|
||||
green300,
|
||||
green400,
|
||||
green500,
|
||||
green600,
|
||||
green700,
|
||||
green800,
|
||||
green900,
|
||||
greenA100,
|
||||
greenA200,
|
||||
greenA400,
|
||||
greenA700,
|
||||
lightGreen50,
|
||||
lightGreen100,
|
||||
lightGreen200,
|
||||
lightGreen300,
|
||||
lightGreen400,
|
||||
lightGreen500,
|
||||
lightGreen600,
|
||||
lightGreen700,
|
||||
lightGreen800,
|
||||
lightGreen900,
|
||||
lightGreenA100,
|
||||
lightGreenA200,
|
||||
lightGreenA400,
|
||||
lightGreenA700,
|
||||
lime50,
|
||||
lime100,
|
||||
lime200,
|
||||
lime300,
|
||||
lime400,
|
||||
lime500,
|
||||
lime600,
|
||||
lime700,
|
||||
lime800,
|
||||
lime900,
|
||||
limeA100,
|
||||
limeA200,
|
||||
limeA400,
|
||||
limeA700,
|
||||
yellow50,
|
||||
yellow100,
|
||||
yellow200,
|
||||
yellow300,
|
||||
yellow400,
|
||||
yellow500,
|
||||
yellow600,
|
||||
yellow700,
|
||||
yellow800,
|
||||
yellow900,
|
||||
yellowA100,
|
||||
yellowA200,
|
||||
yellowA400,
|
||||
yellowA700,
|
||||
amber50,
|
||||
amber100,
|
||||
amber200,
|
||||
amber300,
|
||||
amber400,
|
||||
amber500,
|
||||
amber600,
|
||||
amber700,
|
||||
amber800,
|
||||
amber900,
|
||||
amberA100,
|
||||
amberA200,
|
||||
amberA400,
|
||||
amberA700,
|
||||
orange50,
|
||||
orange100,
|
||||
orange200,
|
||||
orange300,
|
||||
orange400,
|
||||
orange500,
|
||||
orange600,
|
||||
orange700,
|
||||
orange800,
|
||||
orange900,
|
||||
orangeA100,
|
||||
orangeA200,
|
||||
orangeA400,
|
||||
orangeA700,
|
||||
deepOrange50,
|
||||
deepOrange100,
|
||||
deepOrange200,
|
||||
deepOrange300,
|
||||
deepOrange400,
|
||||
deepOrange500,
|
||||
deepOrange600,
|
||||
deepOrange700,
|
||||
deepOrange800,
|
||||
deepOrange900,
|
||||
deepOrangeA100,
|
||||
deepOrangeA200,
|
||||
deepOrangeA400,
|
||||
deepOrangeA700,
|
||||
brown50,
|
||||
brown100,
|
||||
brown200,
|
||||
brown300,
|
||||
brown400,
|
||||
brown500,
|
||||
brown600,
|
||||
brown700,
|
||||
brown800,
|
||||
brown900,
|
||||
blueGrey50,
|
||||
blueGrey100,
|
||||
blueGrey200,
|
||||
blueGrey300,
|
||||
blueGrey400,
|
||||
blueGrey500,
|
||||
blueGrey600,
|
||||
blueGrey700,
|
||||
blueGrey800,
|
||||
blueGrey900,
|
||||
grey50,
|
||||
grey100,
|
||||
grey200,
|
||||
grey300,
|
||||
grey400,
|
||||
grey500,
|
||||
grey600,
|
||||
grey700,
|
||||
grey800,
|
||||
grey900,
|
||||
black,
|
||||
white,
|
||||
transparent,
|
||||
fullBlack,
|
||||
darkBlack,
|
||||
lightBlack,
|
||||
minBlack,
|
||||
faintBlack,
|
||||
fullWhite,
|
||||
darkWhite,
|
||||
lightWhite
|
||||
};
|
||||
}
|
||||
#include "qtmaterialconst.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialThemePrivate;
|
||||
|
||||
class QtMaterialTheme : public QObject
|
||||
class QT_MATERIAL_EXPORT QtMaterialTheme : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -329,7 +21,7 @@ public:
|
|||
QColor getColor(const QString &key) const;
|
||||
|
||||
void setColor(const QString &key, const QColor &color);
|
||||
void setColor(const QString &key, Material::Color color);
|
||||
void setColor(const QString &key, MaterialConst::Color color);
|
||||
|
||||
static QIcon icon(QString category, QString icon);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,138 @@
|
|||
COMP_PATH=$$PWD
|
||||
|
||||
INCLUDEPATH += $$COMP_PATH
|
||||
DEFINES += QT_MATERIAL_LIBRARY
|
||||
|
||||
SOURCES += \
|
||||
$$COMP_PATH/qtmaterialavatar.cpp \
|
||||
$$COMP_PATH/lib/qtmaterialstyle.cpp \
|
||||
$$COMP_PATH/lib/qtmaterialtheme.cpp \
|
||||
$$COMP_PATH/qtmaterialbadge.cpp \
|
||||
$$COMP_PATH/lib/qtmaterialoverlaywidget.cpp \
|
||||
$$COMP_PATH/qtmaterialcheckbox.cpp \
|
||||
$$COMP_PATH/lib/qtmaterialcheckable_internal.cpp \
|
||||
$$COMP_PATH/lib/qtmaterialcheckable.cpp \
|
||||
$$COMP_PATH/lib/qtmaterialripple.cpp \
|
||||
$$COMP_PATH/lib/qtmaterialrippleoverlay.cpp \
|
||||
$$COMP_PATH/qtmaterialfab.cpp \
|
||||
$$COMP_PATH/qtmaterialraisedbutton.cpp \
|
||||
$$COMP_PATH/qtmaterialflatbutton_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialflatbutton.cpp \
|
||||
$$COMP_PATH/lib/qtmaterialstatetransition.cpp \
|
||||
$$COMP_PATH/qtmaterialiconbutton.cpp \
|
||||
$$COMP_PATH/qtmaterialprogress_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialprogress.cpp \
|
||||
$$COMP_PATH/qtmaterialcircularprogress_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialcircularprogress.cpp \
|
||||
$$COMP_PATH/qtmaterialslider_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialslider.cpp \
|
||||
$$COMP_PATH/qtmaterialsnackbar_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialsnackbar.cpp \
|
||||
$$COMP_PATH/qtmaterialradiobutton.cpp \
|
||||
$$COMP_PATH/qtmaterialtoggle_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialtoggle.cpp \
|
||||
$$COMP_PATH/qtmaterialtextfield_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialtextfield.cpp \
|
||||
$$COMP_PATH/qtmaterialtabs_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialtabs.cpp \
|
||||
$$COMP_PATH/qtmaterialscrollbar_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialscrollbar.cpp \
|
||||
$$COMP_PATH/qtmaterialdialog_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialdialog.cpp \
|
||||
$$COMP_PATH/qtmaterialdrawer_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialdrawer.cpp \
|
||||
$$COMP_PATH/qtmaterialappbar.cpp \
|
||||
$$COMP_PATH/qtmaterialautocomplete.cpp \
|
||||
$$COMP_PATH/qtmaterialpaper.cpp \
|
||||
$$COMP_PATH/qtmaterialtable.cpp \
|
||||
$$COMP_PATH/layouts/qtmaterialsnackbarlayout.cpp \
|
||||
$$COMP_PATH/qtmaterialautocomplete_internal.cpp \
|
||||
$$COMP_PATH/qtmaterialmenu.cpp \
|
||||
$$COMP_PATH/qtmaterialmenu_internal.cpp \
|
||||
$$COMP_PATH/qtmateriallist.cpp \
|
||||
$$COMP_PATH/qtmateriallistitem.cpp \
|
||||
$$PWD/qtmaterialtabwidget.cpp
|
||||
HEADERS += \
|
||||
$$COMP_PATH/qtmaterialavatar_p.h \
|
||||
$$COMP_PATH/qtmaterialavatar.h \
|
||||
$$COMP_PATH/lib/qtmaterialstyle_p.h \
|
||||
$$COMP_PATH/lib/qtmaterialstyle.h \
|
||||
$$COMP_PATH/lib/qtmaterialtheme_p.h \
|
||||
$$COMP_PATH/lib/qtmaterialtheme.h \
|
||||
$$COMP_PATH/qtmaterialbadge_p.h \
|
||||
$$COMP_PATH/qtmaterialbadge.h \
|
||||
$$COMP_PATH/lib/qtmaterialoverlaywidget.h \
|
||||
$$COMP_PATH/qtmaterialcheckbox_p.h \
|
||||
$$COMP_PATH/qtmaterialcheckbox.h \
|
||||
$$COMP_PATH/lib/qtmaterialcheckable_internal.h \
|
||||
$$COMP_PATH/lib/qtmaterialcheckable_p.h \
|
||||
$$COMP_PATH/lib/qtmaterialripple.h \
|
||||
$$COMP_PATH/lib/qtmaterialrippleoverlay.h \
|
||||
$$COMP_PATH/lib/qtmaterialcheckable.h \
|
||||
$$COMP_PATH/qtmaterialfab_p.h \
|
||||
$$COMP_PATH/qtmaterialfab.h \
|
||||
$$COMP_PATH/qtmaterialraisedbutton_p.h \
|
||||
$$COMP_PATH/qtmaterialraisedbutton.h \
|
||||
$$COMP_PATH/qtmaterialflatbutton_internal.h \
|
||||
$$COMP_PATH/qtmaterialflatbutton_p.h \
|
||||
$$COMP_PATH/qtmaterialflatbutton.h \
|
||||
$$COMP_PATH/lib/qtmaterialstatetransition.h \
|
||||
$$COMP_PATH/lib/qtmaterialstatetransitionevent.h \
|
||||
$$COMP_PATH/qtmaterialiconbutton_p.h \
|
||||
$$COMP_PATH/qtmaterialiconbutton.h \
|
||||
$$COMP_PATH/qtmaterialprogress_internal.h \
|
||||
$$COMP_PATH/qtmaterialprogress_p.h \
|
||||
$$COMP_PATH/qtmaterialprogress.h \
|
||||
$$COMP_PATH/qtmaterialcircularprogress_internal.h \
|
||||
$$COMP_PATH/qtmaterialcircularprogress_p.h \
|
||||
$$COMP_PATH/qtmaterialcircularprogress.h \
|
||||
$$COMP_PATH/qtmaterialslider_internal.h \
|
||||
$$COMP_PATH/qtmaterialslider_p.h \
|
||||
$$COMP_PATH/qtmaterialslider.h \
|
||||
$$COMP_PATH/qtmaterialsnackbar_internal.h \
|
||||
$$COMP_PATH/qtmaterialsnackbar_p.h \
|
||||
$$COMP_PATH/qtmaterialsnackbar.h \
|
||||
$$COMP_PATH/qtmaterialradiobutton_p.h \
|
||||
$$COMP_PATH/qtmaterialradiobutton.h \
|
||||
$$COMP_PATH/qtmaterialtoggle_internal.h \
|
||||
$$COMP_PATH/qtmaterialtoggle_p.h \
|
||||
$$COMP_PATH/qtmaterialtoggle.h \
|
||||
$$COMP_PATH/qtmaterialtextfield_internal.h \
|
||||
$$COMP_PATH/qtmaterialtextfield_p.h \
|
||||
$$COMP_PATH/qtmaterialtextfield.h \
|
||||
$$COMP_PATH/qtmaterialtabs_internal.h \
|
||||
$$COMP_PATH/qtmaterialtabs_p.h \
|
||||
$$COMP_PATH/qtmaterialtabs.h \
|
||||
$$COMP_PATH/qtmaterialscrollbar_internal.h \
|
||||
$$COMP_PATH/qtmaterialscrollbar_p.h \
|
||||
$$COMP_PATH/qtmaterialscrollbar.h \
|
||||
$$COMP_PATH/qtmaterialdialog_internal.h \
|
||||
$$COMP_PATH/qtmaterialdialog_p.h \
|
||||
$$COMP_PATH/qtmaterialdialog.h \
|
||||
$$COMP_PATH/qtmaterialdrawer_internal.h \
|
||||
$$COMP_PATH/qtmaterialdrawer_p.h \
|
||||
$$COMP_PATH/qtmaterialdrawer.h \
|
||||
$$COMP_PATH/qtmaterialappbar.h \
|
||||
$$COMP_PATH/qtmaterialappbar_p.h \
|
||||
$$COMP_PATH/qtmaterialautocomplete.h \
|
||||
$$COMP_PATH/qtmaterialautocomplete_p.h \
|
||||
$$COMP_PATH/qtmaterialpaper.h \
|
||||
$$COMP_PATH/qtmaterialpaper_p.h \
|
||||
$$COMP_PATH/qtmaterialtable.h \
|
||||
$$COMP_PATH/qtmaterialtable_p.h \
|
||||
$$COMP_PATH/layouts/qtmaterialsnackbarlayout.h \
|
||||
$$COMP_PATH/layouts/qtmaterialsnackbarlayout_p.h \
|
||||
$$COMP_PATH/qtmaterialautocomplete_internal.h \
|
||||
$$COMP_PATH/qtmaterialmenu.h \
|
||||
$$COMP_PATH/qtmaterialmenu_p.h \
|
||||
$$COMP_PATH/qtmaterialmenu_internal.h \
|
||||
$$COMP_PATH/qtmateriallist.h \
|
||||
$$COMP_PATH/qtmateriallist_p.h \
|
||||
$$COMP_PATH/qtmateriallistitem.h \
|
||||
$$COMP_PATH/qtmateriallistitem_p.h \
|
||||
$$PWD/lib/qtmaterialconst.h \
|
||||
$$PWD/qtmaterial_global.h \
|
||||
$$PWD/qtmaterialtabwidget.h
|
||||
|
||||
RESOURCES += \
|
||||
$$COMP_PATH/material_res.qrc
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef PLUGINTEMPLATE_H
|
||||
#define PLUGINTEMPLATE_H
|
||||
|
||||
#define QT_DESIGN_PLUGIN(pluginName, headerFile, className) \
|
||||
class pluginName : public QObject, public QDesignerCustomWidgetInterface \
|
||||
{ \
|
||||
Q_OBJECT \
|
||||
public: \
|
||||
explicit pluginName(QObject *parent = nullptr):QObject(parent) {} \
|
||||
\
|
||||
QString name() const override { return #className; } \
|
||||
QString group() const override { return "Qt Material Widgets"; } \
|
||||
QString toolTip() const override { return QString(); } \
|
||||
QString whatsThis() const override { return QString(); } \
|
||||
QString includeFile() const override { return headerFile; } \
|
||||
QIcon icon() const override { return QIcon(); } \
|
||||
\
|
||||
QWidget *createWidget(QWidget *parent) override { return new className(parent); } \
|
||||
bool isContainer() const override { return true; } \
|
||||
bool isInitialized() const override { return initialized; } \
|
||||
void initialize(QDesignerFormEditorInterface * /*core*/) override { \
|
||||
if (initialized) \
|
||||
return; \
|
||||
\
|
||||
initialized = true; \
|
||||
} \
|
||||
\
|
||||
private: \
|
||||
bool initialized; \
|
||||
}; \
|
||||
|
||||
|
||||
#endif // PLUGINTEMPLATE_H
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
#include "qtmaterialplugins.h"
|
||||
#include "qtmaterialtabwidgetplugin.h"
|
||||
QtMaterialPlugins::QtMaterialPlugins(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_plugins << new MaterialAppBarPlugin(this)
|
||||
<< new MaterialAutoCompletePlugin(this)
|
||||
<< new MaterialAvatarPlugin(this)
|
||||
<< new MaterialBadgePlugin(this)
|
||||
<< new MaterialCheckBoxPlugin(this)
|
||||
<< new MaterialCircularProgressPlugin(this)
|
||||
<< new MaterialDialogPlugin(this)
|
||||
<< new MaterialDrawerPlugin(this)
|
||||
<< new MaterialFabPlugin(this)
|
||||
<< new MaterialFlatButtonPlugin(this)
|
||||
<< new MaterialIconButtonPlugin(this)
|
||||
//// << new MaterialListPlugin(this)
|
||||
//// << new MaterialListItemPlugin(this)
|
||||
// << new MaterialMenuPlugin(this)
|
||||
//// << new MaterialPaperPlugin(this)
|
||||
<< new MaterialProgressPlugin(this)
|
||||
<< new MaterialRadioButtonPlugin(this)
|
||||
<< new MaterialRaisedButtonPlugin(this)
|
||||
// << new MaterialScrollbarPlugin(this)
|
||||
<< new MaterialSliderPlugin(this)
|
||||
<< new MaterialSnackbarPlugin(this)
|
||||
//// << new MaterialTablePlugin(this)
|
||||
<< new MaterialTabsPlugin(this)
|
||||
<< new MaterialTextFieldPlugin(this)
|
||||
<< new MaterialTogglePlugin(this)
|
||||
<< new QtMaterialTabWidgetPlugin(this)
|
||||
;
|
||||
}
|
||||
|
||||
QList<QDesignerCustomWidgetInterface*> QtMaterialPlugins::customWidgets() const {
|
||||
return m_plugins;
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
#ifndef QTMATERIALPLUGINS_H
|
||||
#define QTMATERIALPLUGINS_H
|
||||
|
||||
#include <QtUiPlugin/QDesignerCustomWidgetCollectionInterface>
|
||||
#include "plugintemplate.h"
|
||||
#include "qtmaterialappbar.h"
|
||||
#include "qtmaterialautocomplete.h"
|
||||
#include "qtmaterialavatar.h"
|
||||
#include "qtmaterialbadge.h"
|
||||
#include "qtmaterialcheckbox.h"
|
||||
#include "qtmaterialcircularprogress.h"
|
||||
#include "qtmaterialdialog.h"
|
||||
#include "qtmaterialdrawer.h"
|
||||
#include "qtmaterialfab.h"
|
||||
#include "qtmaterialflatbutton.h"
|
||||
#include "qtmaterialiconbutton.h"
|
||||
#include "qtmateriallist.h"
|
||||
#include "qtmateriallistitem.h"
|
||||
#include "qtmaterialmenu.h"
|
||||
#include "qtmaterialpaper.h"
|
||||
#include "qtmaterialprogress.h"
|
||||
#include "qtmaterialradiobutton.h"
|
||||
#include "qtmaterialraisedbutton.h"
|
||||
#include "qtmaterialscrollbar.h"
|
||||
#include "qtmaterialslider.h"
|
||||
#include "qtmaterialsnackbar.h"
|
||||
#include "qtmaterialtable.h"
|
||||
#include "qtmaterialtabs.h"
|
||||
#include "qtmaterialtextfield.h"
|
||||
#include "qtmaterialtoggle.h"
|
||||
|
||||
QT_DESIGN_PLUGIN(MaterialAppBarPlugin , "qtmaterialappbar.h" , QtMaterialAppBar )
|
||||
QT_DESIGN_PLUGIN(MaterialAutoCompletePlugin , "qtmaterialautocomplete.h" , QtMaterialAutoComplete )
|
||||
QT_DESIGN_PLUGIN(MaterialAvatarPlugin , "qtmaterialavatar.h" , QtMaterialAvatar )
|
||||
QT_DESIGN_PLUGIN(MaterialBadgePlugin , "qtmaterialbadge.h" , QtMaterialBadge )
|
||||
QT_DESIGN_PLUGIN(MaterialCheckBoxPlugin , "qtmaterialcheckbox.h" , QtMaterialCheckBox )
|
||||
QT_DESIGN_PLUGIN(MaterialCircularProgressPlugin, "qtmaterialcircularprogress.h", QtMaterialCircularProgress)
|
||||
QT_DESIGN_PLUGIN(MaterialDialogPlugin , "qtmaterialdialog.h" , QtMaterialDialog )
|
||||
QT_DESIGN_PLUGIN(MaterialDrawerPlugin , "qtmaterialdrawer.h" , QtMaterialDrawer )
|
||||
QT_DESIGN_PLUGIN(MaterialFabPlugin , "qtmaterialfab.h" , QtMaterialFloatingActionButton)
|
||||
QT_DESIGN_PLUGIN(MaterialFlatButtonPlugin , "qtmaterialflatbutton.h" , QtMaterialFlatButton )
|
||||
QT_DESIGN_PLUGIN(MaterialIconButtonPlugin , "qtmaterialiconbutton.h" , QtMaterialIconButton )
|
||||
//QT_DESIGN_PLUGIN(MaterialListPlugin , "qtmateriallist.h" , QtMaterialList )
|
||||
//QT_DESIGN_PLUGIN(MaterialListItemPlugin , "qtmateriallistitem.h" , QtMaterialListItem )
|
||||
QT_DESIGN_PLUGIN(MaterialMenuPlugin , "qtmaterialmenu.h" , QtMaterialMenu )
|
||||
//QT_DESIGN_PLUGIN(MaterialPaperPlugin , "qtmaterialpaper.h" , QtMaterialPaper )
|
||||
QT_DESIGN_PLUGIN(MaterialProgressPlugin , "qtmaterialprogress.h" , QtMaterialProgress )
|
||||
QT_DESIGN_PLUGIN(MaterialRadioButtonPlugin , "qtmaterialradiobutton.h" , QtMaterialRadioButton )
|
||||
QT_DESIGN_PLUGIN(MaterialRaisedButtonPlugin , "qtmaterialraisedbutton.h" , QtMaterialRaisedButton )
|
||||
QT_DESIGN_PLUGIN(MaterialScrollbarPlugin , "qtmaterialscrollbar.h" , QtMaterialScrollBar )
|
||||
QT_DESIGN_PLUGIN(MaterialSliderPlugin , "qtmaterialslider.h" , QtMaterialSlider )
|
||||
QT_DESIGN_PLUGIN(MaterialSnackbarPlugin , "qtmaterialsnackbar.h" , QtMaterialSnackbar )
|
||||
//QT_DESIGN_PLUGIN(MaterialTablePlugin , "qtmaterialtable.h" , QtMaterialTable )
|
||||
QT_DESIGN_PLUGIN(MaterialTabsPlugin , "qtmaterialtabs.h" , QtMaterialTabs )
|
||||
QT_DESIGN_PLUGIN(MaterialTextFieldPlugin , "qtmaterialtextfield.h" , QtMaterialTextField )
|
||||
QT_DESIGN_PLUGIN(MaterialTogglePlugin , "qtmaterialtoggle.h" , QtMaterialToggle )
|
||||
|
||||
class QtMaterialPlugins : public QObject, public QDesignerCustomWidgetCollectionInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "com.meta-vi.QDesignerCustomWidgetCollectionInterface")
|
||||
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
|
||||
public:
|
||||
explicit QtMaterialPlugins(QObject *parent = nullptr);
|
||||
QList<QDesignerCustomWidgetInterface*> customWidgets() const;
|
||||
|
||||
private:
|
||||
QList<QDesignerCustomWidgetInterface *> m_plugins;
|
||||
|
||||
};
|
||||
|
||||
#endif // QTMATERIALPLUGINS_H
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
#include "qtmaterialtabwidgetcontainerextension.h"
|
||||
#include "qtmaterialtabwidget.h"
|
||||
|
||||
QtMaterialTabWidgetContainerExtension::QtMaterialTabWidgetContainerExtension(QtMaterialTabWidget *widget,
|
||||
QObject *parent)
|
||||
: QObject(parent)
|
||||
, myWidget(widget)
|
||||
{
|
||||
}
|
||||
|
||||
void QtMaterialTabWidgetContainerExtension::addWidget(QWidget *widget)
|
||||
{
|
||||
myWidget->addPage(widget);
|
||||
}
|
||||
|
||||
int QtMaterialTabWidgetContainerExtension::count() const
|
||||
{
|
||||
return myWidget->count();
|
||||
}
|
||||
|
||||
int QtMaterialTabWidgetContainerExtension::currentIndex() const
|
||||
{
|
||||
return myWidget->currentIndex();
|
||||
}
|
||||
|
||||
void QtMaterialTabWidgetContainerExtension::insertWidget(int index, QWidget *widget)
|
||||
{
|
||||
myWidget->insertPage(index, widget);
|
||||
}
|
||||
|
||||
void QtMaterialTabWidgetContainerExtension::remove(int index)
|
||||
{
|
||||
myWidget->removePage(index);
|
||||
}
|
||||
|
||||
void QtMaterialTabWidgetContainerExtension::setCurrentIndex(int index)
|
||||
{
|
||||
myWidget->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
QWidget* QtMaterialTabWidgetContainerExtension::widget(int index) const
|
||||
{
|
||||
return myWidget->widget(index);
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef QTMATERIALTABWIDGETCONTAINEREXTENSION_H
|
||||
#define QTMATERIALTABWIDGETCONTAINEREXTENSION_H
|
||||
|
||||
#include <QtDesigner/QDesignerContainerExtension>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QExtensionManager;
|
||||
QT_END_NAMESPACE
|
||||
class QtMaterialTabWidget;
|
||||
|
||||
class QtMaterialTabWidgetContainerExtension: public QObject,
|
||||
public QDesignerContainerExtension
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerContainerExtension)
|
||||
|
||||
public:
|
||||
explicit QtMaterialTabWidgetContainerExtension(QtMaterialTabWidget *widget, QObject *parent);
|
||||
|
||||
void addWidget(QWidget *widget) override;
|
||||
int count() const override;
|
||||
int currentIndex() const override;
|
||||
void insertWidget(int index, QWidget *widget) override;
|
||||
void remove(int index) override;
|
||||
void setCurrentIndex(int index) override;
|
||||
QWidget *widget(int index) const override;
|
||||
|
||||
private:
|
||||
QtMaterialTabWidget *myWidget;
|
||||
};
|
||||
|
||||
#endif // QTMATERIALTABWIDGETCONTAINEREXTENSION_H
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#include "qtmaterialtabwidgetextensionfactory.h"
|
||||
#include "qtmaterialtabwidgetcontainerextension.h"
|
||||
#include "qtmaterialtabwidget.h"
|
||||
|
||||
QtMaterialTabWidgetExtensionFactory::QtMaterialTabWidgetExtensionFactory(QExtensionManager *parent)
|
||||
: QExtensionFactory(parent)
|
||||
{}
|
||||
//! [0]
|
||||
|
||||
//! [1]
|
||||
QObject *QtMaterialTabWidgetExtensionFactory::createExtension(QObject *object,
|
||||
const QString &iid,
|
||||
QObject *parent) const
|
||||
{
|
||||
QtMaterialTabWidget *widget = qobject_cast<QtMaterialTabWidget*>(object);
|
||||
|
||||
if (widget && (iid == Q_TYPEID(QDesignerContainerExtension)))
|
||||
return new QtMaterialTabWidgetContainerExtension(widget, parent);
|
||||
return nullptr;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef QTMATERIALTABWIDGETEXTENSIONFACTORY_H
|
||||
#define QTMATERIALTABWIDGETEXTENSIONFACTORY_H
|
||||
|
||||
#include <QtDesigner/QExtensionFactory>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QExtensionManager;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class QtMaterialTabWidgetExtensionFactory: public QExtensionFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QtMaterialTabWidgetExtensionFactory(QExtensionManager *parent = nullptr);
|
||||
|
||||
protected:
|
||||
QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const override;
|
||||
};
|
||||
|
||||
#endif // QTMATERIALTABWIDGETEXTENSIONFACTORY_H
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
#include <QtDesigner/QExtensionFactory>
|
||||
#include <QtDesigner/QExtensionManager>
|
||||
#include <QtDesigner/QDesignerFormEditorInterface>
|
||||
#include <QtDesigner/QDesignerFormWindowInterface>
|
||||
#include <QtDesigner/QDesignerContainerExtension>
|
||||
#include <QtDesigner/QDesignerPropertySheetExtension>
|
||||
|
||||
#include "qtmaterialtabwidgetplugin.h"
|
||||
#include "qtmaterialtabwidget.h"
|
||||
#include "qtmaterialtabwidgetextensionfactory.h"
|
||||
|
||||
QtMaterialTabWidgetPlugin::QtMaterialTabWidgetPlugin(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QString QtMaterialTabWidgetPlugin::name() const
|
||||
{
|
||||
return QLatin1String("QtMaterialTabWidget");
|
||||
}
|
||||
|
||||
QString QtMaterialTabWidgetPlugin::group() const
|
||||
{
|
||||
return QLatin1String("Qt Material Widgets");
|
||||
}
|
||||
|
||||
QString QtMaterialTabWidgetPlugin::toolTip() const
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString QtMaterialTabWidgetPlugin::whatsThis() const
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString QtMaterialTabWidgetPlugin::includeFile() const
|
||||
{
|
||||
return QLatin1String("qtmaterialtabwidget.h");
|
||||
}
|
||||
|
||||
QIcon QtMaterialTabWidgetPlugin::icon() const
|
||||
{
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
//! [0] //! [1]
|
||||
bool QtMaterialTabWidgetPlugin::isContainer() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//! [1] //! [2]
|
||||
QWidget *QtMaterialTabWidgetPlugin::createWidget(QWidget *parent)
|
||||
{
|
||||
QtMaterialTabWidget *widget = new QtMaterialTabWidget(parent);
|
||||
connect(widget, &QtMaterialTabWidget::currentIndexChanged,
|
||||
this, &QtMaterialTabWidgetPlugin::currentIndexChanged);
|
||||
connect(widget, &QtMaterialTabWidget::pageTitleChanged,
|
||||
this, &QtMaterialTabWidgetPlugin::pageTitleChanged);
|
||||
return widget;
|
||||
}
|
||||
|
||||
//! [2] //! [3]
|
||||
bool QtMaterialTabWidgetPlugin::isInitialized() const
|
||||
{
|
||||
return initialized;
|
||||
}
|
||||
//! [3]
|
||||
|
||||
//! [4]
|
||||
void QtMaterialTabWidgetPlugin::initialize(QDesignerFormEditorInterface *formEditor)
|
||||
{
|
||||
if (initialized)
|
||||
return;
|
||||
//! [4]
|
||||
|
||||
//! [5]
|
||||
QExtensionManager *manager = formEditor->extensionManager();
|
||||
//! [5] //! [6]
|
||||
QExtensionFactory *factory = new QtMaterialTabWidgetExtensionFactory(manager);
|
||||
|
||||
Q_ASSERT(manager != 0);
|
||||
manager->registerExtensions(factory, Q_TYPEID(QDesignerContainerExtension));
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
//! [6]
|
||||
|
||||
//! [7]
|
||||
QString QtMaterialTabWidgetPlugin::domXml() const
|
||||
{
|
||||
return QLatin1String("\
|
||||
<ui language=\"c++\">\
|
||||
<widget class=\"QtMaterialTabWidget\" name=\"tabwidget\">\
|
||||
<widget class=\"QWidget\" name=\"page\" />\
|
||||
</widget>\
|
||||
<customwidgets>\
|
||||
<customwidget>\
|
||||
<class>QtMaterialTabWidget</class>\
|
||||
<extends>QWidget</extends>\
|
||||
<addpagemethod>addPage</addpagemethod>\
|
||||
</customwidget>\
|
||||
</customwidgets>\
|
||||
</ui>");
|
||||
}
|
||||
//! [7]
|
||||
|
||||
//! [8]
|
||||
void QtMaterialTabWidgetPlugin::currentIndexChanged(int index)
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
QtMaterialTabWidget *widget = qobject_cast<QtMaterialTabWidget*>(sender());
|
||||
//! [8] //! [9]
|
||||
if (widget) {
|
||||
QDesignerFormWindowInterface *form = QDesignerFormWindowInterface::findFormWindow(widget);
|
||||
if (form)
|
||||
form->emitSelectionChanged();
|
||||
}
|
||||
}
|
||||
//! [9]
|
||||
|
||||
//! [10]
|
||||
void QtMaterialTabWidgetPlugin::pageTitleChanged(const QString &title)
|
||||
{
|
||||
Q_UNUSED(title);
|
||||
QtMaterialTabWidget *widget = qobject_cast<QtMaterialTabWidget*>(sender());
|
||||
//! [10] //! [11]
|
||||
if (widget) {
|
||||
QWidget *page = widget->widget(widget->currentIndex());
|
||||
QDesignerFormWindowInterface *form;
|
||||
form = QDesignerFormWindowInterface::findFormWindow(widget);
|
||||
//! [11]
|
||||
if (form) {
|
||||
//! [12]
|
||||
QDesignerFormEditorInterface *editor = form->core();
|
||||
QExtensionManager *manager = editor->extensionManager();
|
||||
//! [12] //! [13]
|
||||
QDesignerPropertySheetExtension *sheet;
|
||||
sheet = qt_extension<QDesignerPropertySheetExtension*>(manager, page);
|
||||
const int propertyIndex = sheet->indexOf(QLatin1String("windowTitle"));
|
||||
sheet->setChanged(propertyIndex, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef QTMATERIALTABWIDGETPLUGIN_H
|
||||
#define QTMATERIALTABWIDGETPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||
|
||||
class QtMaterialTabWidgetPlugin: public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QtMaterialTabWidgetPlugin(QObject *parent = nullptr);
|
||||
|
||||
QString name() const override;
|
||||
QString group() const override;
|
||||
QString toolTip() const override;
|
||||
QString whatsThis() const override;
|
||||
QString includeFile() const override;
|
||||
QIcon icon() const override;
|
||||
bool isContainer() const override;
|
||||
QWidget *createWidget(QWidget *parent) override;
|
||||
bool isInitialized() const override;
|
||||
void initialize(QDesignerFormEditorInterface *formEditor) override;
|
||||
QString domXml() const override;
|
||||
|
||||
private slots:
|
||||
void currentIndexChanged(int index);
|
||||
void pageTitleChanged(const QString &title);
|
||||
|
||||
private:
|
||||
bool initialized = false;
|
||||
};
|
||||
|
||||
#endif // QTMATERIALTABWIDGETPLUGIN_H
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef QTMATERIAL_GLOBAL_H
|
||||
#define QTMATERIAL_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if defined(QT_MATERIAL_LIBRARY)
|
||||
# define QT_MATERIAL_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define QT_MATERIAL_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // QTMATERIAL_GLOBAL_H
|
||||
|
|
@ -3,10 +3,11 @@
|
|||
|
||||
#include <QtWidgets/QWidget>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialAppBarPrivate;
|
||||
|
||||
class QtMaterialAppBar : public QWidget
|
||||
class QT_MATERIAL_EXPORT QtMaterialAppBar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,12 @@ void QtMaterialAutoComplete::setDataSource(const QStringList &data)
|
|||
update();
|
||||
}
|
||||
|
||||
QStringList QtMaterialAutoComplete::dataSource() const
|
||||
{
|
||||
Q_D(const QtMaterialAutoComplete);
|
||||
return d->dataSource;
|
||||
}
|
||||
|
||||
void QtMaterialAutoComplete::updateResults(QString text)
|
||||
{
|
||||
Q_D(QtMaterialAutoComplete);
|
||||
|
|
@ -117,7 +123,7 @@ void QtMaterialAutoComplete::updateResults(QString text)
|
|||
item->setCornerRadius(0);
|
||||
item->setHaloVisible(false);
|
||||
item->setFixedHeight(50);
|
||||
item->setOverlayStyle(Material::TintedOverlay);
|
||||
item->setOverlayStyle(MaterialConst::TintedOverlay);
|
||||
d->menuLayout->addWidget(item);
|
||||
item->installEventFilter(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,18 +2,21 @@
|
|||
#define QTMATERIALAUTOCOMPLETE_H
|
||||
|
||||
#include "qtmaterialtextfield.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialAutoCompletePrivate;
|
||||
|
||||
class QtMaterialAutoComplete : public QtMaterialTextField
|
||||
class QT_MATERIAL_EXPORT QtMaterialAutoComplete : public QtMaterialTextField
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QStringList dataSource WRITE setDataSource READ dataSource)
|
||||
|
||||
public:
|
||||
explicit QtMaterialAutoComplete(QWidget *parent = 0);
|
||||
~QtMaterialAutoComplete();
|
||||
|
||||
void setDataSource(const QStringList &data);
|
||||
QStringList dataSource() const;
|
||||
|
||||
signals:
|
||||
void itemSelected(QString);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ void QtMaterialAvatarPrivate::init()
|
|||
Q_Q(QtMaterialAvatar);
|
||||
|
||||
size = 40;
|
||||
type = Material::LetterAvatar;
|
||||
type = MaterialConst::LetterAvatar;
|
||||
useThemeColors = true;
|
||||
|
||||
QFont font(q->font());
|
||||
|
|
@ -188,16 +188,22 @@ void QtMaterialAvatar::setLetter(const QChar &letter)
|
|||
Q_D(QtMaterialAvatar);
|
||||
|
||||
d->letter = letter;
|
||||
d->type = Material::LetterAvatar;
|
||||
d->type = MaterialConst::LetterAvatar;
|
||||
update();
|
||||
}
|
||||
|
||||
QChar QtMaterialAvatar::letter() const
|
||||
{
|
||||
Q_D(const QtMaterialAvatar);
|
||||
return d->letter;
|
||||
}
|
||||
|
||||
void QtMaterialAvatar::setImage(const QImage &image)
|
||||
{
|
||||
Q_D(QtMaterialAvatar);
|
||||
|
||||
d->image = image;
|
||||
d->type = Material::ImageAvatar;
|
||||
d->type = MaterialConst::ImageAvatar;
|
||||
|
||||
d->pixmap = QPixmap::fromImage(image.scaled(d->size, d->size,
|
||||
Qt::IgnoreAspectRatio,
|
||||
|
|
@ -205,16 +211,28 @@ void QtMaterialAvatar::setImage(const QImage &image)
|
|||
update();
|
||||
}
|
||||
|
||||
QImage QtMaterialAvatar::image() const
|
||||
{
|
||||
Q_D(const QtMaterialAvatar);
|
||||
return d->image;
|
||||
}
|
||||
|
||||
void QtMaterialAvatar::setIcon(const QIcon &icon)
|
||||
{
|
||||
Q_D(QtMaterialAvatar);
|
||||
|
||||
d->icon = icon;
|
||||
d->type = Material::IconAvatar;
|
||||
d->type = MaterialConst::IconAvatar;
|
||||
update();
|
||||
}
|
||||
|
||||
Material::AvatarType QtMaterialAvatar::type() const
|
||||
QIcon QtMaterialAvatar::icon() const
|
||||
{
|
||||
Q_D(const QtMaterialAvatar);
|
||||
return d->icon;
|
||||
}
|
||||
|
||||
MaterialConst::AvatarType QtMaterialAvatar::type() const
|
||||
{
|
||||
Q_D(const QtMaterialAvatar);
|
||||
|
||||
|
|
@ -248,7 +266,7 @@ void QtMaterialAvatar::paintEvent(QPaintEvent *event)
|
|||
return;
|
||||
}
|
||||
|
||||
if (Material::ImageAvatar != d->type)
|
||||
if (MaterialConst::ImageAvatar != d->type)
|
||||
{
|
||||
QBrush brush;
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
|
|
@ -261,7 +279,7 @@ void QtMaterialAvatar::paintEvent(QPaintEvent *event)
|
|||
|
||||
switch (d->type)
|
||||
{
|
||||
case Material::ImageAvatar:
|
||||
case MaterialConst::ImageAvatar:
|
||||
{
|
||||
QPainterPath path;
|
||||
path.addEllipse(width()/2-hs, height()/2-hs, d->size, d->size);
|
||||
|
|
@ -271,7 +289,7 @@ void QtMaterialAvatar::paintEvent(QPaintEvent *event)
|
|||
d->pixmap);
|
||||
break;
|
||||
}
|
||||
case Material::IconAvatar:
|
||||
case MaterialConst::IconAvatar:
|
||||
{
|
||||
QRect iconGeometry((width()-hs)/2, (height()-hs)/2, hs, hs);
|
||||
QPixmap pixmap = d->icon.pixmap(hs, hs);
|
||||
|
|
@ -281,7 +299,7 @@ void QtMaterialAvatar::paintEvent(QPaintEvent *event)
|
|||
painter.drawPixmap(iconGeometry, pixmap);
|
||||
break;
|
||||
}
|
||||
case Material::LetterAvatar:
|
||||
case MaterialConst::LetterAvatar:
|
||||
{
|
||||
painter.setPen(textColor());
|
||||
painter.setBrush(Qt::NoBrush);
|
||||
|
|
|
|||
|
|
@ -3,13 +3,21 @@
|
|||
|
||||
#include <QtWidgets/QWidget>
|
||||
#include "lib/qtmaterialtheme.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialAvatarPrivate;
|
||||
|
||||
class QtMaterialAvatar : public QWidget
|
||||
class QT_MATERIAL_EXPORT QtMaterialAvatar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
|
||||
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
|
||||
Q_PROPERTY(int size WRITE setSize READ size)
|
||||
Q_PROPERTY(QChar letter WRITE setLetter READ letter)
|
||||
Q_PROPERTY(QImage image WRITE setImage READ image)
|
||||
Q_PROPERTY(QIcon icon WRITE setIcon READ icon)
|
||||
|
||||
public:
|
||||
explicit QtMaterialAvatar(QWidget *parent = 0);
|
||||
explicit QtMaterialAvatar(const QIcon &icon, QWidget *parent = 0);
|
||||
|
|
@ -32,10 +40,15 @@ public:
|
|||
int size() const;
|
||||
|
||||
void setLetter(const QChar &letter);
|
||||
void setImage(const QImage &image);
|
||||
void setIcon(const QIcon &icon);
|
||||
QChar letter() const;
|
||||
|
||||
Material::AvatarType type() const;
|
||||
void setImage(const QImage &image);
|
||||
QImage image() const;
|
||||
|
||||
void setIcon(const QIcon &icon);
|
||||
QIcon icon() const;
|
||||
|
||||
MaterialConst::AvatarType type() const;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public:
|
|||
|
||||
QtMaterialAvatar *const q_ptr;
|
||||
int size;
|
||||
Material::AvatarType type;
|
||||
MaterialConst::AvatarType type;
|
||||
QChar letter;
|
||||
QImage image;
|
||||
QIcon icon;
|
||||
|
|
|
|||
|
|
@ -2,16 +2,20 @@
|
|||
#define QTMATERIALBADGE_H
|
||||
|
||||
#include "lib/qtmaterialoverlaywidget.h"
|
||||
#include <QIcon>
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialBadgePrivate;
|
||||
|
||||
class QtMaterialBadge : public QtMaterialOverlayWidget
|
||||
class QT_MATERIAL_EXPORT QtMaterialBadge : public QtMaterialOverlayWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
|
||||
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
|
||||
Q_PROPERTY(QPointF relativePosition WRITE setRelativePosition READ relativePosition)
|
||||
Q_PROPERTY(QIcon icon WRITE setIcon READ icon)
|
||||
Q_PROPERTY(QString text WRITE setText READ text)
|
||||
|
||||
public:
|
||||
explicit QtMaterialBadge(QWidget *parent = 0);
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
#define QTMATERIALCHECKBOX_H
|
||||
|
||||
#include "lib/qtmaterialcheckable.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialCheckBoxPrivate;
|
||||
|
||||
class QtMaterialCheckBox : public QtMaterialCheckable
|
||||
class QT_MATERIAL_EXPORT QtMaterialCheckBox : public QtMaterialCheckable
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ void QtMaterialCircularProgressPrivate::init()
|
|||
Q_Q(QtMaterialCircularProgress);
|
||||
|
||||
delegate = new QtMaterialCircularProgressDelegate(q);
|
||||
progressType = Material::IndeterminateProgress;
|
||||
progressType = MaterialConst::IndeterminateProgress;
|
||||
penWidth = 6.25;
|
||||
size = 64;
|
||||
useThemeColors = true;
|
||||
|
|
@ -92,7 +92,7 @@ QtMaterialCircularProgress::~QtMaterialCircularProgress()
|
|||
{
|
||||
}
|
||||
|
||||
void QtMaterialCircularProgress::setProgressType(Material::ProgressType type)
|
||||
void QtMaterialCircularProgress::setProgressType(MaterialConst::ProgressType type)
|
||||
{
|
||||
Q_D(QtMaterialCircularProgress);
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ void QtMaterialCircularProgress::setProgressType(Material::ProgressType type)
|
|||
update();
|
||||
}
|
||||
|
||||
Material::ProgressType QtMaterialCircularProgress::progressType() const
|
||||
MaterialConst::ProgressType QtMaterialCircularProgress::progressType() const
|
||||
{
|
||||
Q_D(const QtMaterialCircularProgress);
|
||||
|
||||
|
|
@ -214,7 +214,7 @@ void QtMaterialCircularProgress::paintEvent(QPaintEvent *event)
|
|||
return;
|
||||
}
|
||||
|
||||
if (Material::IndeterminateProgress == d->progressType)
|
||||
if (MaterialConst::IndeterminateProgress == d->progressType)
|
||||
{
|
||||
painter.translate(width()/2, height()/2);
|
||||
painter.rotate(d->delegate->angle());
|
||||
|
|
@ -225,7 +225,7 @@ void QtMaterialCircularProgress::paintEvent(QPaintEvent *event)
|
|||
pen.setWidthF(d->penWidth);
|
||||
pen.setColor(color());
|
||||
|
||||
if (Material::IndeterminateProgress == d->progressType)
|
||||
if (MaterialConst::IndeterminateProgress == d->progressType)
|
||||
{
|
||||
QVector<qreal> pattern;
|
||||
pattern << d->delegate->dashLength()*d->size/50 << 30*d->size/50;
|
||||
|
|
|
|||
|
|
@ -3,13 +3,16 @@
|
|||
|
||||
#include <QtWidgets/QProgressBar>
|
||||
#include "lib/qtmaterialtheme.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialCircularProgressPrivate;
|
||||
|
||||
class QtMaterialCircularProgress : public QProgressBar
|
||||
class QT_MATERIAL_EXPORT QtMaterialCircularProgress : public QProgressBar
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(MaterialConst::ProgressType progressType WRITE setProgressType READ progressType)
|
||||
Q_PROPERTY(bool useThemeColors WRITE setUseThemeColors READ useThemeColors)
|
||||
Q_PROPERTY(qreal lineWidth WRITE setLineWidth READ lineWidth)
|
||||
Q_PROPERTY(qreal size WRITE setSize READ size)
|
||||
Q_PROPERTY(QColor color WRITE setColor READ color)
|
||||
|
|
@ -18,8 +21,8 @@ public:
|
|||
explicit QtMaterialCircularProgress(QWidget *parent = 0);
|
||||
~QtMaterialCircularProgress();
|
||||
|
||||
void setProgressType(Material::ProgressType type);
|
||||
Material::ProgressType progressType() const;
|
||||
void setProgressType(MaterialConst::ProgressType type);
|
||||
MaterialConst::ProgressType progressType() const;
|
||||
|
||||
void setUseThemeColors(bool value);
|
||||
bool useThemeColors() const;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public:
|
|||
|
||||
QtMaterialCircularProgress *const q_ptr;
|
||||
QtMaterialCircularProgressDelegate *delegate;
|
||||
Material::ProgressType progressType;
|
||||
MaterialConst::ProgressType progressType;
|
||||
QColor color;
|
||||
qreal penWidth;
|
||||
int size;
|
||||
|
|
|
|||
|
|
@ -3,11 +3,12 @@
|
|||
|
||||
#include <QScopedPointer>
|
||||
#include "lib/qtmaterialoverlaywidget.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QLayout;
|
||||
class QtMaterialDialogPrivate;
|
||||
|
||||
class QtMaterialDialog : public QtMaterialOverlayWidget
|
||||
class QT_MATERIAL_EXPORT QtMaterialDialog : public QtMaterialOverlayWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@
|
|||
#define QTMATERIALDRAWER_H
|
||||
|
||||
#include "lib/qtmaterialoverlaywidget.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialDrawerPrivate;
|
||||
class QtMaterialDrawerStateMachine;
|
||||
|
||||
class QtMaterialDrawer : public QtMaterialOverlayWidget
|
||||
class QT_MATERIAL_EXPORT QtMaterialDrawer : public QtMaterialOverlayWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ void QtMaterialFloatingActionButtonPrivate::init()
|
|||
offsX = 34;
|
||||
offsY = 36;
|
||||
|
||||
q->setRole(Material::Primary);
|
||||
q->setRole(MaterialConst::Primary);
|
||||
q->setFixedSize(DefaultDiameter, DefaultDiameter);
|
||||
q->setGeometry(fabGeometry());
|
||||
|
||||
|
|
@ -104,6 +104,13 @@ void QtMaterialFloatingActionButtonPrivate::setupProperties()
|
|||
* \class QtMaterialFloatingActionButton
|
||||
*/
|
||||
|
||||
QtMaterialFloatingActionButton::QtMaterialFloatingActionButton(QWidget *parent)
|
||||
: QtMaterialRaisedButton(*new QtMaterialFloatingActionButtonPrivate(this), parent)
|
||||
{
|
||||
d_func()->init();
|
||||
}
|
||||
|
||||
|
||||
QtMaterialFloatingActionButton::QtMaterialFloatingActionButton(const QIcon &icon, QWidget *parent)
|
||||
: QtMaterialRaisedButton(*new QtMaterialFloatingActionButtonPrivate(this), parent)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,14 +2,20 @@
|
|||
#define QTMATERIALFAB_H
|
||||
|
||||
#include "qtmaterialraisedbutton.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialFloatingActionButtonPrivate;
|
||||
|
||||
class QtMaterialFloatingActionButton : public QtMaterialRaisedButton
|
||||
class QT_MATERIAL_EXPORT QtMaterialFloatingActionButton : public QtMaterialRaisedButton
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool mini WRITE setMini READ isMini)
|
||||
Q_PROPERTY(Qt::Corner corner WRITE setCorner READ corner)
|
||||
Q_PROPERTY(int xOffset WRITE setXOffset READ xOffset)
|
||||
Q_PROPERTY(int yOffset WRITE setYOffset READ yOffset)
|
||||
|
||||
public:
|
||||
explicit QtMaterialFloatingActionButton(QWidget *parent = 0);
|
||||
explicit QtMaterialFloatingActionButton(const QIcon &icon, QWidget *parent = 0);
|
||||
~QtMaterialFloatingActionButton();
|
||||
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ void QtMaterialFlatButtonPrivate::init()
|
|||
|
||||
rippleOverlay = new QtMaterialRippleOverlay(q);
|
||||
stateMachine = new QtMaterialFlatButtonStateMachine(q);
|
||||
role = Material::Default;
|
||||
rippleStyle = Material::PositionedRipple;
|
||||
iconPlacement = Material::LeftIcon;
|
||||
overlayStyle = Material::GrayOverlay;
|
||||
role = MaterialConst::Default;
|
||||
rippleStyle = MaterialConst::PositionedRipple;
|
||||
iconPlacement = MaterialConst::LeftIcon;
|
||||
overlayStyle = MaterialConst::GrayOverlay;
|
||||
bgMode = Qt::TransparentMode;
|
||||
textAlignment = Qt::AlignHCenter;
|
||||
fixedRippleRadius = 64;
|
||||
|
|
@ -75,7 +75,7 @@ void QtMaterialFlatButtonPrivate::init()
|
|||
* \class QtMaterialFlatButton
|
||||
*/
|
||||
|
||||
QtMaterialFlatButton::QtMaterialFlatButton(QWidget *parent, Material::ButtonPreset preset)
|
||||
QtMaterialFlatButton::QtMaterialFlatButton(QWidget *parent, MaterialConst::ButtonPreset preset)
|
||||
: QPushButton(parent),
|
||||
d_ptr(new QtMaterialFlatButtonPrivate(this))
|
||||
{
|
||||
|
|
@ -84,7 +84,7 @@ QtMaterialFlatButton::QtMaterialFlatButton(QWidget *parent, Material::ButtonPres
|
|||
applyPreset(preset);
|
||||
}
|
||||
|
||||
QtMaterialFlatButton::QtMaterialFlatButton(const QString &text, QWidget *parent, Material::ButtonPreset preset)
|
||||
QtMaterialFlatButton::QtMaterialFlatButton(const QString &text, QWidget *parent, MaterialConst::ButtonPreset preset)
|
||||
: QPushButton(text, parent),
|
||||
d_ptr(new QtMaterialFlatButtonPrivate(this))
|
||||
{
|
||||
|
|
@ -93,7 +93,7 @@ QtMaterialFlatButton::QtMaterialFlatButton(const QString &text, QWidget *parent,
|
|||
applyPreset(preset);
|
||||
}
|
||||
|
||||
QtMaterialFlatButton::QtMaterialFlatButton(const QString &text, Material::Role role, QWidget *parent, Material::ButtonPreset preset)
|
||||
QtMaterialFlatButton::QtMaterialFlatButton(const QString &text, MaterialConst::Role role, QWidget *parent, MaterialConst::ButtonPreset preset)
|
||||
: QPushButton(text, parent),
|
||||
d_ptr(new QtMaterialFlatButtonPrivate(this))
|
||||
{
|
||||
|
|
@ -107,15 +107,15 @@ QtMaterialFlatButton::~QtMaterialFlatButton()
|
|||
{
|
||||
}
|
||||
|
||||
void QtMaterialFlatButton::applyPreset(Material::ButtonPreset preset)
|
||||
void QtMaterialFlatButton::applyPreset(MaterialConst::ButtonPreset preset)
|
||||
{
|
||||
switch (preset)
|
||||
{
|
||||
case Material::FlatPreset:
|
||||
setOverlayStyle(Material::NoOverlay);
|
||||
case MaterialConst::FlatPreset:
|
||||
setOverlayStyle(MaterialConst::NoOverlay);
|
||||
break;
|
||||
case Material::CheckablePreset:
|
||||
setOverlayStyle(Material::NoOverlay);
|
||||
case MaterialConst::CheckablePreset:
|
||||
setOverlayStyle(MaterialConst::NoOverlay);
|
||||
setCheckable(true);
|
||||
setHaloVisible(false);
|
||||
break;
|
||||
|
|
@ -143,7 +143,7 @@ bool QtMaterialFlatButton::useThemeColors() const
|
|||
return d->useThemeColors;
|
||||
}
|
||||
|
||||
void QtMaterialFlatButton::setRole(Material::Role role)
|
||||
void QtMaterialFlatButton::setRole(MaterialConst::Role role)
|
||||
{
|
||||
Q_D(QtMaterialFlatButton);
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ void QtMaterialFlatButton::setRole(Material::Role role)
|
|||
d->stateMachine->setupProperties();
|
||||
}
|
||||
|
||||
Material::Role QtMaterialFlatButton::role() const
|
||||
MaterialConst::Role QtMaterialFlatButton::role() const
|
||||
{
|
||||
Q_D(const QtMaterialFlatButton);
|
||||
|
||||
|
|
@ -179,11 +179,11 @@ QColor QtMaterialFlatButton::foregroundColor() const
|
|||
}
|
||||
switch (d->role)
|
||||
{
|
||||
case Material::Primary:
|
||||
case MaterialConst::Primary:
|
||||
return QtMaterialStyle::instance().themeColor("primary1");
|
||||
case Material::Secondary:
|
||||
case MaterialConst::Secondary:
|
||||
return QtMaterialStyle::instance().themeColor("accent1");
|
||||
case Material::Default:
|
||||
case MaterialConst::Default:
|
||||
default:
|
||||
return QtMaterialStyle::instance().themeColor("text");
|
||||
}
|
||||
|
|
@ -209,11 +209,11 @@ QColor QtMaterialFlatButton::backgroundColor() const
|
|||
{
|
||||
switch (d->role)
|
||||
{
|
||||
case Material::Primary:
|
||||
case MaterialConst::Primary:
|
||||
return QtMaterialStyle::instance().themeColor("primary1");
|
||||
case Material::Secondary:
|
||||
case MaterialConst::Secondary:
|
||||
return QtMaterialStyle::instance().themeColor("accent1");
|
||||
case Material::Default:
|
||||
case MaterialConst::Default:
|
||||
default:
|
||||
return QtMaterialStyle::instance().themeColor("text");
|
||||
}
|
||||
|
|
@ -229,7 +229,7 @@ void QtMaterialFlatButton::setOverlayColor(const QColor &color)
|
|||
|
||||
MATERIAL_DISABLE_THEME_COLORS
|
||||
|
||||
setOverlayStyle(Material::TintedOverlay);
|
||||
setOverlayStyle(MaterialConst::TintedOverlay);
|
||||
update();
|
||||
}
|
||||
|
||||
|
|
@ -320,7 +320,7 @@ bool QtMaterialFlatButton::isHaloVisible() const
|
|||
return d->haloVisible;
|
||||
}
|
||||
|
||||
void QtMaterialFlatButton::setOverlayStyle(Material::OverlayStyle style)
|
||||
void QtMaterialFlatButton::setOverlayStyle(MaterialConst::OverlayStyle style)
|
||||
{
|
||||
Q_D(QtMaterialFlatButton);
|
||||
|
||||
|
|
@ -328,28 +328,28 @@ void QtMaterialFlatButton::setOverlayStyle(Material::OverlayStyle style)
|
|||
update();
|
||||
}
|
||||
|
||||
Material::OverlayStyle QtMaterialFlatButton::overlayStyle() const
|
||||
MaterialConst::OverlayStyle QtMaterialFlatButton::overlayStyle() const
|
||||
{
|
||||
Q_D(const QtMaterialFlatButton);
|
||||
|
||||
return d->overlayStyle;
|
||||
}
|
||||
|
||||
void QtMaterialFlatButton::setRippleStyle(Material::RippleStyle style)
|
||||
void QtMaterialFlatButton::setRippleStyle(MaterialConst::RippleStyle style)
|
||||
{
|
||||
Q_D(QtMaterialFlatButton);
|
||||
|
||||
d->rippleStyle = style;
|
||||
}
|
||||
|
||||
Material::RippleStyle QtMaterialFlatButton::rippleStyle() const
|
||||
MaterialConst::RippleStyle QtMaterialFlatButton::rippleStyle() const
|
||||
{
|
||||
Q_D(const QtMaterialFlatButton);
|
||||
|
||||
return d->rippleStyle;
|
||||
}
|
||||
|
||||
void QtMaterialFlatButton::setIconPlacement(Material::ButtonIconPlacement placement)
|
||||
void QtMaterialFlatButton::setIconPlacement(MaterialConst::ButtonIconPlacement placement)
|
||||
{
|
||||
Q_D(QtMaterialFlatButton);
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ void QtMaterialFlatButton::setIconPlacement(Material::ButtonIconPlacement placem
|
|||
update();
|
||||
}
|
||||
|
||||
Material::ButtonIconPlacement QtMaterialFlatButton::iconPlacement() const
|
||||
MaterialConst::ButtonIconPlacement QtMaterialFlatButton::iconPlacement() const
|
||||
{
|
||||
Q_D(const QtMaterialFlatButton);
|
||||
|
||||
|
|
@ -473,7 +473,7 @@ QSize QtMaterialFlatButton::sizeHint() const
|
|||
return QSize(w, 20 + h);
|
||||
}
|
||||
|
||||
QtMaterialFlatButton::QtMaterialFlatButton(QtMaterialFlatButtonPrivate &d,QWidget *parent, Material::ButtonPreset preset)
|
||||
QtMaterialFlatButton::QtMaterialFlatButton(QtMaterialFlatButtonPrivate &d,QWidget *parent, MaterialConst::ButtonPreset preset)
|
||||
: QPushButton(parent),
|
||||
d_ptr(&d)
|
||||
{
|
||||
|
|
@ -501,12 +501,12 @@ void QtMaterialFlatButton::mousePressEvent(QMouseEvent *event)
|
|||
{
|
||||
Q_D(QtMaterialFlatButton);
|
||||
|
||||
if (Material::NoRipple != d->rippleStyle)
|
||||
if (MaterialConst::NoRipple != d->rippleStyle)
|
||||
{
|
||||
QPoint pos;
|
||||
qreal radiusEndValue;
|
||||
|
||||
if (Material::CenteredRipple == d->rippleStyle) {
|
||||
if (MaterialConst::CenteredRipple == d->rippleStyle) {
|
||||
pos = rect().center();
|
||||
} else {
|
||||
pos = event->pos();
|
||||
|
|
@ -615,8 +615,8 @@ void QtMaterialFlatButton::paintBackground(QPainter *painter)
|
|||
return;
|
||||
}
|
||||
|
||||
if ((Material::NoOverlay != d->overlayStyle) && (overlayOpacity > 0)) {
|
||||
if (Material::TintedOverlay == d->overlayStyle) {
|
||||
if ((MaterialConst::NoOverlay != d->overlayStyle) && (overlayOpacity > 0)) {
|
||||
if (MaterialConst::TintedOverlay == d->overlayStyle) {
|
||||
brush.setColor(overlayColor());
|
||||
} else {
|
||||
brush.setColor(Qt::gray);
|
||||
|
|
@ -711,7 +711,7 @@ void QtMaterialFlatButton::paintForeground(QPainter *painter)
|
|||
QRect textGeometry(pos + QPoint(0, base.height()/2), textSize);
|
||||
QRect iconGeometry(pos + QPoint(0, (height()-iconSize().height())/2), iconSize());
|
||||
|
||||
if (Material::LeftIcon == d->iconPlacement) {
|
||||
if (MaterialConst::LeftIcon == d->iconPlacement) {
|
||||
textGeometry.translate(iw, 0);
|
||||
} else {
|
||||
iconGeometry.translate(textSize.width() + IconPadding, 0);
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
#include <QtWidgets/QPushButton>
|
||||
#include <QScopedPointer>
|
||||
#include "lib/qtmaterialtheme.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialFlatButtonPrivate;
|
||||
|
||||
class QtMaterialFlatButton : public QPushButton
|
||||
class QT_MATERIAL_EXPORT QtMaterialFlatButton : public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QColor foregroundColor WRITE setForegroundColor READ foregroundColor)
|
||||
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
|
||||
Q_PROPERTY(QColor overlayColor WRITE setOverlayColor READ overlayColor)
|
||||
|
|
@ -18,20 +18,28 @@ class QtMaterialFlatButton : public QPushButton
|
|||
Q_PROPERTY(QColor disabledBackgroundColor WRITE setDisabledBackgroundColor READ disabledBackgroundColor)
|
||||
Q_PROPERTY(qreal fontSize WRITE setFontSize READ fontSize)
|
||||
|
||||
Q_PROPERTY(bool useThemeColors WRITE setUseThemeColors READ useThemeColors)
|
||||
Q_PROPERTY(bool haloVisible WRITE setHaloVisible READ isHaloVisible)
|
||||
Q_PROPERTY(MaterialConst::Role role WRITE setRole READ role)
|
||||
Q_PROPERTY(MaterialConst::OverlayStyle overlayStyle WRITE setOverlayStyle READ overlayStyle)
|
||||
Q_PROPERTY(MaterialConst::RippleStyle rippleStyle WRITE setRippleStyle READ rippleStyle)
|
||||
Q_PROPERTY(MaterialConst::ButtonIconPlacement iconPlacement WRITE setIconPlacement READ iconPlacement)
|
||||
Q_PROPERTY(qreal cornerRadius WRITE setCornerRadius READ cornerRadius)
|
||||
Q_PROPERTY(Qt::BGMode backgroundMode WRITE setBackgroundMode READ backgroundMode)
|
||||
Q_PROPERTY(qreal baseOpacity WRITE setBaseOpacity READ baseOpacity)
|
||||
Q_PROPERTY(bool checkable WRITE setCheckable)
|
||||
|
||||
public:
|
||||
explicit QtMaterialFlatButton(QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset);
|
||||
explicit QtMaterialFlatButton(const QString &text, QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset);
|
||||
QtMaterialFlatButton(const QString &text, Material::Role role, QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset);
|
||||
explicit QtMaterialFlatButton(QWidget *parent = 0, MaterialConst::ButtonPreset preset = MaterialConst::FlatPreset);
|
||||
explicit QtMaterialFlatButton(const QString &text, QWidget *parent = 0, MaterialConst::ButtonPreset preset = MaterialConst::FlatPreset);
|
||||
QtMaterialFlatButton(const QString &text, MaterialConst::Role role, QWidget *parent = 0, MaterialConst::ButtonPreset preset = MaterialConst::FlatPreset);
|
||||
~QtMaterialFlatButton();
|
||||
|
||||
void applyPreset(Material::ButtonPreset preset);
|
||||
void applyPreset(MaterialConst::ButtonPreset preset);
|
||||
|
||||
void setUseThemeColors(bool value);
|
||||
bool useThemeColors() const;
|
||||
|
||||
void setRole(Material::Role role);
|
||||
Material::Role role() const;
|
||||
|
||||
void setForegroundColor(const QColor &color);
|
||||
QColor foregroundColor() const;
|
||||
|
||||
|
|
@ -53,14 +61,17 @@ public:
|
|||
void setHaloVisible(bool visible);
|
||||
bool isHaloVisible() const;
|
||||
|
||||
void setOverlayStyle(Material::OverlayStyle style);
|
||||
Material::OverlayStyle overlayStyle() const;
|
||||
void setRole(MaterialConst::Role role);
|
||||
MaterialConst::Role role() const;
|
||||
|
||||
void setRippleStyle(Material::RippleStyle style);
|
||||
Material::RippleStyle rippleStyle() const;
|
||||
void setOverlayStyle(MaterialConst::OverlayStyle style);
|
||||
MaterialConst::OverlayStyle overlayStyle() const;
|
||||
|
||||
void setIconPlacement(Material::ButtonIconPlacement placement);
|
||||
Material::ButtonIconPlacement iconPlacement() const;
|
||||
void setRippleStyle(MaterialConst::RippleStyle style);
|
||||
MaterialConst::RippleStyle rippleStyle() const;
|
||||
|
||||
void setIconPlacement(MaterialConst::ButtonIconPlacement placement);
|
||||
MaterialConst::ButtonIconPlacement iconPlacement() const;
|
||||
|
||||
void setCornerRadius(qreal radius);
|
||||
qreal cornerRadius() const;
|
||||
|
|
@ -88,7 +99,7 @@ protected:
|
|||
IconPadding = 12
|
||||
};
|
||||
|
||||
QtMaterialFlatButton(QtMaterialFlatButtonPrivate &d, QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset);
|
||||
QtMaterialFlatButton(QtMaterialFlatButtonPrivate &d, QWidget *parent = 0, MaterialConst::ButtonPreset preset = MaterialConst::FlatPreset);
|
||||
|
||||
void checkStateSet() Q_DECL_OVERRIDE;
|
||||
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ public:
|
|||
QtMaterialFlatButton *const q_ptr;
|
||||
QtMaterialRippleOverlay *rippleOverlay;
|
||||
QtMaterialFlatButtonStateMachine *stateMachine;
|
||||
Material::Role role;
|
||||
Material::RippleStyle rippleStyle;
|
||||
Material::ButtonIconPlacement iconPlacement;
|
||||
Material::OverlayStyle overlayStyle;
|
||||
MaterialConst::Role role;
|
||||
MaterialConst::RippleStyle rippleStyle;
|
||||
MaterialConst::ButtonIconPlacement iconPlacement;
|
||||
MaterialConst::OverlayStyle overlayStyle;
|
||||
Qt::BGMode bgMode;
|
||||
Qt::Alignment textAlignment;
|
||||
QColor backgroundColor;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,12 @@ void QtMaterialIconButtonPrivate::updateRipple()
|
|||
/*!
|
||||
* \class QtMaterialIconButton
|
||||
*/
|
||||
QtMaterialIconButton::QtMaterialIconButton(QWidget *parent)
|
||||
: QAbstractButton(parent),
|
||||
d_ptr(new QtMaterialIconButtonPrivate(this))
|
||||
{
|
||||
d_func()->init();
|
||||
}
|
||||
|
||||
QtMaterialIconButton::QtMaterialIconButton(const QIcon &icon, QWidget *parent)
|
||||
: QAbstractButton(parent),
|
||||
|
|
|
|||
|
|
@ -2,14 +2,19 @@
|
|||
#define QTMATERIALICONBUTTON_H
|
||||
|
||||
#include <QtWidgets/QAbstractButton>
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialIconButtonPrivate;
|
||||
|
||||
class QtMaterialIconButton : public QAbstractButton
|
||||
class QT_MATERIAL_EXPORT QtMaterialIconButton : public QAbstractButton
|
||||
{
|
||||
Q_OBJECT
|
||||
// Q_PROPERTY(bool useThemeColors READ setUseThemeColors WRITE useThemeColors)
|
||||
// Q_PROPERTY(QColor color READ setColor WRITE color)
|
||||
// Q_PROPERTY(QColor disabledColor READ setDisabledColor WRITE disabledColor)
|
||||
|
||||
public:
|
||||
explicit QtMaterialIconButton(QWidget *parent = 0);
|
||||
explicit QtMaterialIconButton(const QIcon &icon, QWidget *parent = 0);
|
||||
~QtMaterialIconButton();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,73 @@
|
|||
#include "qtmaterialmenu.h"
|
||||
#include "qtmaterialmenu_p.h"
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QTime>
|
||||
#include <QTimer>
|
||||
|
||||
QtMaterialMenu::QtMaterialMenu(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
QTimer *timer = new QTimer(this);
|
||||
connect(timer, &QTimer::timeout, this, QOverload<>::of(&QWidget::update));
|
||||
timer->start(1000);
|
||||
|
||||
setWindowTitle(tr("Analog Clock"));
|
||||
resize(200, 200);
|
||||
}
|
||||
|
||||
QtMaterialMenu::~QtMaterialMenu()
|
||||
void QtMaterialMenu::paintEvent(QPaintEvent *)
|
||||
{
|
||||
static const QPoint hourHand[3] = {
|
||||
QPoint(7, 8),
|
||||
QPoint(-7, 8),
|
||||
QPoint(0, -40)
|
||||
};
|
||||
static const QPoint minuteHand[3] = {
|
||||
QPoint(7, 8),
|
||||
QPoint(-7, 8),
|
||||
QPoint(0, -70)
|
||||
};
|
||||
|
||||
QColor hourColor(127, 0, 127);
|
||||
QColor minuteColor(0, 127, 127, 191);
|
||||
|
||||
int side = qMin(width(), height());
|
||||
QTime time = QTime::currentTime();
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
painter.translate(width() / 2, height() / 2);
|
||||
painter.scale(side / 200.0, side / 200.0);
|
||||
|
||||
painter.setPen(Qt::NoPen);
|
||||
painter.setBrush(hourColor);
|
||||
|
||||
painter.save();
|
||||
painter.rotate(30.0 * ((time.hour() + time.minute() / 60.0)));
|
||||
painter.drawConvexPolygon(hourHand, 3);
|
||||
painter.restore();
|
||||
|
||||
painter.setPen(hourColor);
|
||||
|
||||
for (int i = 0; i < 12; ++i) {
|
||||
painter.drawLine(88, 0, 96, 0);
|
||||
painter.rotate(30.0);
|
||||
}
|
||||
|
||||
painter.setPen(Qt::NoPen);
|
||||
painter.setBrush(minuteColor);
|
||||
|
||||
painter.save();
|
||||
painter.rotate(6.0 * (time.minute() + time.second() / 60.0));
|
||||
painter.drawConvexPolygon(minuteHand, 3);
|
||||
painter.restore();
|
||||
|
||||
painter.setPen(minuteColor);
|
||||
|
||||
for (int j = 0; j < 60; ++j) {
|
||||
if ((j % 5) != 0)
|
||||
painter.drawLine(92, 0, 96, 0);
|
||||
painter.rotate(6.0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,18 @@
|
|||
#define QTMATERIALMENU_H
|
||||
|
||||
#include <QtWidgets/QWidget>
|
||||
#include "qtmaterial_global.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialMenu : public QWidget
|
||||
class QT_MATERIAL_EXPORT QtMaterialMenu : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QtMaterialMenu(QWidget *parent = 0);
|
||||
~QtMaterialMenu();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
};
|
||||
|
||||
#endif // QTMATERIALMENU_H
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ void QtMaterialProgressPrivate::init()
|
|||
Q_Q(QtMaterialProgress);
|
||||
|
||||
delegate = new QtMaterialProgressDelegate(q);
|
||||
progressType = Material::IndeterminateProgress;
|
||||
progressType = MaterialConst::IndeterminateProgress;
|
||||
useThemeColors = true;
|
||||
|
||||
QPropertyAnimation *animation;
|
||||
|
|
@ -57,7 +57,7 @@ QtMaterialProgress::~QtMaterialProgress()
|
|||
{
|
||||
}
|
||||
|
||||
void QtMaterialProgress::setProgressType(Material::ProgressType type)
|
||||
void QtMaterialProgress::setProgressType(MaterialConst::ProgressType type)
|
||||
{
|
||||
Q_D(QtMaterialProgress);
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ void QtMaterialProgress::setProgressType(Material::ProgressType type)
|
|||
update();
|
||||
}
|
||||
|
||||
Material::ProgressType QtMaterialProgress::progressType() const
|
||||
MaterialConst::ProgressType QtMaterialProgress::progressType() const
|
||||
{
|
||||
Q_D(const QtMaterialProgress);
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ void QtMaterialProgress::paintEvent(QPaintEvent *event)
|
|||
brush.setColor(progressColor());
|
||||
painter.setBrush(brush);
|
||||
|
||||
if (Material::IndeterminateProgress == d->progressType) {
|
||||
if (MaterialConst::IndeterminateProgress == d->progressType) {
|
||||
painter.drawRect(d->delegate->offset()*width()*2-width(), 0, width(), height());
|
||||
} else {
|
||||
qreal p = static_cast<qreal>(width())*(value()-minimum())/(maximum()-minimum());
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@
|
|||
|
||||
#include <QtWidgets/QProgressBar>
|
||||
#include "lib/qtmaterialtheme.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialProgressPrivate;
|
||||
|
||||
class QtMaterialProgress : public QProgressBar
|
||||
class QT_MATERIAL_EXPORT QtMaterialProgress : public QProgressBar
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -17,8 +18,8 @@ public:
|
|||
explicit QtMaterialProgress(QWidget *parent = 0);
|
||||
~QtMaterialProgress();
|
||||
|
||||
void setProgressType(Material::ProgressType type);
|
||||
Material::ProgressType progressType() const;
|
||||
void setProgressType(MaterialConst::ProgressType type);
|
||||
MaterialConst::ProgressType progressType() const;
|
||||
|
||||
void setUseThemeColors(bool state);
|
||||
bool useThemeColors() const;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public:
|
|||
|
||||
QtMaterialProgress *const q_ptr;
|
||||
QtMaterialProgressDelegate *delegate;
|
||||
Material::ProgressType progressType;
|
||||
MaterialConst::ProgressType progressType;
|
||||
QColor progressColor;
|
||||
QColor backgroundColor;
|
||||
bool useThemeColors;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
#define QTMATERIALRADIOBUTTON_H
|
||||
|
||||
#include "lib/qtmaterialcheckable.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialRadioButtonPrivate;
|
||||
|
||||
class QtMaterialRadioButton : public QtMaterialCheckable
|
||||
class QT_MATERIAL_EXPORT QtMaterialRadioButton : public QtMaterialCheckable
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
#define QTMATERIALRAISEDBUTTON_H
|
||||
|
||||
#include "qtmaterialflatbutton.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialRaisedButtonPrivate;
|
||||
|
||||
class QtMaterialRaisedButton : public QtMaterialFlatButton
|
||||
class QT_MATERIAL_EXPORT QtMaterialRaisedButton : public QtMaterialFlatButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -2,16 +2,19 @@
|
|||
#define QTMATERIALSCROLLBAR_H
|
||||
|
||||
#include <QtWidgets/QScrollBar>
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialScrollBarPrivate;
|
||||
|
||||
class QtMaterialScrollBar : public QScrollBar
|
||||
class QT_MATERIAL_EXPORT QtMaterialScrollBar : public QScrollBar
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(bool useThemeColors WRITE setUseThemeColors READ useThemeColors)
|
||||
Q_PROPERTY(QColor canvasColor WRITE setCanvasColor READ canvasColor)
|
||||
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
|
||||
Q_PROPERTY(QColor sliderColor WRITE setSliderColor READ sliderColor)
|
||||
Q_PROPERTY(bool hideOnMouseOut WRITE setHideOnMouseOut READ hideOnMouseOut)
|
||||
|
||||
public:
|
||||
explicit QtMaterialScrollBar(QWidget *parent = 0);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ void QtMaterialSliderPrivate::init()
|
|||
stateMachine = new QtMaterialSliderStateMachine(q, thumb, track);
|
||||
stepTo = 0;
|
||||
oldValue = q->value();
|
||||
trackWidth = 2;
|
||||
trackWidth = 4;
|
||||
hoverTrack = false;
|
||||
hoverThumb = false;
|
||||
hover = false;
|
||||
|
|
|
|||
|
|
@ -3,18 +3,22 @@
|
|||
|
||||
#include <QtWidgets/QAbstractSlider>
|
||||
#include <QScopedPointer>
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
#define QT_MATERIAL_SLIDER_MARGIN 30
|
||||
#define QT_MATERIAL_SLIDER_MARGIN 10
|
||||
|
||||
class QtMaterialSliderPrivate;
|
||||
|
||||
class QtMaterialSlider : public QAbstractSlider
|
||||
class QT_MATERIAL_EXPORT QtMaterialSlider : public QAbstractSlider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(bool useThemeColors WRITE setUseThemeColors READ useThemeColors)
|
||||
Q_PROPERTY(QColor thumbColor WRITE setThumbColor READ thumbColor)
|
||||
Q_PROPERTY(QColor trackColor WRITE setTrackColor READ trackColor)
|
||||
Q_PROPERTY(QColor disabledColor WRITE setDisabledColor READ disabledColor)
|
||||
Q_PROPERTY(bool pageStepMode WRITE setPageStepMode READ pageStepMode)
|
||||
Q_PROPERTY(bool invertedAppearance WRITE setInvertedAppearance)
|
||||
|
||||
public:
|
||||
explicit QtMaterialSlider(QWidget *parent = 0);
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ QtMaterialSliderStateMachine::QtMaterialSliderStateMachine(
|
|||
m_pulseOutState->assignProperty(thumb, "haloSize", 35);
|
||||
m_pulseInState->assignProperty(thumb, "haloSize", 28);
|
||||
|
||||
m_inactiveState->assignProperty(thumb, "diameter", 11);
|
||||
m_focusState->assignProperty(thumb, "diameter", 11);
|
||||
m_slidingState->assignProperty(thumb, "diameter", 17);
|
||||
m_inactiveState->assignProperty(thumb, "diameter", 15);
|
||||
m_focusState->assignProperty(thumb, "diameter", 15);
|
||||
m_slidingState->assignProperty(thumb, "diameter", 20);
|
||||
|
||||
QAbstractTransition *transition;
|
||||
QtMaterialStateTransition *customTransition;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
#define QTMATERIALSNACKBAR_H
|
||||
|
||||
#include "lib/qtmaterialoverlaywidget.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialSnackbarPrivate;
|
||||
|
||||
class QtMaterialSnackbar : public QtMaterialOverlayWidget
|
||||
class QT_MATERIAL_EXPORT QtMaterialSnackbar : public QtMaterialOverlayWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ void QtMaterialTabsPrivate::QtMaterialTabsPrivate::init()
|
|||
|
||||
inkBar = new QtMaterialTabsInkBar(q);
|
||||
tabLayout = new QHBoxLayout;
|
||||
rippleStyle = Material::CenteredRipple;
|
||||
rippleStyle = MaterialConst::CenteredRipple;
|
||||
tab = -1;
|
||||
showHalo = true;
|
||||
useThemeColors = true;
|
||||
|
|
@ -80,7 +80,7 @@ bool QtMaterialTabs::isHaloVisible() const
|
|||
return d->showHalo;
|
||||
}
|
||||
|
||||
void QtMaterialTabs::setRippleStyle(Material::RippleStyle style)
|
||||
void QtMaterialTabs::setRippleStyle(MaterialConst::RippleStyle style)
|
||||
{
|
||||
Q_D(QtMaterialTabs);
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ void QtMaterialTabs::setRippleStyle(Material::RippleStyle style)
|
|||
updateTabs();
|
||||
}
|
||||
|
||||
Material::RippleStyle QtMaterialTabs::rippleStyle() const
|
||||
MaterialConst::RippleStyle QtMaterialTabs::rippleStyle() const
|
||||
{
|
||||
Q_D(const QtMaterialTabs);
|
||||
|
||||
|
|
@ -180,6 +180,42 @@ void QtMaterialTabs::setCurrentTab(int index)
|
|||
emit currentChanged(index);
|
||||
}
|
||||
|
||||
void QtMaterialTabs::setTabText(int index, const QString &text)
|
||||
{
|
||||
Q_D(QtMaterialTabs);
|
||||
|
||||
if (index > -1) {
|
||||
QtMaterialTab *tab = static_cast<QtMaterialTab *>(d->tabLayout->itemAt(index)->widget());
|
||||
if (tab) {
|
||||
tab->setText(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QtMaterialTabs::insertTab(int index, const QString &text, const QIcon &icon)
|
||||
{
|
||||
Q_D(QtMaterialTabs);
|
||||
|
||||
QtMaterialTab *tab = new QtMaterialTab(this);
|
||||
tab->setText(text);
|
||||
tab->setHaloVisible(isHaloVisible());
|
||||
tab->setRippleStyle(rippleStyle());
|
||||
|
||||
if (!icon.isNull()) {
|
||||
tab->setIcon(icon);
|
||||
tab->setIconSize(QSize(22, 22));
|
||||
}
|
||||
|
||||
d->tabLayout->insertWidget(index, tab);
|
||||
|
||||
if (-1 == d->tab) {
|
||||
d->tab = 0;
|
||||
d->inkBar->refreshGeometry();
|
||||
d->inkBar->raise();
|
||||
tab->setActive(true);
|
||||
};
|
||||
}
|
||||
|
||||
void QtMaterialTabs::addTab(const QString &text, const QIcon &icon)
|
||||
{
|
||||
Q_D(QtMaterialTabs);
|
||||
|
|
@ -204,6 +240,27 @@ void QtMaterialTabs::addTab(const QString &text, const QIcon &icon)
|
|||
}
|
||||
}
|
||||
|
||||
void QtMaterialTabs::removeTab(int index)
|
||||
{
|
||||
Q_D(QtMaterialTabs);
|
||||
|
||||
if (index > -1) {
|
||||
QtMaterialTab *tab = static_cast<QtMaterialTab *>(d->tabLayout->itemAt(index)->widget());
|
||||
if (tab) {
|
||||
d->tabLayout->removeWidget(tab);
|
||||
delete tab;
|
||||
}
|
||||
|
||||
setCurrentTab(index - 1);
|
||||
}
|
||||
}
|
||||
|
||||
int QtMaterialTabs::count() const
|
||||
{
|
||||
Q_D(const QtMaterialTabs);
|
||||
return d->tabLayout->count();
|
||||
}
|
||||
|
||||
int QtMaterialTabs::currentIndex() const
|
||||
{
|
||||
Q_D(const QtMaterialTabs);
|
||||
|
|
|
|||
|
|
@ -4,13 +4,19 @@
|
|||
#include <QtWidgets/QWidget>
|
||||
#include <QIcon>
|
||||
#include "lib/qtmaterialtheme.h"
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialTabsPrivate;
|
||||
class QtMaterialTab;
|
||||
|
||||
class QtMaterialTabs : public QWidget
|
||||
class QT_MATERIAL_EXPORT QtMaterialTabs : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool haloVisible WRITE setHaloVisible READ isHaloVisible)
|
||||
Q_PROPERTY(MaterialConst::RippleStyle rippleStyle WRITE setRippleStyle READ rippleStyle)
|
||||
Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor)
|
||||
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
|
||||
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
|
||||
|
||||
public:
|
||||
explicit QtMaterialTabs(QWidget *parent = 0);
|
||||
|
|
@ -22,8 +28,8 @@ public:
|
|||
void setHaloVisible(bool value);
|
||||
bool isHaloVisible() const;
|
||||
|
||||
void setRippleStyle(Material::RippleStyle style);
|
||||
Material::RippleStyle rippleStyle() const;
|
||||
void setRippleStyle(MaterialConst::RippleStyle style);
|
||||
MaterialConst::RippleStyle rippleStyle() const;
|
||||
|
||||
void setInkColor(const QColor &color);
|
||||
QColor inkColor() const;
|
||||
|
|
@ -34,14 +40,18 @@ public:
|
|||
void setTextColor(const QColor &color);
|
||||
QColor textColor() const;
|
||||
|
||||
void insertTab(int index, const QString &text, const QIcon &icon = QIcon());
|
||||
void addTab(const QString &text, const QIcon &icon = QIcon());
|
||||
void removeTab(int index);
|
||||
int count() const;
|
||||
|
||||
void setCurrentTab(QtMaterialTab *tab);
|
||||
void setCurrentTab(int index);
|
||||
void setTabText(int index, const QString &text);
|
||||
|
||||
int currentIndex() const;
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void currentChanged(int);
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@ void QtMaterialTabsInkBar::refreshGeometry()
|
|||
const qreal s = 1-m_tween;
|
||||
|
||||
if (QAbstractAnimation::Running != m_animation->state()) {
|
||||
m_geometry = QRect(r.left(), r.bottom()-1, r.width(), 2);
|
||||
m_geometry = QRect(r.left(), r.bottom()-1, r.width(), 4);
|
||||
} else {
|
||||
const qreal left = m_previousGeometry.left()*s + r.left()*m_tween;
|
||||
const qreal width = m_previousGeometry.width()*s + r.width()*m_tween;
|
||||
m_geometry = QRect(left, r.bottom()-1, width, 2);
|
||||
m_geometry = QRect(left, r.bottom()-1, width, 4);
|
||||
}
|
||||
m_tabs->update();
|
||||
}
|
||||
|
|
@ -112,7 +112,7 @@ QtMaterialTab::QtMaterialTab(QtMaterialTabs *parent)
|
|||
setFont(f);
|
||||
|
||||
setCornerRadius(0);
|
||||
setRole(Material::Primary);
|
||||
setRole(MaterialConst::Primary);
|
||||
setBackgroundMode(Qt::OpaqueMode);
|
||||
setBaseOpacity(0.25);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public:
|
|||
QtMaterialTabs *const q_ptr;
|
||||
QtMaterialTabsInkBar *inkBar;
|
||||
QHBoxLayout *tabLayout;
|
||||
Material::RippleStyle rippleStyle;
|
||||
MaterialConst::RippleStyle rippleStyle;
|
||||
QColor inkColor;
|
||||
QColor backgroundColor;
|
||||
QColor textColor;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,149 @@
|
|||
#include "qtmaterialtabwidget.h"
|
||||
#include <QStackedWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <qtmaterialtabs.h>
|
||||
|
||||
QtMaterialTabWidget::QtMaterialTabWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, tabBar(new QtMaterialTabs)
|
||||
, stackWidget(new QStackedWidget)
|
||||
{
|
||||
tabBar->setObjectName(QStringLiteral("__qt__passive_tabBar"));
|
||||
tabBar->setHaloVisible(false);
|
||||
|
||||
connect(tabBar, QOverload<int>::of(&QtMaterialTabs::currentChanged),
|
||||
this, &QtMaterialTabWidget::setCurrentIndex);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->addWidget(tabBar);
|
||||
layout->addWidget(stackWidget);
|
||||
}
|
||||
|
||||
void QtMaterialTabWidget::setHaloVisible(bool value)
|
||||
{
|
||||
tabBar->setHaloVisible(value);
|
||||
}
|
||||
|
||||
bool QtMaterialTabWidget::isHaloVisible() const
|
||||
{
|
||||
return tabBar->isHaloVisible();
|
||||
}
|
||||
|
||||
void QtMaterialTabWidget::setRippleStyle(MaterialConst::RippleStyle style)
|
||||
{
|
||||
tabBar->setRippleStyle(style);
|
||||
}
|
||||
|
||||
MaterialConst::RippleStyle QtMaterialTabWidget::rippleStyle() const
|
||||
{
|
||||
return tabBar->rippleStyle();
|
||||
}
|
||||
|
||||
void QtMaterialTabWidget::setInkColor(const QColor &color)
|
||||
{
|
||||
tabBar->setInkColor(color);
|
||||
}
|
||||
|
||||
QColor QtMaterialTabWidget::inkColor() const
|
||||
{
|
||||
return tabBar->inkColor();
|
||||
}
|
||||
|
||||
void QtMaterialTabWidget::setBackgroundColor(const QColor &color)
|
||||
{
|
||||
tabBar->setBackgroundColor(color);
|
||||
}
|
||||
|
||||
QColor QtMaterialTabWidget::backgroundColor() const
|
||||
{
|
||||
return tabBar->backgroundColor();
|
||||
}
|
||||
|
||||
void QtMaterialTabWidget::setTextColor(const QColor &color)
|
||||
{
|
||||
tabBar->setTextColor(color);
|
||||
}
|
||||
|
||||
QColor QtMaterialTabWidget::textColor() const
|
||||
{
|
||||
return tabBar->textColor();
|
||||
}
|
||||
|
||||
QSize QtMaterialTabWidget::sizeHint() const
|
||||
{
|
||||
return QSize(300, 200);
|
||||
}
|
||||
|
||||
void QtMaterialTabWidget::addPage(QWidget *page)
|
||||
{
|
||||
insertPage(count(), page);
|
||||
}
|
||||
|
||||
void QtMaterialTabWidget::removePage(int index)
|
||||
{
|
||||
QWidget *widget = stackWidget->widget(index);
|
||||
stackWidget->removeWidget(widget);
|
||||
|
||||
tabBar->removeTab(index);
|
||||
}
|
||||
|
||||
int QtMaterialTabWidget::count() const
|
||||
{
|
||||
return stackWidget->count();
|
||||
}
|
||||
|
||||
int QtMaterialTabWidget::currentIndex() const
|
||||
{
|
||||
return stackWidget->currentIndex();
|
||||
}
|
||||
|
||||
void QtMaterialTabWidget::insertPage(int index, QWidget *page)
|
||||
{
|
||||
page->setParent(stackWidget);
|
||||
|
||||
stackWidget->insertWidget(index, page);
|
||||
|
||||
QString title = page->windowTitle();
|
||||
if (title.isEmpty()) {
|
||||
title = tr("Tab %1").arg(tabBar->count() + 1);
|
||||
page->setWindowTitle(title);
|
||||
}
|
||||
connect(page, &QWidget::windowTitleChanged,
|
||||
this, &QtMaterialTabWidget::pageWindowTitleChanged);
|
||||
tabBar->insertTab(index, title);
|
||||
}
|
||||
|
||||
void QtMaterialTabWidget::setCurrentIndex(int index)
|
||||
{
|
||||
if (index != currentIndex()) {
|
||||
stackWidget->setCurrentIndex(index);
|
||||
tabBar->setCurrentTab(index);
|
||||
emit currentIndexChanged(index);
|
||||
}
|
||||
}
|
||||
|
||||
void QtMaterialTabWidget::pageWindowTitleChanged()
|
||||
{
|
||||
QWidget *page = qobject_cast<QWidget *>(sender());
|
||||
const int index = stackWidget->indexOf(page);
|
||||
tabBar->setTabText(index, page->windowTitle());
|
||||
}
|
||||
|
||||
QWidget* QtMaterialTabWidget::widget(int index)
|
||||
{
|
||||
return stackWidget->widget(index);
|
||||
}
|
||||
|
||||
QString QtMaterialTabWidget::pageTitle() const
|
||||
{
|
||||
if (const QWidget *currentWidget = stackWidget->currentWidget())
|
||||
return currentWidget->windowTitle();
|
||||
return QString();
|
||||
}
|
||||
|
||||
void QtMaterialTabWidget::setPageTitle(QString const &newTitle)
|
||||
{
|
||||
if (QWidget *currentWidget = stackWidget->currentWidget())
|
||||
currentWidget->setWindowTitle(newTitle);
|
||||
emit pageTitleChanged(newTitle);
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
#ifndef QTMATERIALTABWIDGET_H
|
||||
#define QTMATERIALTABWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "qtmaterial_global.h"
|
||||
#include "lib/qtmaterialtheme.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QStackedWidget;
|
||||
QT_END_NAMESPACE
|
||||
class QtMaterialTabs;
|
||||
|
||||
class QT_MATERIAL_EXPORT QtMaterialTabWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex)
|
||||
Q_PROPERTY(QString pageTitle READ pageTitle WRITE setPageTitle STORED false)
|
||||
Q_PROPERTY(bool haloVisible WRITE setHaloVisible READ isHaloVisible)
|
||||
Q_PROPERTY(MaterialConst::RippleStyle rippleStyle WRITE setRippleStyle READ rippleStyle)
|
||||
Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor)
|
||||
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
|
||||
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
|
||||
|
||||
public:
|
||||
explicit QtMaterialTabWidget(QWidget *parent = nullptr);
|
||||
|
||||
void setHaloVisible(bool value);
|
||||
bool isHaloVisible() const;
|
||||
|
||||
void setRippleStyle(MaterialConst::RippleStyle style);
|
||||
MaterialConst::RippleStyle rippleStyle() const;
|
||||
|
||||
void setInkColor(const QColor &color);
|
||||
QColor inkColor() const;
|
||||
|
||||
void setBackgroundColor(const QColor &color);
|
||||
QColor backgroundColor() const;
|
||||
|
||||
void setTextColor(const QColor &color);
|
||||
QColor textColor() const;
|
||||
|
||||
QSize sizeHint() const override;
|
||||
|
||||
int count() const;
|
||||
int currentIndex() const;
|
||||
QWidget *widget(int index);
|
||||
QString pageTitle() const;
|
||||
|
||||
public slots:
|
||||
void addPage(QWidget *page);
|
||||
void insertPage(int index, QWidget *page);
|
||||
void removePage(int index);
|
||||
void setPageTitle(QString const &newTitle);
|
||||
void setCurrentIndex(int index);
|
||||
|
||||
private slots:
|
||||
void pageWindowTitleChanged();
|
||||
|
||||
signals:
|
||||
void currentIndexChanged(int index);
|
||||
void pageTitleChanged(const QString &title);
|
||||
|
||||
private:
|
||||
QtMaterialTabs *tabBar;
|
||||
QStackedWidget *stackWidget;
|
||||
};
|
||||
|
||||
#endif // QTMATERIALTABWIDGET_H
|
||||
|
|
@ -56,6 +56,7 @@ QtMaterialTextField::QtMaterialTextField(QWidget *parent)
|
|||
|
||||
QtMaterialTextField::~QtMaterialTextField()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void QtMaterialTextField::setUseThemeColors(bool value)
|
||||
|
|
|
|||
|
|
@ -3,16 +3,23 @@
|
|||
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include <QColor>
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialTextFieldPrivate;
|
||||
|
||||
class QtMaterialTextField : public QLineEdit
|
||||
class QT_MATERIAL_EXPORT QtMaterialTextField : public QLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(bool useThemeColors WRITE setUseThemeColors READ useThemeColors)
|
||||
Q_PROPERTY(bool showLabel WRITE setShowLabel READ hasLabel)
|
||||
Q_PROPERTY(QString label WRITE setLabel READ label)
|
||||
Q_PROPERTY(qreal labelFontSize WRITE setLabelFontSize READ labelFontSize)
|
||||
Q_PROPERTY(QColor labelColor WRITE setLabelColor READ labelColor)
|
||||
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
|
||||
Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor)
|
||||
Q_PROPERTY(QColor inputLineColor WRITE setInputLineColor READ inputLineColor)
|
||||
Q_PROPERTY(bool showInputLine WRITE setShowInputLine READ hasInputLine)
|
||||
|
||||
public:
|
||||
explicit QtMaterialTextField(QWidget *parent = 0);
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ QtMaterialToggle::QtMaterialToggle(QWidget *parent)
|
|||
|
||||
QtMaterialToggle::~QtMaterialToggle()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void QtMaterialToggle::setUseThemeColors(bool value)
|
||||
|
|
|
|||
|
|
@ -2,17 +2,20 @@
|
|||
#define QTMATERIALTOGGLE_H
|
||||
|
||||
#include <QtWidgets/QAbstractButton>
|
||||
#include "qtmaterial_global.h"
|
||||
|
||||
class QtMaterialTogglePrivate;
|
||||
|
||||
class QtMaterialToggle : public QAbstractButton
|
||||
class QT_MATERIAL_EXPORT QtMaterialToggle : public QAbstractButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(bool useThemeColors WRITE setUseThemeColors READ useThemeColors)
|
||||
Q_PROPERTY(QColor disabledColor WRITE setDisabledColor READ disabledColor)
|
||||
Q_PROPERTY(QColor activeColor WRITE setActiveColor READ activeColor)
|
||||
Q_PROPERTY(QColor inactiveColor WRITE setInactiveColor READ inactiveColor)
|
||||
Q_PROPERTY(QColor trackColor WRITE setTrackColor READ trackColor)
|
||||
Q_PROPERTY(Qt::Orientation orientation WRITE setOrientation READ orientation)
|
||||
|
||||
public:
|
||||
explicit QtMaterialToggle(QWidget *parent = 0);
|
||||
|
|
|
|||
|
|
@ -47,13 +47,13 @@ void AvatarSettingsEditor::setupForm()
|
|||
{
|
||||
switch (m_avatar->type())
|
||||
{
|
||||
case Material::LetterAvatar:
|
||||
case MaterialConst::LetterAvatar:
|
||||
ui->typeComboBox->setCurrentIndex(0);
|
||||
break;
|
||||
case Material::ImageAvatar:
|
||||
case MaterialConst::ImageAvatar:
|
||||
ui->typeComboBox->setCurrentIndex(1);
|
||||
break;
|
||||
case Material::IconAvatar:
|
||||
case MaterialConst::IconAvatar:
|
||||
ui->typeComboBox->setCurrentIndex(2);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -49,10 +49,10 @@ void CircularProgressSettingsEditor::setupForm()
|
|||
{
|
||||
switch (m_progress->progressType())
|
||||
{
|
||||
case Material::DeterminateProgress:
|
||||
case MaterialConst::DeterminateProgress:
|
||||
ui->progressTypeComboBox->setCurrentIndex(0);
|
||||
break;
|
||||
case Material::IndeterminateProgress:
|
||||
case MaterialConst::IndeterminateProgress:
|
||||
ui->progressTypeComboBox->setCurrentIndex(1);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -71,10 +71,10 @@ void CircularProgressSettingsEditor::updateWidget()
|
|||
switch (ui->progressTypeComboBox->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
m_progress->setProgressType(Material::DeterminateProgress);
|
||||
m_progress->setProgressType(MaterialConst::DeterminateProgress);
|
||||
break;
|
||||
case 1:
|
||||
m_progress->setProgressType(Material::IndeterminateProgress);
|
||||
m_progress->setProgressType(MaterialConst::IndeterminateProgress);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
QT += core gui widgets
|
||||
TEMPLATE = app
|
||||
CONFIG += c++11
|
||||
SOURCES = mainwindow.cpp \
|
||||
|
||||
TARGET = examples-exe
|
||||
|
||||
SOURCES += mainwindow.cpp \
|
||||
main.cpp \
|
||||
avatarsettingseditor.cpp \
|
||||
badgesettingseditor.cpp \
|
||||
checkboxsettingseditor.cpp \
|
||||
fabsettingseditor.cpp \
|
||||
plugindemoform.cpp \
|
||||
raisedbuttonsettingseditor.cpp \
|
||||
flatbuttonsettingseditor.cpp \
|
||||
iconbuttonsettingseditor.cpp \
|
||||
|
|
@ -24,11 +28,12 @@ SOURCES = mainwindow.cpp \
|
|||
appbarsettingseditor.cpp \
|
||||
autocompletesettingseditor.cpp \
|
||||
menusettingseditor.cpp
|
||||
HEADERS = mainwindow.h \
|
||||
HEADERS += mainwindow.h \
|
||||
avatarsettingseditor.h \
|
||||
badgesettingseditor.h \
|
||||
checkboxsettingseditor.h \
|
||||
fabsettingseditor.h \
|
||||
plugindemoform.h \
|
||||
raisedbuttonsettingseditor.h \
|
||||
flatbuttonsettingseditor.h \
|
||||
iconbuttonsettingseditor.h \
|
||||
|
|
@ -46,13 +51,6 @@ HEADERS = mainwindow.h \
|
|||
appbarsettingseditor.h \
|
||||
autocompletesettingseditor.h \
|
||||
menusettingseditor.h
|
||||
LIBS += $$top_builddir/components/$(OBJECTS_DIR)/libcomponents.a
|
||||
INCLUDEPATH += $$top_srcdir/components/
|
||||
TARGET = examples-exe
|
||||
PRE_TARGETDEPS += $$top_builddir/components/$(OBJECTS_DIR)/libcomponents.a
|
||||
|
||||
RESOURCES += \
|
||||
examples.qrc
|
||||
|
||||
FORMS += \
|
||||
avatarsettingsform.ui \
|
||||
|
|
@ -61,6 +59,7 @@ FORMS += \
|
|||
fabsettingsform.ui \
|
||||
flatbuttonsettingsform.ui \
|
||||
iconbuttonsettingsform.ui \
|
||||
plugindemoform.ui \
|
||||
progresssettingsform.ui \
|
||||
circularprogresssettingsform.ui \
|
||||
slidersettingsform.ui \
|
||||
|
|
@ -68,8 +67,25 @@ FORMS += \
|
|||
radiobuttonsettingsform.ui \
|
||||
togglesettingsform.ui \
|
||||
textfieldsettingsform.ui \
|
||||
tabssettingsform.ui \
|
||||
dialogsettingsform.ui \
|
||||
drawersettingsform.ui \
|
||||
scrollbarsettingsform.ui \
|
||||
appbarsettingsform.ui
|
||||
appbarsettingsform.ui \
|
||||
tabssettingsform.ui
|
||||
|
||||
RESOURCES += \
|
||||
../components/material_res.qrc \
|
||||
examples.qrc
|
||||
|
||||
OBJECTS_DIR = $$PWD/../../qt-material-widgets-build/examples/build/obj
|
||||
MOC_DIR = $$PWD/../../qt-material-widgets-build/examples/build/moc
|
||||
RCC_DIR = $$PWD/../../qt-material-widgets-build/examples/build/qrc
|
||||
UI_DIR = $$PWD/../../qt-material-widgets-build/examples/build/ui
|
||||
DESTDIR = $$PWD/../../qt-material-widgets-build/examples/bin
|
||||
|
||||
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../qt-material-widgets-build/components/lib/ -lqt-material-widget
|
||||
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../qt-material-widgets-build/components/lib/ -lqt-material-widgetd
|
||||
else:unix:!macx: LIBS += -L$$PWD/../../qt-material-widgets-build/components/lib/ -lqt-material-widget
|
||||
|
||||
INCLUDEPATH += $$PWD/../components
|
||||
DEPENDPATH += $$PWD/../../qt-material-widgets-build/components
|
||||
|
|
|
|||
|
|
@ -49,13 +49,13 @@ void FloatingActionButtonSettingsEditor::setupForm()
|
|||
{
|
||||
switch (m_fab->role())
|
||||
{
|
||||
case Material::Default:
|
||||
case MaterialConst::Default:
|
||||
ui->buttonRoleComboBox->setCurrentIndex(0);
|
||||
break;
|
||||
case Material::Primary:
|
||||
case MaterialConst::Primary:
|
||||
ui->buttonRoleComboBox->setCurrentIndex(1);
|
||||
break;
|
||||
case Material::Secondary:
|
||||
case MaterialConst::Secondary:
|
||||
ui->buttonRoleComboBox->setCurrentIndex(2);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -82,13 +82,13 @@ void FloatingActionButtonSettingsEditor::setupForm()
|
|||
|
||||
switch (m_fab->rippleStyle())
|
||||
{
|
||||
case Material::CenteredRipple:
|
||||
case MaterialConst::CenteredRipple:
|
||||
ui->rippleStyleComboBox->setCurrentIndex(0);
|
||||
break;
|
||||
case Material::PositionedRipple:
|
||||
case MaterialConst::PositionedRipple:
|
||||
ui->rippleStyleComboBox->setCurrentIndex(1);
|
||||
break;
|
||||
case Material::NoRipple:
|
||||
case MaterialConst::NoRipple:
|
||||
ui->rippleStyleComboBox->setCurrentIndex(2);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -107,13 +107,13 @@ void FloatingActionButtonSettingsEditor::updateWidget()
|
|||
switch (ui->buttonRoleComboBox->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
m_fab->setRole(Material::Default);
|
||||
m_fab->setRole(MaterialConst::Default);
|
||||
break;
|
||||
case 1:
|
||||
m_fab->setRole(Material::Primary);
|
||||
m_fab->setRole(MaterialConst::Primary);
|
||||
break;
|
||||
case 2:
|
||||
m_fab->setRole(Material::Secondary);
|
||||
m_fab->setRole(MaterialConst::Secondary);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -140,13 +140,13 @@ void FloatingActionButtonSettingsEditor::updateWidget()
|
|||
switch (ui->rippleStyleComboBox->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
m_fab->setRippleStyle(Material::CenteredRipple);
|
||||
m_fab->setRippleStyle(MaterialConst::CenteredRipple);
|
||||
break;
|
||||
case 1:
|
||||
m_fab->setRippleStyle(Material::PositionedRipple);
|
||||
m_fab->setRippleStyle(MaterialConst::PositionedRipple);
|
||||
break;
|
||||
case 2:
|
||||
m_fab->setRippleStyle(Material::NoRipple);
|
||||
m_fab->setRippleStyle(MaterialConst::NoRipple);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -28,13 +28,13 @@ void FlatButtonSettingsEditor::setupForm()
|
|||
{
|
||||
switch (m_button->role())
|
||||
{
|
||||
case Material::Default:
|
||||
case MaterialConst::Default:
|
||||
ui->buttonRoleComboBox->setCurrentIndex(0);
|
||||
break;
|
||||
case Material::Primary:
|
||||
case MaterialConst::Primary:
|
||||
ui->buttonRoleComboBox->setCurrentIndex(1);
|
||||
break;
|
||||
case Material::Secondary:
|
||||
case MaterialConst::Secondary:
|
||||
ui->buttonRoleComboBox->setCurrentIndex(2);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -43,13 +43,13 @@ void FlatButtonSettingsEditor::setupForm()
|
|||
|
||||
switch (m_button->overlayStyle())
|
||||
{
|
||||
case Material::NoOverlay:
|
||||
case MaterialConst::NoOverlay:
|
||||
ui->hoverStyleComboBox->setCurrentIndex(0);
|
||||
break;
|
||||
case Material::TintedOverlay:
|
||||
case MaterialConst::TintedOverlay:
|
||||
ui->hoverStyleComboBox->setCurrentIndex(1);
|
||||
break;
|
||||
case Material::GrayOverlay:
|
||||
case MaterialConst::GrayOverlay:
|
||||
ui->hoverStyleComboBox->setCurrentIndex(2);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -58,13 +58,13 @@ void FlatButtonSettingsEditor::setupForm()
|
|||
|
||||
switch (m_button->rippleStyle())
|
||||
{
|
||||
case Material::CenteredRipple:
|
||||
case MaterialConst::CenteredRipple:
|
||||
ui->rippleStyleComboBox->setCurrentIndex(0);
|
||||
break;
|
||||
case Material::PositionedRipple:
|
||||
case MaterialConst::PositionedRipple:
|
||||
ui->rippleStyleComboBox->setCurrentIndex(1);
|
||||
break;
|
||||
case Material::NoRipple:
|
||||
case MaterialConst::NoRipple:
|
||||
ui->rippleStyleComboBox->setCurrentIndex(2);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -73,10 +73,10 @@ void FlatButtonSettingsEditor::setupForm()
|
|||
|
||||
switch (m_button->iconPlacement())
|
||||
{
|
||||
case Material::LeftIcon:
|
||||
case MaterialConst::LeftIcon:
|
||||
ui->iconPlacementComboBox->setCurrentIndex(0);
|
||||
break;
|
||||
case Material::RightIcon:
|
||||
case MaterialConst::RightIcon:
|
||||
ui->iconPlacementComboBox->setCurrentIndex(1);
|
||||
break;
|
||||
}
|
||||
|
|
@ -111,13 +111,13 @@ void FlatButtonSettingsEditor::updateWidget()
|
|||
switch (ui->buttonRoleComboBox->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
m_button->setRole(Material::Default);
|
||||
m_button->setRole(MaterialConst::Default);
|
||||
break;
|
||||
case 1:
|
||||
m_button->setRole(Material::Primary);
|
||||
m_button->setRole(MaterialConst::Primary);
|
||||
break;
|
||||
case 2:
|
||||
m_button->setRole(Material::Secondary);
|
||||
m_button->setRole(MaterialConst::Secondary);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -126,13 +126,13 @@ void FlatButtonSettingsEditor::updateWidget()
|
|||
switch (ui->hoverStyleComboBox->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
m_button->setOverlayStyle(Material::NoOverlay);
|
||||
m_button->setOverlayStyle(MaterialConst::NoOverlay);
|
||||
break;
|
||||
case 1:
|
||||
m_button->setOverlayStyle(Material::TintedOverlay);
|
||||
m_button->setOverlayStyle(MaterialConst::TintedOverlay);
|
||||
break;
|
||||
case 2:
|
||||
m_button->setOverlayStyle(Material::GrayOverlay);
|
||||
m_button->setOverlayStyle(MaterialConst::GrayOverlay);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -141,13 +141,13 @@ void FlatButtonSettingsEditor::updateWidget()
|
|||
switch (ui->rippleStyleComboBox->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
m_button->setRippleStyle(Material::CenteredRipple);
|
||||
m_button->setRippleStyle(MaterialConst::CenteredRipple);
|
||||
break;
|
||||
case 1:
|
||||
m_button->setRippleStyle(Material::PositionedRipple);
|
||||
m_button->setRippleStyle(MaterialConst::PositionedRipple);
|
||||
break;
|
||||
case 2:
|
||||
m_button->setRippleStyle(Material::NoRipple);
|
||||
m_button->setRippleStyle(MaterialConst::NoRipple);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -156,10 +156,10 @@ void FlatButtonSettingsEditor::updateWidget()
|
|||
switch (ui->iconPlacementComboBox->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
m_button->setIconPlacement(Material::LeftIcon);
|
||||
m_button->setIconPlacement(MaterialConst::LeftIcon);
|
||||
break;
|
||||
case 1:
|
||||
m_button->setIconPlacement(Material::RightIcon);
|
||||
m_button->setIconPlacement(MaterialConst::RightIcon);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -236,7 +236,7 @@ void FlatButtonSettingsEditor::applyDefaultPreset()
|
|||
ui->checkableCheckBox->setChecked(false);
|
||||
ui->disabledCheckBox->setChecked(false);
|
||||
updateWidget();
|
||||
m_button->applyPreset(Material::FlatPreset);
|
||||
m_button->applyPreset(MaterialConst::FlatPreset);
|
||||
}
|
||||
|
||||
void FlatButtonSettingsEditor::applyCheckablePreset()
|
||||
|
|
@ -255,7 +255,7 @@ void FlatButtonSettingsEditor::applyCheckablePreset()
|
|||
ui->checkableCheckBox->setChecked(true);
|
||||
ui->disabledCheckBox->setChecked(false);
|
||||
updateWidget();
|
||||
m_button->applyPreset(Material::CheckablePreset);
|
||||
m_button->applyPreset(MaterialConst::CheckablePreset);
|
||||
}
|
||||
|
||||
void FlatButtonSettingsEditor::init()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
Q_INIT_RESOURCE(resources);
|
||||
Q_INIT_RESOURCE(examples);
|
||||
Q_INIT_RESOURCE(material_res);
|
||||
|
||||
MainWindow window;
|
||||
window.show();
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "appbarsettingseditor.h"
|
||||
#include "autocompletesettingseditor.h"
|
||||
#include "menusettingseditor.h"
|
||||
#include "plugindemoform.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
|
|
@ -42,6 +43,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
|
||||
setCentralWidget(widget);
|
||||
|
||||
PluginDemoForm *pluginFrm = new PluginDemoForm;
|
||||
AvatarSettingsEditor *avatar = new AvatarSettingsEditor;
|
||||
BadgeSettingsEditor *badge = new BadgeSettingsEditor;
|
||||
CheckBoxSettingsEditor *checkbox = new CheckBoxSettingsEditor;
|
||||
|
|
@ -64,6 +66,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
AutoCompleteSettingsEditor *autocomplete = new AutoCompleteSettingsEditor;
|
||||
MenuSettingsEditor *menu = new MenuSettingsEditor;
|
||||
|
||||
stack->addWidget(pluginFrm);
|
||||
stack->addWidget(appBar);
|
||||
stack->addWidget(autocomplete);
|
||||
stack->addWidget(avatar);
|
||||
|
|
@ -86,6 +89,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
stack->addWidget(textField);
|
||||
stack->addWidget(toggle);
|
||||
|
||||
list->addItem("Plugins");
|
||||
list->addItem("App Bar");
|
||||
list->addItem("Auto Complete");
|
||||
list->addItem("Avatar");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
#include "plugindemoform.h"
|
||||
#include "ui_plugindemoform.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
PluginDemoForm::PluginDemoForm(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::PluginDemoForm)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// QStringList list1 = {"Hello", "Material", "Auto Complete"};
|
||||
// ui->qtmaterialautocomplete->setDataSource(list1);
|
||||
|
||||
m_dialog = new QtMaterialDialog;
|
||||
m_dialog->setParent(this);
|
||||
|
||||
QWidget *dialogWidget = new QWidget;
|
||||
QVBoxLayout *dialogWidgetLayout = new QVBoxLayout;
|
||||
dialogWidget->setLayout(dialogWidgetLayout);
|
||||
|
||||
QtMaterialFlatButton *closeButton = new QtMaterialFlatButton("Close");
|
||||
dialogWidgetLayout->addWidget(closeButton);
|
||||
dialogWidgetLayout->setAlignment(closeButton, Qt::AlignBottom | Qt::AlignCenter);
|
||||
|
||||
closeButton->setMaximumWidth(150);
|
||||
|
||||
QVBoxLayout *dialogLayout = new QVBoxLayout;
|
||||
m_dialog->setWindowLayout(dialogLayout);
|
||||
|
||||
dialogWidget->setMinimumHeight(300);
|
||||
|
||||
dialogLayout->addWidget(dialogWidget);
|
||||
|
||||
connect(closeButton, SIGNAL(pressed()), m_dialog, SLOT(hideDialog()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
PluginDemoForm::~PluginDemoForm()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void PluginDemoForm::on_qtmaterialflatbutton_3_clicked()
|
||||
{
|
||||
m_dialog->showDialog();
|
||||
}
|
||||
|
||||
void PluginDemoForm::tabIndexChanged(int index)
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef PLUGINDEMOFORM_H
|
||||
#define PLUGINDEMOFORM_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||
#include "qtmaterialdialog.h"
|
||||
|
||||
namespace Ui {
|
||||
class PluginDemoForm;
|
||||
}
|
||||
|
||||
class PluginDemoForm : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PluginDemoForm(QWidget *parent = nullptr);
|
||||
~PluginDemoForm();
|
||||
|
||||
private slots:
|
||||
void on_qtmaterialflatbutton_3_clicked();
|
||||
void tabIndexChanged(int index);
|
||||
|
||||
private:
|
||||
Ui::PluginDemoForm *ui;
|
||||
QtMaterialDialog* m_dialog;
|
||||
};
|
||||
|
||||
#endif // PLUGINDEMOFORM_H
|
||||
|
|
@ -0,0 +1,666 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PluginDemoForm</class>
|
||||
<widget class="QWidget" name="PluginDemoForm">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>907</width>
|
||||
<height>908</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QtMaterialTabWidget" name="tabwidget">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="haloVisible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="rippleStyle">
|
||||
<enum>MaterialConst::PositionedRipple</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="page">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>AutoComplete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QtMaterialAutoComplete" name="qtmaterialautocomplete">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="dataSource">
|
||||
<stringlist>
|
||||
<string>HELLO</string>
|
||||
<string>WORLD</string>
|
||||
<string>MATERIAL</string>
|
||||
</stringlist>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Avatar & Badge</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QtMaterialAvatar" name="qtmaterialavatar">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="size">
|
||||
<number>40</number>
|
||||
</property>
|
||||
<property name="letter">
|
||||
<char>
|
||||
<unicode>79</unicode>
|
||||
</char>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../components/material_res.qrc">
|
||||
<normaloff>:/icons/icons/communication/svg/production/ic_call_24px.svg</normaloff>:/icons/icons/communication/svg/production/ic_call_24px.svg</iconset>
|
||||
</property>
|
||||
<widget class="QtMaterialBadge" name="qtmaterialbadge">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="relativePosition">
|
||||
<pointf>
|
||||
<x>15.000000000000000</x>
|
||||
<y>15.000000000000000</y>
|
||||
</pointf>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QtMaterialAvatar" name="qtmaterialavatar_2">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="size">
|
||||
<number>40</number>
|
||||
</property>
|
||||
<property name="letter">
|
||||
<char>
|
||||
<unicode>79</unicode>
|
||||
</char>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../components/material_res.qrc">
|
||||
<normaloff>:/icons/icons/communication/svg/production/ic_call_24px.svg</normaloff>:/icons/icons/communication/svg/production/ic_call_24px.svg</iconset>
|
||||
</property>
|
||||
<widget class="QtMaterialBadge" name="qtmaterialbadge_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="relativePosition">
|
||||
<pointf>
|
||||
<x>15.000000000000000</x>
|
||||
<y>15.000000000000000</y>
|
||||
</pointf>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../components/material_res.qrc">
|
||||
<normaloff>:/icons/icons/toggle/svg/production/ic_star_24px.svg</normaloff>:/icons/icons/toggle/svg/production/ic_star_24px.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QtMaterialCheckBox" name="qtmaterialcheckbox">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CirculaProgress</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QtMaterialCircularProgress" name="qtmaterialcircularprogress">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="size">
|
||||
<double>40.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QtMaterialFlatButton" name="qtmaterialflatbutton_3">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show Dialog</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../components/material_res.qrc">
|
||||
<normaloff>:/icons/icons/communication/svg/production/ic_chat_bubble_24px.svg</normaloff>:/icons/icons/communication/svg/production/ic_chat_bubble_24px.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="role">
|
||||
<enum>MaterialConst::Primary</enum>
|
||||
</property>
|
||||
<property name="overlayStyle">
|
||||
<enum>MaterialConst::TintedOverlay</enum>
|
||||
</property>
|
||||
<property name="iconPlacement">
|
||||
<enum>MaterialConst::RightIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>FlatButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QtMaterialFlatButton" name="qtmaterialflatbutton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>FlatButton</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../components/material_res.qrc">
|
||||
<normaloff>:/icons/icons/maps/svg/production/ic_local_see_24px.svg</normaloff>:/icons/icons/maps/svg/production/ic_local_see_24px.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="overlayStyle">
|
||||
<enum>MaterialConst::TintedOverlay</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<widget class="QtMaterialFloatingActionButton" name="qtmaterialfloatingactionbutton">
|
||||
<property name="icon">
|
||||
<iconset resource="../components/material_res.qrc">
|
||||
<normaloff>:/icons/icons/navigation/svg/production/ic_more_vert_24px.svg</normaloff>:/icons/icons/navigation/svg/production/ic_more_vert_24px.svg</iconset>
|
||||
</property>
|
||||
<property name="mini">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_2">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>IconButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QtMaterialIconButton" name="qtmaterialiconbutton">
|
||||
<property name="icon">
|
||||
<iconset resource="../components/material_res.qrc">
|
||||
<normaloff>:/icons/icons/content/svg/production/ic_mail_24px.svg</normaloff>:/icons/icons/content/svg/production/ic_mail_24px.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Progress</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QtMaterialProgress" name="qtmaterialprogress">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RadioButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QtMaterialRadioButton" name="qtmaterialradiobutton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RadioButton 1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QtMaterialRadioButton" name="qtmaterialradiobutton_2">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RadioButton 2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RaiseButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="2">
|
||||
<widget class="QtMaterialRaisedButton" name="qtmaterialraisedbutton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RAISEBUTTON</string>
|
||||
</property>
|
||||
<property name="role">
|
||||
<enum>MaterialConst::Secondary</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Slider</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="2">
|
||||
<widget class="QtMaterialSlider" name="qtmaterialslider">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextField</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="2">
|
||||
<widget class="QtMaterialTextField" name="qtmaterialtextfield">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="label">
|
||||
<string>Input Text</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Toggle</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QtMaterialToggle" name="qtmaterialtoggle"/>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QtMaterialToggle" name="qtmaterialtoggle_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QtMaterialAutoComplete</class>
|
||||
<extends>QtMaterialTextField</extends>
|
||||
<header>qtmaterialautocomplete.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialAvatar</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qtmaterialavatar.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialBadge</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qtmaterialbadge.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialCheckBox</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qtmaterialcheckbox.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialCircularProgress</class>
|
||||
<extends>QProgressBar</extends>
|
||||
<header>qtmaterialcircularprogress.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialFloatingActionButton</class>
|
||||
<extends>QtMaterialRaisedButton</extends>
|
||||
<header>qtmaterialfab.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialFlatButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>qtmaterialflatbutton.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialIconButton</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qtmaterialiconbutton.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialProgress</class>
|
||||
<extends>QProgressBar</extends>
|
||||
<header>qtmaterialprogress.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialRadioButton</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qtmaterialradiobutton.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialRaisedButton</class>
|
||||
<extends>QtMaterialFlatButton</extends>
|
||||
<header>qtmaterialraisedbutton.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialSlider</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qtmaterialslider.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialTextField</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>qtmaterialtextfield.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialToggle</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qtmaterialtoggle.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QtMaterialTabWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qtmaterialtabwidget.h</header>
|
||||
<addpagemethod>addPage</addpagemethod>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../components/material_res.qrc"/>
|
||||
<include location="../components/material_res.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -47,10 +47,10 @@ void ProgressSettingsEditor::setupForm()
|
|||
{
|
||||
switch (m_progress->progressType())
|
||||
{
|
||||
case Material::DeterminateProgress:
|
||||
case MaterialConst::DeterminateProgress:
|
||||
ui->progressTypeComboBox->setCurrentIndex(0);
|
||||
break;
|
||||
case Material::IndeterminateProgress:
|
||||
case MaterialConst::IndeterminateProgress:
|
||||
ui->progressTypeComboBox->setCurrentIndex(1);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -67,10 +67,10 @@ void ProgressSettingsEditor::updateWidget()
|
|||
switch (ui->progressTypeComboBox->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
m_progress->setProgressType(Material::DeterminateProgress);
|
||||
m_progress->setProgressType(MaterialConst::DeterminateProgress);
|
||||
break;
|
||||
case 1:
|
||||
m_progress->setProgressType(Material::IndeterminateProgress);
|
||||
m_progress->setProgressType(MaterialConst::IndeterminateProgress);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TARGET = qt-material-widgets
|
||||
TEMPLATE = subdirs
|
||||
SUBDIRS = components examples
|
||||
|
|
@ -10,8 +8,3 @@ CONFIG += ordered
|
|||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if you use deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
|
|
|||
Loading…
Reference in New Issue