|
| 1 | +// SPDX-License-Identifier: GPL-3.0-only |
| 2 | +/* |
| 3 | + * Freesm Launcher - Minecraft Launcher |
| 4 | + * Copyright (C) 2026 so5iso4ka <so5iso4ka@icloud.com> |
| 5 | + * |
| 6 | + * This program is free software: you can redistribute it and/or modify |
| 7 | + * it under the terms of the GNU General Public License as published by |
| 8 | + * the Free Software Foundation, version 3. |
| 9 | + * |
| 10 | + * This program is distributed in the hope that it will be useful, |
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + * GNU General Public License for more details. |
| 14 | + * |
| 15 | + * You should have received a copy of the GNU General Public License |
| 16 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 17 | + */ |
| 18 | + |
| 19 | +#include "AppearancePage.h" |
| 20 | + |
| 21 | +#include <QScrollArea> |
| 22 | + |
| 23 | +AppearancePage::AppearancePage(QWidget* parent) : QWidget(parent), m_widget(new AppearanceWidget(false, this)) |
| 24 | +{ |
| 25 | + auto layout = new QVBoxLayout(this); |
| 26 | + layout->setContentsMargins(0, 0, 0, 0); |
| 27 | + |
| 28 | + auto scrollArea = new QScrollArea(this); |
| 29 | + scrollArea->setWidgetResizable(true); |
| 30 | + scrollArea->setWidget(m_widget); |
| 31 | + |
| 32 | + layout->addWidget(scrollArea); |
| 33 | + |
| 34 | + if (const auto widgetLayout = qobject_cast<QVBoxLayout*>(m_widget->layout())) { |
| 35 | + widgetLayout->addStretch(); |
| 36 | + } |
| 37 | +} |
| 38 | + |
| 39 | +bool AppearancePage::apply() |
| 40 | +{ |
| 41 | + m_widget->applySettings(); |
| 42 | + return true; |
| 43 | +} |
| 44 | + |
| 45 | +void AppearancePage::retranslate() |
| 46 | +{ |
| 47 | + m_widget->retranslateUi(); |
| 48 | +} |
0 commit comments