LayoutCreator<T>::operator * now returns a reference
This commit is contained in:
@@ -23,7 +23,7 @@ AboutPage::AboutPage()
|
||||
|
||||
auto scroll = layoutCreator.emplace<QScrollArea>();
|
||||
auto widget = scroll.emplaceScrollAreaWidget();
|
||||
util::removeScrollAreaBackground(*scroll, *widget);
|
||||
util::removeScrollAreaBackground(scroll.getElement(), widget.getElement());
|
||||
|
||||
auto layout = widget.setLayoutType<QVBoxLayout>();
|
||||
{
|
||||
@@ -73,18 +73,22 @@ AboutPage::AboutPage()
|
||||
{
|
||||
auto form = licenses.emplace<QFormLayout>();
|
||||
|
||||
addLicense(*form, "Qt Framework", "https://www.qt.io", ":/licenses/qt_lgpl-3.0.txt");
|
||||
addLicense(*form, "Boost", "https://www.boost.org/", ":/licenses/boost_boost.txt");
|
||||
addLicense(*form, "Fmt", "http://fmtlib.net/", ":/licenses/fmt_bsd2.txt");
|
||||
addLicense(*form, "LibCommuni", "https://github.com/communi/libcommuni",
|
||||
addLicense(form.getElement(), "Qt Framework", "https://www.qt.io",
|
||||
":/licenses/qt_lgpl-3.0.txt");
|
||||
addLicense(form.getElement(), "Boost", "https://www.boost.org/",
|
||||
":/licenses/boost_boost.txt");
|
||||
addLicense(form.getElement(), "Fmt", "http://fmtlib.net/", ":/licenses/fmt_bsd2.txt");
|
||||
addLicense(form.getElement(), "LibCommuni", "https://github.com/communi/libcommuni",
|
||||
":/licenses/libcommuni_BSD3.txt");
|
||||
addLicense(*form, "OpenSSL", "https://www.openssl.org/", ":/licenses/openssl.txt");
|
||||
addLicense(*form, "RapidJson", "http://rapidjson.org/", ":/licenses/rapidjson.txt");
|
||||
addLicense(*form, "Pajlada/Settings", "https://github.com/pajlada/settings",
|
||||
addLicense(form.getElement(), "OpenSSL", "https://www.openssl.org/",
|
||||
":/licenses/openssl.txt");
|
||||
addLicense(form.getElement(), "RapidJson", "http://rapidjson.org/",
|
||||
":/licenses/rapidjson.txt");
|
||||
addLicense(form.getElement(), "Pajlada/Settings", "https://github.com/pajlada/settings",
|
||||
":/licenses/pajlada_settings.txt");
|
||||
addLicense(*form, "Pajlada/Signals", "https://github.com/pajlada/signals",
|
||||
addLicense(form.getElement(), "Pajlada/Signals", "https://github.com/pajlada/signals",
|
||||
":/licenses/pajlada_signals.txt");
|
||||
addLicense(*form, "Websocketpp", "https://www.zaphoyd.com/websocketpp/",
|
||||
addLicense(form.getElement(), "Websocketpp", "https://www.zaphoyd.com/websocketpp/",
|
||||
":/licenses/websocketpp.txt");
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ AccountsPage::AccountsPage()
|
||||
auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
|
||||
|
||||
helper::EditableModelView *view =
|
||||
*layout.emplace<helper::EditableModelView>(app->accounts->createModel(nullptr));
|
||||
layout.emplace<helper::EditableModelView>(app->accounts->createModel(nullptr)).getElement();
|
||||
|
||||
view->getTableView()->horizontalHeader()->setVisible(false);
|
||||
view->getTableView()->horizontalHeader()->setStretchLastSection(true);
|
||||
|
||||
@@ -41,7 +41,7 @@ AppearancePage::AppearancePage()
|
||||
|
||||
auto scroll = layoutCreator.emplace<QScrollArea>();
|
||||
auto widget = scroll.emplaceScrollAreaWidget();
|
||||
util::removeScrollAreaBackground(*scroll, *widget);
|
||||
util::removeScrollAreaBackground(scroll.getElement(), widget.getElement());
|
||||
|
||||
auto layout = widget.setLayoutType<QVBoxLayout>();
|
||||
|
||||
@@ -131,12 +131,13 @@ AppearancePage::AppearancePage()
|
||||
|
||||
auto scaleLabel = scaleBox.emplace<QLabel>("1.0");
|
||||
scaleLabel->setFixedWidth(100);
|
||||
QObject::connect(*emoteScale, &QSlider::valueChanged, [scaleLabel](int value) mutable {
|
||||
float f = (float)value / 10.f;
|
||||
scaleLabel->setText(QString::number(f));
|
||||
QObject::connect(emoteScale.getElement(), &QSlider::valueChanged,
|
||||
[scaleLabel](int value) mutable {
|
||||
float f = (float)value / 10.f;
|
||||
scaleLabel->setText(QString::number(f));
|
||||
|
||||
getApp()->settings->emoteScale.setValue(f);
|
||||
});
|
||||
getApp()->settings->emoteScale.setValue(f);
|
||||
});
|
||||
|
||||
emoteScale->setValue(std::max<int>(
|
||||
5, std::min<int>(50, (int)(app->settings->emoteScale.getValue() * 10.f))));
|
||||
|
||||
@@ -42,7 +42,7 @@ CommandPage::CommandPage()
|
||||
warning.getElement()->setStyleSheet("color: #f00");
|
||||
|
||||
helper::EditableModelView *view =
|
||||
*layout.emplace<helper::EditableModelView>(app->commands->createModel(nullptr));
|
||||
layout.emplace<helper::EditableModelView>(app->commands->createModel(nullptr)).getElement();
|
||||
|
||||
view->setTitles({"Trigger", "Command"});
|
||||
view->getTableView()->horizontalHeader()->setStretchLastSection(true);
|
||||
@@ -54,7 +54,7 @@ CommandPage::CommandPage()
|
||||
layout.append(this->createCheckBox("Also match the trigger at the end of the message",
|
||||
app->settings->allowCommandsAtEnd));
|
||||
|
||||
QLabel *text = *layout.emplace<QLabel>(TEXT);
|
||||
QLabel *text = layout.emplace<QLabel>(TEXT).getElement();
|
||||
text->setWordWrap(true);
|
||||
text->setStyleSheet("color: #bbb");
|
||||
|
||||
|
||||
@@ -45,8 +45,10 @@ HighlightingPage::HighlightingPage()
|
||||
// HIGHLIGHTS
|
||||
auto highlights = tabs.appendTab(new QVBoxLayout, "Highlights");
|
||||
{
|
||||
helper::EditableModelView *view = *highlights.emplace<helper::EditableModelView>(
|
||||
app->highlights->createModel(nullptr));
|
||||
helper::EditableModelView *view =
|
||||
highlights
|
||||
.emplace<helper::EditableModelView>(app->highlights->createModel(nullptr))
|
||||
.getElement();
|
||||
|
||||
view->setTitles({"Pattern", "Flash taskbar", "Play sound", "Regex"});
|
||||
view->getTableView()->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QGroupBox>
|
||||
#include <QHeaderView>
|
||||
#include <QLabel>
|
||||
#include <QListView>
|
||||
#include <QPushButton>
|
||||
@@ -65,7 +66,8 @@ IgnoreUsersPage::IgnoreUsersPage()
|
||||
auto messages = tabs.appendTab(new QVBoxLayout, "Messages");
|
||||
{
|
||||
helper::EditableModelView *view =
|
||||
*messages.emplace<helper::EditableModelView>(app->ignores->createModel(nullptr));
|
||||
messages.emplace<helper::EditableModelView>(app->ignores->createModel(nullptr))
|
||||
.getElement();
|
||||
view->setTitles({"Pattern", "Regex"});
|
||||
view->getTableView()->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
|
||||
view->getTableView()->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
|
||||
Reference in New Issue
Block a user