Build out AppBar layout
This commit is contained in:
parent
b40b8a1a4e
commit
067cf211b3
|
@ -1,7 +1,6 @@
|
|||
#include "qtmaterialappbar.h"
|
||||
#include "qtmaterialappbar_p.h"
|
||||
#include <QtWidgets/QGraphicsDropShadowEffect>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QPainter>
|
||||
#include "lib/qtmaterialstyle.h"
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define QTMATERIALAPPBAR_H
|
||||
|
||||
#include <QtWidgets/QWidget>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
|
||||
class QtMaterialAppBarPrivate;
|
||||
|
||||
|
@ -27,6 +28,8 @@ public:
|
|||
void setBackgroundColor(const QColor &color);
|
||||
QColor backgroundColor() const;
|
||||
|
||||
inline QHBoxLayout *appBarLayout() const;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||
|
||||
|
@ -37,4 +40,9 @@ private:
|
|||
Q_DECLARE_PRIVATE(QtMaterialAppBar)
|
||||
};
|
||||
|
||||
inline QHBoxLayout *QtMaterialAppBar::appBarLayout() const
|
||||
{
|
||||
return static_cast<QHBoxLayout *>(layout());
|
||||
}
|
||||
|
||||
#endif // QTMATERIALAPPBAR_H
|
||||
|
|
|
@ -94,6 +94,8 @@ void QtMaterialIconButton::setColor(const QColor &color)
|
|||
Q_D(QtMaterialIconButton);
|
||||
|
||||
d->color = color;
|
||||
|
||||
MATERIAL_DISABLE_THEME_COLORS
|
||||
update();
|
||||
}
|
||||
|
||||
|
@ -112,6 +114,8 @@ void QtMaterialIconButton::setDisabledColor(const QColor &color)
|
|||
Q_D(QtMaterialIconButton);
|
||||
|
||||
d->disabledColor = color;
|
||||
|
||||
MATERIAL_DISABLE_THEME_COLORS
|
||||
update();
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QColorDialog>
|
||||
#include <qtmaterialappbar.h>
|
||||
#include <qtmaterialiconbutton.h>
|
||||
#include <lib/qtmaterialtheme.h>
|
||||
|
||||
AppBarSettingsEditor::AppBarSettingsEditor(QWidget *parent)
|
||||
|
@ -9,6 +10,12 @@ AppBarSettingsEditor::AppBarSettingsEditor(QWidget *parent)
|
|||
ui(new Ui::AppBarSettingsForm),
|
||||
m_appBar(new QtMaterialAppBar)
|
||||
{
|
||||
QtMaterialIconButton *button = new QtMaterialIconButton(QtMaterialTheme::icon("navigation", "menu"));
|
||||
button->setIconSize(QSize(24, 24));
|
||||
m_appBar->appBarLayout()->addWidget(button);
|
||||
m_appBar->appBarLayout()->addStretch(1);
|
||||
button->setColor(Qt::white);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout;
|
||||
setLayout(layout);
|
||||
|
||||
|
|
Loading…
Reference in New Issue