Create stub for AppBar settings editor
This commit is contained in:
parent
3a7d7a19fd
commit
5bdb7fd06d
|
@ -0,0 +1,77 @@
|
||||||
|
#include "appbarsettingseditor.h"
|
||||||
|
#include <qtmaterialappbar.h>
|
||||||
|
#include <lib/qtmaterialtheme.h>
|
||||||
|
|
||||||
|
AppBarSettingsEditor::AppBarSettingsEditor(QWidget *parent)
|
||||||
|
: QWidget(parent),
|
||||||
|
ui(new Ui::AppBarSettingsForm),
|
||||||
|
m_appbar(new QtMaterialAppBar(QChar('X')))
|
||||||
|
{
|
||||||
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
|
setLayout(layout);
|
||||||
|
|
||||||
|
QWidget *widget = new QWidget;
|
||||||
|
layout->addWidget(widget);
|
||||||
|
|
||||||
|
QWidget *canvas = new QWidget;
|
||||||
|
canvas->setStyleSheet("QWidget { background: white; }");
|
||||||
|
layout->addWidget(canvas);
|
||||||
|
|
||||||
|
ui->setupUi(widget);
|
||||||
|
layout->setContentsMargins(20, 20, 20, 20);
|
||||||
|
|
||||||
|
layout = new QVBoxLayout;
|
||||||
|
canvas->setLayout(layout);
|
||||||
|
layout->addWidget(m_appBar);
|
||||||
|
|
||||||
|
setupForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
AppBarSettingsEditor::~AppBarSettingsEditor()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppBarSettingsEditor::setupForm()
|
||||||
|
{
|
||||||
|
//switch (m_avatar->type())
|
||||||
|
//{
|
||||||
|
//case Material::LetterAppBar:
|
||||||
|
// ui->typeComboBox->setCurrentIndex(0);
|
||||||
|
// break;
|
||||||
|
//case Material::ImageAppBar:
|
||||||
|
// ui->typeComboBox->setCurrentIndex(1);
|
||||||
|
// break;
|
||||||
|
//case Material::IconAppBar:
|
||||||
|
// ui->typeComboBox->setCurrentIndex(2);
|
||||||
|
// break;
|
||||||
|
//default:
|
||||||
|
// break;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//ui->disabledCheckBox->setChecked(!m_avatar->isEnabled());
|
||||||
|
//ui->useThemeColorsCheckBox->setChecked(m_avatar->useThemeColors());
|
||||||
|
//ui->sizeSpinBox->setValue(m_avatar->size());
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppBarSettingsEditor::updateWidget()
|
||||||
|
{
|
||||||
|
//switch (ui->typeComboBox->currentIndex())
|
||||||
|
//{
|
||||||
|
//case 0:
|
||||||
|
// m_avatar->setLetter(QChar('X'));
|
||||||
|
// break;
|
||||||
|
//case 1:
|
||||||
|
// m_avatar->setImage(QImage(":/images/assets/sikh.jpg"));
|
||||||
|
// break;
|
||||||
|
//case 2:
|
||||||
|
// m_avatar->setIcon(QtMaterialTheme::icon("communication", "message"));
|
||||||
|
// break;
|
||||||
|
//default:
|
||||||
|
// break;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//m_avatar->setDisabled(ui->disabledCheckBox->isChecked());
|
||||||
|
//m_avatar->setUseThemeColors(ui->useThemeColorsCheckBox->isChecked());
|
||||||
|
//m_avatar->setSize(ui->sizeSpinBox->value());
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef APPBARSETTINGSEDITOR_H
|
||||||
|
#define APPBARSETTINGSEDITOR_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include "ui_avatarsettingsform.h"
|
||||||
|
|
||||||
|
class QtMaterialAppBar;
|
||||||
|
|
||||||
|
class AppBarSettingsEditor : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AppBarSettingsEditor(QWidget *parent = 0);
|
||||||
|
~AppBarSettingsEditor();
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
void setupForm();
|
||||||
|
void updateWidget();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::AppBarSettingsForm *const ui;
|
||||||
|
QtMaterialAppBar *const m_appBar;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // APPBARSETTINGSEDITOR_H
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>AppBarSettingsForm</class>
|
||||||
|
<widget class="QWidget" name="AppBarSettingsForm">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>474</width>
|
||||||
|
<height>387</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>70</y>
|
||||||
|
<width>171</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TODO</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -20,7 +20,8 @@ SOURCES = mainwindow.cpp \
|
||||||
snackbarsettingseditor.cpp \
|
snackbarsettingseditor.cpp \
|
||||||
dialogsettingseditor.cpp \
|
dialogsettingseditor.cpp \
|
||||||
drawersettingseditor.cpp \
|
drawersettingseditor.cpp \
|
||||||
scrollbarsettingseditor.cpp
|
scrollbarsettingseditor.cpp \
|
||||||
|
appbarsettingseditor.cpp
|
||||||
HEADERS = mainwindow.h \
|
HEADERS = mainwindow.h \
|
||||||
avatarsettingseditor.h \
|
avatarsettingseditor.h \
|
||||||
badgesettingseditor.h \
|
badgesettingseditor.h \
|
||||||
|
@ -39,7 +40,8 @@ HEADERS = mainwindow.h \
|
||||||
snackbarsettingseditor.h \
|
snackbarsettingseditor.h \
|
||||||
dialogsettingseditor.h \
|
dialogsettingseditor.h \
|
||||||
drawersettingseditor.h \
|
drawersettingseditor.h \
|
||||||
scrollbarsettingseditor.h
|
scrollbarsettingseditor.h \
|
||||||
|
appbarsettingseditor.h
|
||||||
LIBS += $$top_builddir/components/$(OBJECTS_DIR)/libcomponents.a
|
LIBS += $$top_builddir/components/$(OBJECTS_DIR)/libcomponents.a
|
||||||
INCLUDEPATH += $$top_srcdir/components/
|
INCLUDEPATH += $$top_srcdir/components/
|
||||||
TARGET = examples-exe
|
TARGET = examples-exe
|
||||||
|
|
Loading…
Reference in New Issue