From b814eb5169dadef10b6da8307e01d21e6b2c88af Mon Sep 17 00:00:00 2001 From: tsujan Date: Thu, 12 Dec 2024 22:16:01 +0330 Subject: [PATCH] Removed app transparency (#1209) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At least for three reasons: 1. App transparency isn't for normal windows — it may be used with "desktop widgets" like analog clocks, and even in those cases, it isn't a reliable way of having transparency; 2. We have terminal transparency; and 3. App transparency is only for X11, which, ironically, does not support transparency without a compositor. Closes https://github.com/lxqt/qterminal/issues/1192 --- src/forms/propertiesdialog.ui | 48 ++++++++--------------------------- src/mainwindow.cpp | 1 - src/properties.cpp | 17 ------------- src/properties.h | 1 - src/propertiesdialog.cpp | 10 -------- 5 files changed, 11 insertions(+), 66 deletions(-) diff --git a/src/forms/propertiesdialog.ui b/src/forms/propertiesdialog.ui index ddf17ac5..5090c3ae 100644 --- a/src/forms/propertiesdialog.ui +++ b/src/forms/propertiesdialog.ui @@ -275,32 +275,6 @@ - - - Application transparency - - - appTransparencyBox - - - - - - - % - - - 0 - - - 99 - - - 0 - - - - Terminal transparency @@ -310,7 +284,7 @@ - + % @@ -326,14 +300,14 @@ - + Background image: - + @@ -347,14 +321,14 @@ - + Background mode: - + @@ -383,7 +357,7 @@ - + Start with preset: @@ -393,7 +367,7 @@ - + @@ -417,7 +391,7 @@ - + Terminal margin @@ -427,14 +401,14 @@ - + px - + Current Terminal @@ -471,7 +445,7 @@ - + Qt::Vertical diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f06a95a5..2781bdc1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -730,7 +730,6 @@ void MainWindow::propertiesChanged() rebuildActions(); QApplication::setStyle(Properties::Instance()->guiStyle); - setWindowOpacity(1.0 - Properties::Instance()->appTransparency/100.0); consoleTabulator->setTabPosition((QTabWidget::TabPosition)Properties::Instance()->tabsPos); consoleTabulator->propertiesChanged(); setDropShortcut(Properties::Instance()->dropShortCut); diff --git a/src/properties.cpp b/src/properties.cpp index 35f6110c..d455d1e0 100644 --- a/src/properties.cpp +++ b/src/properties.cpp @@ -115,7 +115,6 @@ void Properties::loadSettings() terminalMargin = m_settings->value(QLatin1String("TerminalMargin"), 0).toInt(); - appTransparency = m_settings->value(QLatin1String("MainWindow/ApplicationTransparency"), 0).toInt(); termTransparency = m_settings->value(QLatin1String("TerminalTransparency"), 0).toInt(); backgroundImage = m_settings->value(QLatin1String("TerminalBackgroundImage"), QString()).toString(); backgroundMode = qBound(0, m_settings->value(QLatin1String("TerminalBackgroundMode"), 0).toInt(), 4); @@ -237,7 +236,6 @@ void Properties::saveSettings() } m_settings->endArray(); - m_settings->setValue(QLatin1String("MainWindow/ApplicationTransparency"), appTransparency); m_settings->setValue(QLatin1String("TerminalMargin"), terminalMargin); m_settings->setValue(QLatin1String("TerminalTransparency"), termTransparency); m_settings->setValue(QLatin1String("TerminalBackgroundImage"), backgroundImage); @@ -366,21 +364,6 @@ void Properties::migrate_settings() } settings.remove(QLatin1String("AlwaysShowTabs")); - // ===== appOpacity -> ApplicationTransparency ===== - // - // Note: In 0.6.0 the opacity values had been erroneously - // restricted to [0,99] instead of [1,100]. We fix this here by - // setting the opacity to 100 if it was 99 and to 1 if it was 0. - // - if(!settings.contains(QLatin1String("MainWindow/ApplicationTransparency"))) - { - int appOpacityValue = settings.value(QLatin1String("MainWindow/appOpacity"), 100).toInt(); - appOpacityValue = appOpacityValue == 99 ? 100 : appOpacityValue; - appOpacityValue = appOpacityValue == 0 ? 1 : appOpacityValue; - settings.setValue(QLatin1String("MainWindow/ApplicationTransparency"), 100 - appOpacityValue); - } - settings.remove(QLatin1String("MainWindow/appOpacity")); - // ===== termOpacity -> TerminalTransparency ===== if(!settings.contains(QLatin1String("TerminalTransparency"))) { diff --git a/src/properties.h b/src/properties.h index 7433a12f..34cf0a92 100644 --- a/src/properties.h +++ b/src/properties.h @@ -68,7 +68,6 @@ class Properties Sessions sessions; int terminalMargin; - int appTransparency; int termTransparency; QString backgroundImage; int backgroundMode; diff --git a/src/propertiesdialog.cpp b/src/propertiesdialog.cpp index 710078d9..49da1d27 100644 --- a/src/propertiesdialog.cpp +++ b/src/propertiesdialog.cpp @@ -219,8 +219,6 @@ PropertiesDialog::PropertiesDialog(QWidget *parent) terminalMarginSpinBox->setValue(Properties::Instance()->terminalMargin); - appTransparencyBox->setValue(Properties::Instance()->appTransparency); - termTransparencyBox->setValue(Properties::Instance()->termTransparency); highlightCurrentCheckBox->setChecked(Properties::Instance()->highlightCurrentTerminal); @@ -299,8 +297,6 @@ PropertiesDialog::PropertiesDialog(QWidget *parent) // show, hide or disable some widgets on Wayland bool onWayland(QGuiApplication::platformName() == QStringLiteral("wayland")); - appTransparencyLabel->setVisible(!onWayland); - appTransparencyBox->setVisible(!onWayland); savePosOnExitCheckBox->setVisible(!onWayland); waylandLabel->setVisible(onWayland); dropShortCutLabel->setEnabled(!onWayland); @@ -335,12 +331,6 @@ void PropertiesDialog::apply() Properties::Instance()->emulation = emulationComboBox->currentText(); - /* do not allow to go above 99 or we lose transparency option */ - (appTransparencyBox->value() >= 100) ? - Properties::Instance()->appTransparency = 99 - : - Properties::Instance()->appTransparency = appTransparencyBox->value(); - Properties::Instance()->terminalMargin = terminalMarginSpinBox->value(); Properties::Instance()->termTransparency = termTransparencyBox->value(); Properties::Instance()->highlightCurrentTerminal = highlightCurrentCheckBox->isChecked();