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.h"
|
||||||
#include "qtmaterialscrollbar_p.h"
|
#include "qtmaterialscrollbar_p.h"
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QDebug>
|
||||||
#include "qtmaterialscrollbar_internal.h"
|
#include "qtmaterialscrollbar_internal.h"
|
||||||
#include "lib/qtmaterialstyle.h"
|
#include "lib/qtmaterialstyle.h"
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,8 @@ SOURCES = mainwindow.cpp \
|
||||||
tabssettingseditor.cpp \
|
tabssettingseditor.cpp \
|
||||||
snackbarsettingseditor.cpp \
|
snackbarsettingseditor.cpp \
|
||||||
dialogsettingseditor.cpp \
|
dialogsettingseditor.cpp \
|
||||||
drawersettingseditor.cpp
|
drawersettingseditor.cpp \
|
||||||
|
scrollbarsettingseditor.cpp
|
||||||
HEADERS = mainwindow.h \
|
HEADERS = mainwindow.h \
|
||||||
avatarsettingseditor.h \
|
avatarsettingseditor.h \
|
||||||
badgesettingseditor.h \
|
badgesettingseditor.h \
|
||||||
|
@ -36,7 +37,8 @@ HEADERS = mainwindow.h \
|
||||||
tabssettingseditor.h \
|
tabssettingseditor.h \
|
||||||
snackbarsettingseditor.h \
|
snackbarsettingseditor.h \
|
||||||
dialogsettingseditor.h \
|
dialogsettingseditor.h \
|
||||||
drawersettingseditor.h
|
drawersettingseditor.h \
|
||||||
|
scrollbarsettingseditor.h
|
||||||
LIBS += ../components/libcomponents.a
|
LIBS += ../components/libcomponents.a
|
||||||
INCLUDEPATH += ../components/
|
INCLUDEPATH += ../components/
|
||||||
TARGET = ../examples-exe
|
TARGET = ../examples-exe
|
||||||
|
@ -60,4 +62,5 @@ FORMS += \
|
||||||
textfieldsettingsform.ui \
|
textfieldsettingsform.ui \
|
||||||
tabssettingsform.ui \
|
tabssettingsform.ui \
|
||||||
dialogsettingsform.ui \
|
dialogsettingsform.ui \
|
||||||
drawersettingsform.ui
|
drawersettingsform.ui \
|
||||||
|
scrollbarsettingsform.ui
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "snackbarsettingseditor.h"
|
#include "snackbarsettingseditor.h"
|
||||||
#include "dialogsettingseditor.h"
|
#include "dialogsettingseditor.h"
|
||||||
#include "drawersettingseditor.h"
|
#include "drawersettingseditor.h"
|
||||||
|
#include "scrollbarsettingseditor.h"
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
|
@ -55,6 +56,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
SnackbarSettingsEditor *snackbar = new SnackbarSettingsEditor;
|
SnackbarSettingsEditor *snackbar = new SnackbarSettingsEditor;
|
||||||
DialogSettingsEditor *dialog = new DialogSettingsEditor;
|
DialogSettingsEditor *dialog = new DialogSettingsEditor;
|
||||||
DrawerSettingsEditor *drawer = new DrawerSettingsEditor;
|
DrawerSettingsEditor *drawer = new DrawerSettingsEditor;
|
||||||
|
ScrollBarSettingsEditor *scrollBar = new ScrollBarSettingsEditor;
|
||||||
|
|
||||||
stack->addWidget(avatar);
|
stack->addWidget(avatar);
|
||||||
stack->addWidget(badge);
|
stack->addWidget(badge);
|
||||||
|
@ -68,6 +70,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
stack->addWidget(progress);
|
stack->addWidget(progress);
|
||||||
stack->addWidget(radioButton);
|
stack->addWidget(radioButton);
|
||||||
stack->addWidget(raisedButton);
|
stack->addWidget(raisedButton);
|
||||||
|
stack->addWidget(scrollBar);
|
||||||
stack->addWidget(slider);
|
stack->addWidget(slider);
|
||||||
stack->addWidget(snackbar);
|
stack->addWidget(snackbar);
|
||||||
stack->addWidget(tabs);
|
stack->addWidget(tabs);
|
||||||
|
@ -86,6 +89,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
list->addItem("Progress");
|
list->addItem("Progress");
|
||||||
list->addItem("Radio Button");
|
list->addItem("Radio Button");
|
||||||
list->addItem("Raised Button");
|
list->addItem("Raised Button");
|
||||||
|
list->addItem("ScrollBar");
|
||||||
list->addItem("Slider");
|
list->addItem("Slider");
|
||||||
list->addItem("Snackbar");
|
list->addItem("Snackbar");
|
||||||
list->addItem("Tabs");
|
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