moved more stuff into appbase

This commit is contained in:
fourtf
2018-11-25 21:14:42 +01:00
parent 0b94d0f763
commit 52dcc2130e
19 changed files with 27 additions and 452 deletions
+9 -3
View File
@@ -158,12 +158,18 @@ void GeneralPage::initLayout(SettingsLayout &layout)
getApp()->fonts->chatFontSize,
[](auto val) { return QString::number(val) + "pt"; },
[](auto args) { return fuzzyToInt(args.value, 10); });
layout.addDropdown<int>(
layout.addDropdown<float>(
"UI Scale",
{"0.5x", "0.6x", "0.7x", "0.8x", "0.9x", "Default", "1.2x", "1.4x",
"1.6x", "1.8x", "2x", "2.33x", "2.66x", "3x", "3.5x", "4x"},
s.uiScale, [](auto val) { return val + 5; },
[](auto args) { return args.index - 5; }, false);
s.uiScale,
[](auto val) {
if (val == 1)
return QString("Default");
else
return QString::number(val) + "x";
},
[](auto args) { return fuzzyToFloat(args.value, 1.f); });
layout.addCheckbox("Always on top", s.windowTopMost);
layout.addTitle("Interface");
-35
View File
@@ -125,13 +125,6 @@ void LookPage::addInterfaceTab(LayoutCreator<QVBoxLayout> layout)
box->addStretch(1);
}
// ui scale
{
auto box = layout.emplace<QHBoxLayout>().withoutMargin();
box.emplace<QLabel>("Window scale: ");
box.append(this->createUiScaleSlider());
}
layout.append(
this->createCheckBox(WINDOW_TOPMOST, getSettings()->windowTopMost));
@@ -567,34 +560,6 @@ QLayout *LookPage::createFontChanger()
return layout;
}
QLayout *LookPage::createUiScaleSlider()
{
auto layout = new QHBoxLayout();
auto slider = new QSlider(Qt::Horizontal);
auto label = new QLabel();
layout->addWidget(slider);
layout->addWidget(label);
slider->setMinimum(WindowManager::uiScaleMin);
slider->setMaximum(WindowManager::uiScaleMax);
slider->setValue(
WindowManager::clampUiScale(getSettings()->uiScale.getValue()));
label->setMinimumWidth(100);
QObject::connect(slider, &QSlider::valueChanged, [](auto value) {
getSettings()->uiScale.setValue(value);
});
getSettings()->uiScale.connect(
[label](auto, auto) {
label->setText(QString::number(WindowManager::getUiScaleValue()));
},
this->connections_);
return layout;
}
QLayout *LookPage::createBoldScaleSlider()
{
auto layout = new QHBoxLayout();
-1
View File
@@ -30,7 +30,6 @@ private:
QLayout *createThemeColorChanger();
QLayout *createFontChanger();
QLayout *createUiScaleSlider();
QLayout *createBoldScaleSlider();
ChannelPtr createPreviewChannel();