diff --git a/src/Gui/SettingsDialog/GeneralOptions.ui b/src/Gui/SettingsDialog/GeneralOptions.ui --- a/src/Gui/SettingsDialog/GeneralOptions.ui +++ b/src/Gui/SettingsDialog/GeneralOptions.ui @@ -7,7 +7,7 @@ 0 0 463 - 442 + 446 @@ -26,39 +26,42 @@ - - - Take a new Screenshot + + + - + true - - printKeyActionGroup - - - - - - - Open a new Spectacle window - - - printKeyActionGroup - - - - - - - Return focus to Spectacle - - - printKeyActionGroup - - - - + + + + + Take a new Screenshot + + + true + + + + + + + Open a new Spectacle window + + + + + + + Return focus to Spectacle + + + + + + + Qt::Vertical @@ -74,28 +77,28 @@ - + After taking a screenshot: - + Copy image to clipboard - + Autosave the image to the default location - + Qt::Vertical @@ -111,49 +114,49 @@ - + Rectangular Region - + General: - + Use light background - + Show magnifier - + Accept on click-and-release - + Remember selected area: - + Never @@ -163,29 +166,21 @@ - + Always - + Until Spectacle is closed - - - true - - - false - - @@ -196,7 +191,4 @@ - - - diff --git a/src/Gui/SettingsDialog/GeneralOptionsPage.cpp b/src/Gui/SettingsDialog/GeneralOptionsPage.cpp --- a/src/Gui/SettingsDialog/GeneralOptionsPage.cpp +++ b/src/Gui/SettingsDialog/GeneralOptionsPage.cpp @@ -44,30 +44,10 @@ m_ui->runningTitle->setLevel(2); m_ui->regionTitle->setLevel(2); - m_ui->printKeyActionGroup->setId(m_ui->newScreenshotButton, Settings::TakeNewScreenshot); - m_ui->printKeyActionGroup->setId(m_ui->newWindowButton, Settings::StartNewInstance); - m_ui->printKeyActionGroup->setId(m_ui->activateWindowButton, Settings::FocusWindow); - //On Wayland we can't programmatically raise and focus the window so we have to hide the option if (KWindowSystem::isPlatformWayland() || qstrcmp(qgetenv("XDG_SESSION_TYPE"), "wayland") == 0) { - m_ui->formLayout->removeRow(m_ui->activateWindowButton); + delete m_ui->activateWindowButton; } - //Workaround because KConfigDialogManager doesn't support QButtonGroup (Bug 409037) - auto workaroundLabel = m_ui->kcfg_printKeyActionRunning; - connect(workaroundLabel, &QLineEdit::textChanged, this, [this](const QString& text){ - auto button = m_ui->printKeyActionGroup->button(text.toInt()); - // We are missing a button on Wayland - button ? button->setChecked(true) : m_ui->newScreenshotButton->setChecked(true); - }); - connect(m_ui->printKeyActionGroup, qOverload(&QButtonGroup::buttonToggled), - workaroundLabel, [workaroundLabel, this] (QAbstractButton *button, bool checked) { - if (checked) { - const int value = m_ui->printKeyActionGroup->id(button); - workaroundLabel->setText(QString::number(value)); - } - }); - // /Workaround - } GeneralOptionsPage::~GeneralOptionsPage() = default;