summaryrefslogtreecommitdiff
path: root/ui/qt5/pkgsimple.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt5/pkgsimple.cc')
-rw-r--r--ui/qt5/pkgsimple.cc77
1 files changed, 41 insertions, 36 deletions
diff --git a/ui/qt5/pkgsimple.cc b/ui/qt5/pkgsimple.cc
index e168583..eab4066 100644
--- a/ui/qt5/pkgsimple.cc
+++ b/ui/qt5/pkgsimple.cc
@@ -16,6 +16,7 @@
#include <QButtonGroup>
#include <QGridLayout>
#include <QLabel>
+#include <QTabWidget>
#include <QVBoxLayout>
PkgSimplePage::PkgSimplePage(QWidget *parent) : HorizonWizardPage(parent) {
@@ -30,12 +31,13 @@ PkgSimplePage::PkgSimplePage(QWidget *parent) : HorizonWizardPage(parent) {
QRadioButton *mobileButton, *compactButton, *textButton, *customButton;
QLabel *standardLabel, *mobileLabel, *compactLabel, *textLabel,
*customLabel;
+ QTabWidget *tabWidget;
standardButton = new QRadioButton(tr("&Standard"));
standardButton->setIcon(QIcon::fromTheme("preferences-desktop-theme"));
standardButton->setIconSize(QSize(32, 32));
standardLabel = new QLabel(
- tr("Includes a full desktop environment, including Web browser, email client, media player, and office suite."));
+ tr("Includes a full desktop environment, Web browser, email client, media player, and software suite."));
standardLabel->setBuddy(standardButton);
standardLabel->setIndent(40);
standardLabel->setWordWrap(true);
@@ -45,7 +47,7 @@ PkgSimplePage::PkgSimplePage(QWidget *parent) : HorizonWizardPage(parent) {
mobileButton->setIcon(QIcon::fromTheme("battery"));
mobileButton->setIconSize(QSize(32, 32));
mobileLabel = new QLabel(
- tr("Includes the Standard software and additional utilities for notebook and tablet computers."));
+ tr("Includes the Standard software set and additional utilities for notebook and tablet computers."));
mobileLabel->setBuddy(mobileButton);
mobileLabel->setIndent(40);
mobileLabel->setWordWrap(true);
@@ -54,7 +56,7 @@ PkgSimplePage::PkgSimplePage(QWidget *parent) : HorizonWizardPage(parent) {
compactButton = new QRadioButton(tr("&Compact"));
compactButton->setIcon(QIcon::fromTheme("preferences-ubuntu-panel"));
compactButton->setIconSize(QSize(32, 32));
- compactLabel = new QLabel(tr("Includes a lightweight LXQt desktop environment and a text editor."));
+ compactLabel = new QLabel(tr("Desktop environment and lightweight utilities only."));
compactLabel->setBuddy(compactButton);
compactLabel->setIndent(40);
compactLabel->setWordWrap(true);
@@ -94,51 +96,54 @@ PkgSimplePage::PkgSimplePage(QWidget *parent) : HorizonWizardPage(parent) {
horizonWizard()->desktopType = static_cast<HorizonWizard::DesktopType>(desktopGroup->id(choice));
});
- auto *buttonLayout = new QVBoxLayout;
- buttonLayout->addWidget(standardButton);
- buttonLayout->addWidget(standardLabel);
- buttonLayout->addWidget(mobileButton);
- buttonLayout->addWidget(mobileLabel);
- buttonLayout->addWidget(compactButton);
- buttonLayout->addWidget(compactLabel);
- buttonLayout->addWidget(textButton);
- buttonLayout->addWidget(textLabel);
- buttonLayout->addWidget(customButton);
- buttonLayout->addWidget(customLabel);
-
- QButtonGroup *group = new QButtonGroup(this);
+ auto *desktopLayout = new QHBoxLayout;
+ for(auto button: {deskPlasmaButton, deskLXQtButton, deskMATEButton, deskXFCEButton}) {
+ desktopLayout->addWidget(button);
+ }
+ auto *gfxButtonLayout = new QVBoxLayout;
+ gfxButtonLayout->addLayout(desktopLayout);
+ gfxButtonLayout->addStretch();
+ gfxButtonLayout->addWidget(standardButton);
+ gfxButtonLayout->addWidget(standardLabel);
+ gfxButtonLayout->addWidget(mobileButton);
+ gfxButtonLayout->addWidget(mobileLabel);
+ gfxButtonLayout->addWidget(compactButton);
+ gfxButtonLayout->addWidget(compactLabel);
+ auto *gfxTab = new QWidget;
+ gfxTab->setLayout(gfxButtonLayout);
+
+ auto *textButtonLayout = new QVBoxLayout;
+ textButtonLayout->addWidget(textButton);
+ textButtonLayout->addWidget(textLabel);
+ auto *textTab = new QWidget;
+ textTab->setLayout(textButtonLayout);
+
+ auto *customButtonLayout = new QVBoxLayout;
+ customButtonLayout->addWidget(customButton);
+ customButtonLayout->addWidget(customLabel);
+ auto *customTab = new QWidget;
+ customTab->setLayout(customButtonLayout);
+
+ auto *group = new QButtonGroup(this);
group->addButton(standardButton, HorizonWizard::Standard);
group->addButton(mobileButton, HorizonWizard::Mobile);
group->addButton(compactButton, HorizonWizard::Compact);
group->addButton(textButton, HorizonWizard::TextOnly);
group->addButton(customButton, HorizonWizard::Custom);
connect(group, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked),
- [this, group, buttonLayout](QAbstractButton *choice) {
+ [this, group](QAbstractButton *choice) {
horizonWizard()->pkgtype = static_cast<HorizonWizard::PackageType>(group->id(choice));
- if(choice == standardButton) {
- auto *desktopLayout = new QHBoxLayout;
- desktopLayout->setObjectName("desk-buttons");
- for(auto button: {deskPlasmaButton, deskLXQtButton, deskMATEButton, deskXFCEButton}) {
- button->show();
- desktopLayout->addWidget(button);
- }
- buttonLayout->insertLayout(2, desktopLayout);
- layout()->invalidate();
- } else {
- auto item = buttonLayout->itemAt(2);
- if(item->layout() && item->layout()->objectName() == "desk-buttons") {
- buttonLayout->removeItem(item);
- for (auto button: {deskPlasmaButton, deskLXQtButton, deskMATEButton, deskXFCEButton}) {
- button->hide();
- }
- }
- }
});
+ tabWidget = new QTabWidget(this);
+ tabWidget->addTab(gfxTab, tr("Desktop"));
+ tabWidget->addTab(textTab, tr("Text/Server"));
+ tabWidget->addTab(customTab, tr("Custom"));
+
auto *mainLayout = new QVBoxLayout;
mainLayout->addWidget(descLabel);
mainLayout->addStretch();
- mainLayout->addLayout(buttonLayout);
+ mainLayout->addWidget(tabWidget);
setLayout(mainLayout);
}