Add ScrollBar settings editor and form files
This commit is contained in:
parent
89354e65e6
commit
a33d6dfa0c
|
@ -1,6 +1,7 @@
|
|||
#include "qtmaterialscrollbar.h"
|
||||
#include "qtmaterialscrollbar_p.h"
|
||||
#include <QPainter>
|
||||
#include <QDebug>
|
||||
#include "qtmaterialscrollbar_internal.h"
|
||||
#include "lib/qtmaterialstyle.h"
|
||||
|
||||
|
|
|
@ -18,7 +18,8 @@ SOURCES = mainwindow.cpp \
|
|||
tabssettingseditor.cpp \
|
||||
snackbarsettingseditor.cpp \
|
||||
dialogsettingseditor.cpp \
|
||||
drawersettingseditor.cpp
|
||||
drawersettingseditor.cpp \
|
||||
scrollbarsettingseditor.cpp
|
||||
HEADERS = mainwindow.h \
|
||||
avatarsettingseditor.h \
|
||||
badgesettingseditor.h \
|
||||
|
@ -36,7 +37,8 @@ HEADERS = mainwindow.h \
|
|||
tabssettingseditor.h \
|
||||
snackbarsettingseditor.h \
|
||||
dialogsettingseditor.h \
|
||||
drawersettingseditor.h
|
||||
drawersettingseditor.h \
|
||||
scrollbarsettingseditor.h
|
||||
LIBS += ../components/libcomponents.a
|
||||
INCLUDEPATH += ../components/
|
||||
TARGET = ../examples-exe
|
||||
|
@ -60,4 +62,5 @@ FORMS += \
|
|||
textfieldsettingsform.ui \
|
||||
tabssettingsform.ui \
|
||||
dialogsettingsform.ui \
|
||||
drawersettingsform.ui
|
||||
drawersettingsform.ui \
|
||||
scrollbarsettingsform.ui
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "snackbarsettingseditor.h"
|
||||
#include "dialogsettingseditor.h"
|
||||
#include "drawersettingseditor.h"
|
||||
#include "scrollbarsettingseditor.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
|
@ -55,6 +56,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
SnackbarSettingsEditor *snackbar = new SnackbarSettingsEditor;
|
||||
DialogSettingsEditor *dialog = new DialogSettingsEditor;
|
||||
DrawerSettingsEditor *drawer = new DrawerSettingsEditor;
|
||||
ScrollBarSettingsEditor *scrollBar = new ScrollBarSettingsEditor;
|
||||
|
||||
stack->addWidget(avatar);
|
||||
stack->addWidget(badge);
|
||||
|
@ -68,6 +70,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
stack->addWidget(progress);
|
||||
stack->addWidget(radioButton);
|
||||
stack->addWidget(raisedButton);
|
||||
stack->addWidget(scrollBar);
|
||||
stack->addWidget(slider);
|
||||
stack->addWidget(snackbar);
|
||||
stack->addWidget(tabs);
|
||||
|
@ -86,6 +89,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
list->addItem("Progress");
|
||||
list->addItem("Radio Button");
|
||||
list->addItem("Raised Button");
|
||||
list->addItem("ScrollBar");
|
||||
list->addItem("Slider");
|
||||
list->addItem("Snackbar");
|
||||
list->addItem("Tabs");
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
#include "scrollbarsettingseditor.h"
|
||||
#include <QVBoxLayout>
|
||||
#include <QColorDialog>
|
||||
#include <QtWidgets/QTextEdit>
|
||||
#include "qtmaterialscrollbar.h"
|
||||
|
||||
ScrollBarSettingsEditor::ScrollBarSettingsEditor(QWidget *parent)
|
||||
: QWidget(parent),
|
||||
ui(new Ui::ScrollBarSettingsForm),
|
||||
m_scrollbar(new QtMaterialScrollBar)
|
||||
{
|
||||
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);
|
||||
canvas->setMaximumHeight(400);
|
||||
|
||||
QTextEdit *edit = new QTextEdit;
|
||||
edit->setText("<p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p>");
|
||||
edit->update();
|
||||
edit->setMaximumHeight(200);
|
||||
|
||||
m_scrollbar->setOrientation(Qt::Vertical);
|
||||
edit->setVerticalScrollBar(m_scrollbar);
|
||||
|
||||
layout->addWidget(edit);
|
||||
layout->setAlignment(edit, Qt::AlignHCenter);
|
||||
|
||||
setupForm();
|
||||
}
|
||||
|
||||
ScrollBarSettingsEditor::~ScrollBarSettingsEditor()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ScrollBarSettingsEditor::setupForm()
|
||||
{
|
||||
}
|
||||
|
||||
void ScrollBarSettingsEditor::updateWidget()
|
||||
{
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef SCROLLBARSETTINGSEDITOR_H
|
||||
#define SCROLLBARSETTINGSEDITOR_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_scrollbarsettingsform.h"
|
||||
|
||||
class QtMaterialScrollBar;
|
||||
|
||||
class ScrollBarSettingsEditor : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ScrollBarSettingsEditor(QWidget *parent = 0);
|
||||
~ScrollBarSettingsEditor();
|
||||
|
||||
protected slots:
|
||||
void setupForm();
|
||||
void updateWidget();
|
||||
|
||||
private:
|
||||
Ui::ScrollBarSettingsForm *const ui;
|
||||
QtMaterialScrollBar *const m_scrollbar;
|
||||
};
|
||||
|
||||
#endif // SCROLLBARSETTINGSEDITOR_H
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ScrollBarSettingsForm</class>
|
||||
<widget class="QWidget" name="ScrollBarSettingsForm">
|
||||
<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>
|
Loading…
Reference in New Issue