aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/extensionmanager/extensionmanagerwidget.cpp
diff options
context:
space:
mode:
authorAlessandro Portale <[email protected]>2024-08-22 21:42:15 +0200
committerAlessandro Portale <[email protected]>2024-08-26 11:18:09 +0000
commitfc4b8d3843948f25816a95eef7ee2ea2b6634d9d (patch)
tree9c5c194ca7472996196bb18c124caffbc1bbe976 /src/plugins/extensionmanager/extensionmanagerwidget.cpp
parentcf66a464ac8814f53edafd0506d05fbc84970ab5 (diff)
ExtensionManager: Replace "Load on start" checkbox with switch
Change-Id: Idad36e5fc3417a00f11a2775f40c89a6e4f50b46 Reviewed-by: Cristian Adam <[email protected]>
Diffstat (limited to 'src/plugins/extensionmanager/extensionmanagerwidget.cpp')
-rw-r--r--src/plugins/extensionmanager/extensionmanagerwidget.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/extensionmanager/extensionmanagerwidget.cpp b/src/plugins/extensionmanager/extensionmanagerwidget.cpp
index 86d98178832..a4040b27fc3 100644
--- a/src/plugins/extensionmanager/extensionmanagerwidget.cpp
+++ b/src/plugins/extensionmanager/extensionmanagerwidget.cpp
@@ -256,19 +256,20 @@ public:
: QWidget(parent)
{
m_label = new InfoLabel;
- m_checkBox = new QCheckBox(Tr::tr("Load on start"));
+ m_switch = new Switch(Tr::tr("Load on start"));
m_restartButton = new Button(Tr::tr("Restart Now"), Button::MediumPrimary);
m_restartButton->setVisible(false);
m_pluginView.hide();
+ setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
using namespace Layouting;
Column {
m_label,
- m_checkBox,
+ m_switch,
m_restartButton,
}.attachTo(this);
- connect(m_checkBox, &QCheckBox::clicked, this, [this](bool checked) {
+ connect(m_switch, &QCheckBox::clicked, this, [this](bool checked) {
ExtensionSystem::PluginSpec *spec = pluginSpecForName(m_pluginName);
if (spec == nullptr)
return;
@@ -277,7 +278,7 @@ public:
m_restartButton->show();
ExtensionSystem::PluginManager::writeSettings();
} else {
- m_checkBox->setChecked(!checked);
+ m_switch->setChecked(!checked);
}
});
@@ -314,12 +315,12 @@ private:
m_label->setText(Tr::tr("Not loaded"));
}
- m_checkBox->setChecked(spec->isRequired() || spec->isEnabledBySettings());
- m_checkBox->setEnabled(!spec->isRequired());
+ m_switch->setChecked(spec->isRequired() || spec->isEnabledBySettings());
+ m_switch->setEnabled(!spec->isRequired());
}
InfoLabel *m_label;
- QCheckBox *m_checkBox;
+ Switch *m_switch;
QAbstractButton *m_restartButton;
QString m_pluginName;
ExtensionSystem::PluginView m_pluginView{this};