Compare commits
67 Commits
ubuntu/cos
...
ubuntu/plu
Author | SHA1 | Date |
---|---|---|
Simon Quigley | 937c6440c0 | 1 month ago |
Simon Quigley | 2fc4a49f12 | 2 months ago |
Simon Quigley | 4604a4dfa9 | 2 months ago |
Simon Quigley | 71970be5f8 | 2 months ago |
Rik Mills | 5084b73cc5 | 4 months ago |
Rik Mills | db1b09be0f | 4 months ago |
Aaron Rainbolt | 4969e799e6 | 4 months ago |
Aaron Rainbolt | 4a2ef81a60 | 6 months ago |
Aaron Rainbolt | 27240de48d | 6 months ago |
Aaron Rainbolt | 4486c16c89 | 6 months ago |
Aaron Rainbolt | 8278458f9a | 6 months ago |
Aaron Rainbolt | 26006982ad | 6 months ago |
Aaron Rainbolt | b170bc0e01 | 6 months ago |
Simon Quigley | 97426de1ba | 1 year ago |
Aaron Rainbolt | 2434c333db | 1 year ago |
Aaron Rainbolt | a312176ac2 | 1 year ago |
Aaron Rainbolt | edf255ebbf | 1 year ago |
Aaron Rainbolt | b3a71dfc80 | 1 year ago |
Aaron Rainbolt | f4b4fe360f | 1 year ago |
Aaron Rainbolt | e9e1a134e3 | 1 year ago |
Aaron Rainbolt | 252f96308a | 1 year ago |
Aaron Rainbolt | 2433e53536 | 1 year ago |
Simon Quigley | adcfbd486a | 1 year ago |
Simon Quigley | a0a7a4b7c1 | 1 year ago |
Simon Quigley | a81ba8b39a | 1 year ago |
Simon Quigley | ba24636c89 | 1 year ago |
Simon Quigley | d52449ad89 | 1 year ago |
Simon Quigley | 6ec9faea73 | 1 year ago |
Simon Quigley | 174f42d141 | 1 year ago |
Simon Quigley | da8184d511 | 2 years ago |
Simon Quigley | f5a0640c17 | 2 years ago |
Simon Quigley | 70c8b521bd | 2 years ago |
Simon Quigley | e0dc8d84fc | 2 years ago |
Simon Quigley | 38563c20e0 | 2 years ago |
Simon Quigley | d9da7ba361 | 2 years ago |
Simon Quigley | 8cec5002f0 | 2 years ago |
Simon Quigley | fdeb611940 | 2 years ago |
Simon Quigley | aa5018171a | 2 years ago |
Simon Quigley | b9f50f4508 | 2 years ago |
Simon Quigley | 6f89289577 | 2 years ago |
apt-ghetto | a3d83aa002 | 3 years ago |
Raman Sarda | e522e9d204 | 4 years ago |
Simon Quigley | ce2e26bf88 | 5 years ago |
Simon Quigley | 136c14cfbf | 5 years ago |
Simon Quigley | 1d0b25fb9f | 5 years ago |
Simon Quigley | 6888335e13 | 5 years ago |
Simon Quigley | b856aa8ac2 | 5 years ago |
Simon Quigley | 3faf1e4180 | 5 years ago |
Simon Quigley | 9bc13f2c07 | 5 years ago |
Simon Quigley | 00abd429dd | 6 years ago |
Simon Quigley | 53042f8a0e | 6 years ago |
Simon Quigley | 2019965763 | 6 years ago |
Simon Quigley | 687bcb25eb | 6 years ago |
Simon Quigley | 2e5c61f0fd | 6 years ago |
Simon Quigley | f940770c41 | 6 years ago |
Simon Quigley | b135ae2d50 | 6 years ago |
Simon Quigley | 8c52dd6981 | 6 years ago |
Simon Quigley | fe5220e2ec | 6 years ago |
Simon Quigley | bf55320b25 | 6 years ago |
Simon Quigley | 54b73cb4c8 | 6 years ago |
Simon Quigley | 486282e1fe | 6 years ago |
Simon Quigley | e223755613 | 6 years ago |
Simon Quigley | ae3e0d2148 | 6 years ago |
Simon Quigley | 1b2be5bf1a | 6 years ago |
Simon Quigley | a981c13191 | 6 years ago |
Simon Quigley | de71e1d6d9 | 6 years ago |
Simon Quigley | 00959e0068 | 6 years ago |
@ -1 +0,0 @@
|
||||
11
|
@ -1,15 +1,15 @@
|
||||
# there will be no man-pages in a foreseeable future
|
||||
lxqt-config: binary-without-manpage usr/bin/lxqt-config-brightness
|
||||
lxqt-config: binary-without-manpage usr/bin/lxqt-config-file-associations
|
||||
lxqt-config: binary-without-manpage usr/bin/lxqt-config-input
|
||||
lxqt-config: binary-without-manpage usr/bin/lxqt-config-locale
|
||||
lxqt-config: binary-without-manpage usr/bin/lxqt-config-monitor
|
||||
lxqt-config: no-manual-page [usr/bin/lxqt-config-brightness]
|
||||
lxqt-config: no-manual-page [usr/bin/lxqt-config-file-associations]
|
||||
lxqt-config: no-manual-page [usr/bin/lxqt-config-input]
|
||||
lxqt-config: no-manual-page [usr/bin/lxqt-config-locale]
|
||||
lxqt-config: no-manual-page [usr/bin/lxqt-config-monitor]
|
||||
|
||||
# not a bug, LXQt has not reached free-desktop yet
|
||||
lxqt-config: desktop-entry-invalid-category LXQt usr/share/applications/lxqt-config-appearance.desktop
|
||||
lxqt-config: desktop-entry-invalid-category LXQt usr/share/applications/lxqt-config-brightness.desktop
|
||||
lxqt-config: desktop-entry-invalid-category LXQt usr/share/applications/lxqt-config-file-associations.desktop
|
||||
lxqt-config: desktop-entry-invalid-category LXQt usr/share/applications/lxqt-config-input.desktop
|
||||
lxqt-config: desktop-entry-invalid-category LXQt usr/share/applications/lxqt-config-locale.desktop
|
||||
lxqt-config: desktop-entry-invalid-category LXQt usr/share/applications/lxqt-config-monitor.desktop
|
||||
lxqt-config: desktop-entry-invalid-category LXQt usr/share/applications/lxqt-config.desktop
|
||||
lxqt-config: desktop-entry-invalid-category LXQt [usr/share/applications/lxqt-config-appearance.desktop]
|
||||
lxqt-config: desktop-entry-invalid-category LXQt [usr/share/applications/lxqt-config-brightness.desktop]
|
||||
lxqt-config: desktop-entry-invalid-category LXQt [usr/share/applications/lxqt-config-file-associations.desktop]
|
||||
lxqt-config: desktop-entry-invalid-category LXQt [usr/share/applications/lxqt-config-input.desktop]
|
||||
lxqt-config: desktop-entry-invalid-category LXQt [usr/share/applications/lxqt-config-locale.desktop]
|
||||
lxqt-config: desktop-entry-invalid-category LXQt [usr/share/applications/lxqt-config-monitor.desktop]
|
||||
lxqt-config: desktop-entry-invalid-category LXQt [usr/share/applications/lxqt-config.desktop]
|
||||
|
@ -0,0 +1,8 @@
|
||||
usr/share/lxqt/translations/lxqt-config
|
||||
usr/share/lxqt/translations/lxqt-config-appearance
|
||||
usr/share/lxqt/translations/lxqt-config-brightness
|
||||
usr/share/lxqt/translations/lxqt-config-cursor
|
||||
usr/share/lxqt/translations/lxqt-config-file-associations
|
||||
usr/share/lxqt/translations/lxqt-config-input
|
||||
usr/share/lxqt/translations/lxqt-config-locale
|
||||
usr/share/lxqt/translations/lxqt-config-monitor
|
@ -0,0 +1,17 @@
|
||||
usr/bin/lxqt-config
|
||||
usr/bin/lxqt-config-appearance
|
||||
usr/bin/lxqt-config-brightness
|
||||
usr/bin/lxqt-config-file-associations
|
||||
usr/bin/lxqt-config-input
|
||||
usr/bin/lxqt-config-locale
|
||||
usr/bin/lxqt-config-monitor
|
||||
usr/lib/*/lxqt-config/liblxqt-config-cursor.so
|
||||
usr/share/applications/lxqt-config-appearance.desktop
|
||||
usr/share/applications/lxqt-config-brightness.desktop
|
||||
usr/share/applications/lxqt-config-file-associations.desktop
|
||||
usr/share/applications/lxqt-config-input.desktop
|
||||
usr/share/applications/lxqt-config-locale.desktop
|
||||
usr/share/applications/lxqt-config-monitor.desktop
|
||||
usr/share/applications/lxqt-config.desktop
|
||||
usr/share/icons/hicolor/48x48/apps/brightnesssettings.svg
|
||||
usr/share/lxqt/icons/monitor.svg
|
@ -0,0 +1,4 @@
|
||||
# This is expected
|
||||
lxqt-config: desktop-entry-lacks-keywords-entry [usr/share/applications/*.desktop]
|
||||
lxqt-config: desktop-entry-invalid-category LXQt [usr/share/applications/*.desktop]
|
||||
lxqt-config: no-manual-page [usr/bin/*]
|
@ -1,3 +1,3 @@
|
||||
liblxqt-config-cursor/man/lxqt-config-mouse.1
|
||||
lxqt-config-appearance/man/lxqt-config-appearance.1
|
||||
man/lxqt-config.1
|
||||
usr/share/man/man1/lxqt-config-appearance.1
|
||||
usr/share/man/man1/lxqt-config-mouse.1
|
||||
usr/share/man/man1/lxqt-config.1
|
||||
|
@ -1,853 +0,0 @@
|
||||
Description: Add the ability to set GTK themes
|
||||
Author: P.L. Lucas <selairi@gmail.com>
|
||||
Origin: upstream
|
||||
Applied-Upstream: https://github.com/lxqt/lxqt-config/pull/244
|
||||
Last-Update: 2018-07-30
|
||||
--- a/lxqt-config-appearance/CMakeLists.txt
|
||||
+++ b/lxqt-config-appearance/CMakeLists.txt
|
||||
@@ -15,6 +15,7 @@ set(MOC_FILES
|
||||
fontsconfig.h
|
||||
styleconfig.h
|
||||
fontconfigfile.h
|
||||
+ configothertoolkits.h
|
||||
)
|
||||
|
||||
set(CPP_FILES
|
||||
@@ -25,6 +26,7 @@ set(CPP_FILES
|
||||
fontsconfig.cpp
|
||||
styleconfig.cpp
|
||||
fontconfigfile.cpp
|
||||
+ configothertoolkits.cpp
|
||||
)
|
||||
|
||||
set(UI_FILES
|
||||
--- /dev/null
|
||||
+++ b/lxqt-config-appearance/configothertoolkits.cpp
|
||||
@@ -0,0 +1,329 @@
|
||||
+/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
+ * (c)LGPL2+
|
||||
+ *
|
||||
+ * LXQt - a lightweight, Qt based, desktop toolset
|
||||
+ * https://lxqt.org/
|
||||
+ *
|
||||
+ * Copyright: 2018 LXQt team
|
||||
+ *
|
||||
+ * This program or library is free software; you can redistribute it
|
||||
+ * and/or modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+
|
||||
+ * You should have received a copy of the GNU Lesser General
|
||||
+ * Public License along with this library; if not, write to the
|
||||
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
+ * Boston, MA 02110-1301 USA
|
||||
+ *
|
||||
+ * END_COMMON_COPYRIGHT_HEADER */
|
||||
+
|
||||
+#include "configothertoolkits.h"
|
||||
+#include <QFile>
|
||||
+#include <QTextStream>
|
||||
+#include <QStandardPaths>
|
||||
+#include <QMetaEnum>
|
||||
+#include <QToolBar>
|
||||
+#include <QDir>
|
||||
+#include <QFileInfo>
|
||||
+#include <QFont>
|
||||
+#include <QDateTime>
|
||||
+#include <QMessageBox>
|
||||
+
|
||||
+#include <sys/types.h>
|
||||
+#include <signal.h>
|
||||
+
|
||||
+static const char *GTK2_CONFIG = R"GTK2_CONFIG(
|
||||
+# Created by lxqt-config-appearance (DO NOT EDIT!)
|
||||
+gtk-theme-name = "%1"
|
||||
+gtk-icon-theme-name = "%2"
|
||||
+gtk-font-name = "%3"
|
||||
+gtk-button-images = %4
|
||||
+gtk-menu-images = %4
|
||||
+gtk-toolbar-style = %5
|
||||
+)GTK2_CONFIG";
|
||||
+
|
||||
+static const char *GTK3_CONFIG = R"GTK3_CONFIG(
|
||||
+# Created by lxqt-config-appearance (DO NOT EDIT!)
|
||||
+[Settings]
|
||||
+gtk-theme-name = %1
|
||||
+gtk-icon-theme-name = %2
|
||||
+# GTK3 ignores bold or italic attributes.
|
||||
+gtk-font-name = %3
|
||||
+gtk-menu-images = %4
|
||||
+gtk-button-images = %4
|
||||
+gtk-toolbar-style = %5
|
||||
+)GTK3_CONFIG";
|
||||
+
|
||||
+static const char *XSETTINGS_CONFIG = R"XSETTINGS_CONFIG(
|
||||
+# Created by lxqt-config-appearance (DO NOT EDIT!)
|
||||
+Net/IconThemeName "%2"
|
||||
+Net/ThemeName "%1"
|
||||
+Gtk/FontName "%3"
|
||||
+Gtk/MenuImages %4
|
||||
+Gtk/ButtonImages %4
|
||||
+Gtk/ToolbarStyle "%5"
|
||||
+)XSETTINGS_CONFIG";
|
||||
+
|
||||
+ConfigOtherToolKits::ConfigOtherToolKits(LXQt::Settings *settings, LXQt::Settings *configAppearanceSettings, QObject *parent) : QObject(parent)
|
||||
+{
|
||||
+ mSettings = settings;
|
||||
+ mConfigAppearanceSettings = configAppearanceSettings;
|
||||
+ if(tempFile.open()) {
|
||||
+ mXsettingsdProc.setProcessChannelMode(QProcess::ForwardedChannels);
|
||||
+ mXsettingsdProc.start("xsettingsd", QStringList() << "-c" << tempFile.fileName());
|
||||
+ if(!mXsettingsdProc.waitForStarted())
|
||||
+ return;
|
||||
+ tempFile.close();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+ConfigOtherToolKits::~ConfigOtherToolKits()
|
||||
+{
|
||||
+ mXsettingsdProc.close();
|
||||
+}
|
||||
+
|
||||
+static QString get_environment_var(const char *envvar, const char *defaultValue)
|
||||
+{
|
||||
+ QString homeDir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||
+ QString mDirPath = QString::fromLocal8Bit(qgetenv(envvar));
|
||||
+ if(mDirPath.isEmpty())
|
||||
+ mDirPath = homeDir + defaultValue;
|
||||
+ else {
|
||||
+ for(QString path : mDirPath.split(":") ) {
|
||||
+ mDirPath = path;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ return mDirPath;
|
||||
+}
|
||||
+
|
||||
+static QString _get_config_path(QString path)
|
||||
+{
|
||||
+ QString homeDir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||
+ path.replace("$XDG_CONFIG_HOME", get_environment_var("XDG_CONFIG_HOME", "/.config"));
|
||||
+ path.replace("$GTK2_RC_FILES", get_environment_var("GTK2_RC_FILES", "/.gtkrc-2.0")); // If $GTK2_RC_FILES is undefined, "~/.gtkrc-2.0" will be used.
|
||||
+ path.replace("~", homeDir);
|
||||
+ return path;
|
||||
+}
|
||||
+
|
||||
+QString ConfigOtherToolKits::getGTKConfigPath(QString version)
|
||||
+{
|
||||
+ if(version == "2.0")
|
||||
+ return _get_config_path("$GTK2_RC_FILES");
|
||||
+ return _get_config_path(QString("$XDG_CONFIG_HOME/gtk-%1/settings.ini").arg(version));
|
||||
+}
|
||||
+
|
||||
+static bool grep(QFile &file, QByteArray text)
|
||||
+{
|
||||
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
+ return false;
|
||||
+ while (!file.atEnd()) {
|
||||
+ QByteArray line = file.readLine().trimmed();
|
||||
+ if(line.startsWith(text)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ file.close();
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+bool ConfigOtherToolKits::backupGTKSettings(QString version)
|
||||
+{
|
||||
+ QString gtkrcPath = getGTKConfigPath(version);
|
||||
+ QFile file(gtkrcPath);
|
||||
+ if(file.exists() && !grep(file, "# Created by lxqt-config-appearance (DO NOT EDIT!)")) {
|
||||
+ QString backupPath = gtkrcPath + "-" + QString::number(QDateTime::currentSecsSinceEpoch()) + "~";
|
||||
+ file.copy(backupPath);
|
||||
+ QMessageBox::warning(nullptr, tr("GTK themes"),
|
||||
+ tr("<p>'%1' has been overwritten.</p><p>You can find a copy of your old settings in '%2'</p>")
|
||||
+ .arg(getGTKConfigPath(version))
|
||||
+ .arg(backupPath)
|
||||
+ , QMessageBox::Ok);
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+void ConfigOtherToolKits::setConfig()
|
||||
+{
|
||||
+ if(!mConfigAppearanceSettings->contains("ControlGTKThemeEnabled"))
|
||||
+ mConfigAppearanceSettings->setValue("ControlGTKThemeEnabled", false);
|
||||
+ bool controlGTKThemeEnabled = mConfigAppearanceSettings->value("ControlGTKThemeEnabled").toBool();
|
||||
+ if(! controlGTKThemeEnabled)
|
||||
+ return;
|
||||
+ updateConfigFromSettings();
|
||||
+ mConfig.styleTheme = getGTKThemeFromRCFile("3.0");
|
||||
+ setGTKConfig("3.0");
|
||||
+ mConfig.styleTheme = getGTKThemeFromRCFile("2.0");
|
||||
+ setGTKConfig("2.0");
|
||||
+ setXSettingsConfig();
|
||||
+}
|
||||
+
|
||||
+void ConfigOtherToolKits::setXSettingsConfig()
|
||||
+{
|
||||
+ // setGTKConfig is called before calling setXSettingsConfig,
|
||||
+ // then updateConfigFromSettings is not required.
|
||||
+ //updateConfigFromSettings();
|
||||
+ //mConfig.styleTheme = getGTKThemeFromRCFile(version);
|
||||
+
|
||||
+ // Reload settings. xsettingsd must be installed.
|
||||
+ // xsettingsd settings are written to stdin.
|
||||
+ if(QProcess::Running == mXsettingsdProc.state()) {
|
||||
+ QFile file(tempFile.fileName());
|
||||
+ if(file.open(QIODevice::WriteOnly)) {
|
||||
+ file.write( getConfig(XSETTINGS_CONFIG).toLocal8Bit() );
|
||||
+ file.flush();
|
||||
+ file.close();
|
||||
+ }
|
||||
+ int pid = mXsettingsdProc.processId();
|
||||
+ kill(pid, SIGHUP);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void ConfigOtherToolKits::setGTKConfig(QString version, QString theme)
|
||||
+{
|
||||
+ updateConfigFromSettings();
|
||||
+ if(!theme.isEmpty())
|
||||
+ mConfig.styleTheme = theme;
|
||||
+ backupGTKSettings(version);
|
||||
+ QString gtkrcPath = getGTKConfigPath(version);
|
||||
+ if(version == "2.0")
|
||||
+ writeConfig(gtkrcPath, GTK2_CONFIG);
|
||||
+ else
|
||||
+ writeConfig(gtkrcPath, GTK3_CONFIG);
|
||||
+}
|
||||
+
|
||||
+QString ConfigOtherToolKits::getConfig(const char *configString)
|
||||
+{
|
||||
+ return QString(configString).arg(mConfig.styleTheme, mConfig.iconTheme,
|
||||
+ mConfig.fontName, mConfig.buttonStyle==0 ? "0":"1",
|
||||
+ mConfig.toolButtonStyle
|
||||
+ );
|
||||
+}
|
||||
+
|
||||
+void ConfigOtherToolKits::writeConfig(QString path, const char *configString)
|
||||
+{
|
||||
+ path = _get_config_path(path);
|
||||
+
|
||||
+ QFile file(path);
|
||||
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ QTextStream out(&file);
|
||||
+ out << getConfig(configString);
|
||||
+ out.flush();
|
||||
+ file.close();
|
||||
+}
|
||||
+
|
||||
+QStringList ConfigOtherToolKits::getGTKThemes(QString version)
|
||||
+{
|
||||
+ QStringList themeList;
|
||||
+ QString configFile = version=="2.0" ? "gtk-2.0/gtkrc" : QString("gtk-%1/gtk.css").arg(version);
|
||||
+
|
||||
+ QStringList dataPaths = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
|
||||
+ for(QString dataPath : dataPaths) {
|
||||
+ QDir themesPath(dataPath + "/themes");
|
||||
+ QStringList themes = themesPath.entryList(QDir::Dirs);
|
||||
+ for(QString theme : themes) {
|
||||
+ QFileInfo themePath(QString("%1/themes/%2/%3").arg(dataPath, theme, configFile));
|
||||
+ if(themePath.exists())
|
||||
+ themeList.append(theme);
|
||||
+ }
|
||||
+ }
|
||||
+ return themeList;
|
||||
+}
|
||||
+
|
||||
+QString ConfigOtherToolKits::getGTKThemeFromRCFile(QString version)
|
||||
+{
|
||||
+ if(version == "2.0") {
|
||||
+ QString gtkrcPath = _get_config_path("$GTK2_RC_FILES");
|
||||
+ QFile file(gtkrcPath);
|
||||
+ if(file.exists()) {
|
||||
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
+ return QString();
|
||||
+ while (!file.atEnd()) {
|
||||
+ QByteArray line = file.readLine().trimmed();
|
||||
+ if(line.startsWith("gtk-theme-name")) {
|
||||
+ QList<QByteArray> parts = line.split('=');
|
||||
+ if(parts.size()>=2) {
|
||||
+ file.close();
|
||||
+ return parts[1].replace('"', "").trimmed();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ file.close();
|
||||
+ }
|
||||
+ } else {
|
||||
+ QString gtkrcPath = _get_config_path(QString("$XDG_CONFIG_HOME/gtk-%1/settings.ini").arg(version));
|
||||
+ QFile file(gtkrcPath);
|
||||
+ if(file.exists()) {
|
||||
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
+ return QString();
|
||||
+ bool settingsFound = false;
|
||||
+ while (!file.atEnd()) {
|
||||
+ QByteArray line = file.readLine().trimmed();
|
||||
+ if(line.startsWith("[Settings]"))
|
||||
+ settingsFound = true;
|
||||
+ else if(line.startsWith("[") && line.endsWith("]"))
|
||||
+ settingsFound = false;
|
||||
+ else if(settingsFound && line.startsWith("gtk-theme-name")) {
|
||||
+ QList<QByteArray> parts = line.split('=');
|
||||
+ if(parts.size()>=2) {
|
||||
+ file.close();
|
||||
+ return parts[1].trimmed();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ file.close();
|
||||
+ }
|
||||
+ }
|
||||
+ return QString();
|
||||
+}
|
||||
+
|
||||
+void ConfigOtherToolKits::updateConfigFromSettings()
|
||||
+{
|
||||
+ mSettings->beginGroup(QLatin1String("Qt"));
|
||||
+ QFont font;
|
||||
+ font.fromString(mSettings->value("font").toString());
|
||||
+ // Font name from: https://developer.gnome.org/pango/stable/pango-Fonts.html#pango-font-description-from-string
|
||||
+ // FAMILY-LIST [SIZE]", where FAMILY-LIST is a comma separated list of families optionally terminated by a comma,
|
||||
+ // STYLE_OPTIONS is a whitespace separated list of words where each word describes one of style, variant, weight, stretch, or gravity, and
|
||||
+ // SIZE is a decimal number (size in points) or optionally followed by the unit modifier "px" for absolute size.
|
||||
+ mConfig.fontName = QString("%1%2%3 %4")
|
||||
+ .arg(font.family()) //%1
|
||||
+ .arg(font.style()==QFont::StyleNormal?"":" Italic") //%2
|
||||
+ .arg(font.weight()==QFont::Normal?"":" Bold") //%3
|
||||
+ .arg(font.pointSize()); //%4
|
||||
+ mSettings->endGroup();
|
||||
+
|
||||
+ mConfig.iconTheme = mSettings->value("icon_theme").toString();
|
||||
+ {
|
||||
+ // Tool button style
|
||||
+ QByteArray tb_style = mSettings->value("tool_button_style").toByteArray();
|
||||
+ // convert toolbar style name to value
|
||||
+ QMetaEnum me = QToolBar::staticMetaObject.property(QToolBar::staticMetaObject.indexOfProperty("toolButtonStyle")).enumerator();
|
||||
+ int val = me.keyToValue(tb_style.constData());
|
||||
+ mConfig.buttonStyle = 1;
|
||||
+ switch(val) {
|
||||
+ case Qt::ToolButtonIconOnly:
|
||||
+ mConfig.toolButtonStyle = "GTK_TOOLBAR_ICONS";
|
||||
+ break;
|
||||
+ case Qt::ToolButtonTextOnly:
|
||||
+ mConfig.toolButtonStyle = "GTK_TOOLBAR_TEXT";
|
||||
+ mConfig.buttonStyle = 0;
|
||||
+ break;
|
||||
+ case Qt::ToolButtonTextUnderIcon:
|
||||
+ mConfig.toolButtonStyle = "GTK_TOOLBAR_BOTH";
|
||||
+ break;
|
||||
+ default:
|
||||
+ mConfig.toolButtonStyle = "GTK_TOOLBAR_BOTH_HORIZ";
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
--- /dev/null
|
||||
+++ b/lxqt-config-appearance/configothertoolkits.h
|
||||
@@ -0,0 +1,70 @@
|
||||
+/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
+ * (c)LGPL2+
|
||||
+ *
|
||||
+ * LXQt - a lightweight, Qt based, desktop toolset
|
||||
+ * https://lxqt.org
|
||||
+ *
|
||||
+ * Copyright: 2018 LXQt team
|
||||
+ *
|
||||
+ * This program or library is free software; you can redistribute it
|
||||
+ * and/or modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+
|
||||
+ * You should have received a copy of the GNU Lesser General
|
||||
+ * Public License along with this library; if not, write to the
|
||||
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
+ * Boston, MA 02110-1301 USA
|
||||
+ *
|
||||
+ * END_COMMON_COPYRIGHT_HEADER */
|
||||
+
|
||||
+#ifndef CONFIGOTHERTOOLKITS_H
|
||||
+#define CONFIGOTHERTOOLKITS_H
|
||||
+
|
||||
+#include <QWidget>
|
||||
+#include <QProcess>
|
||||
+#include <QTemporaryFile>
|
||||
+#include <LXQt/Settings>
|
||||
+
|
||||
+class ConfigOtherToolKits : public QObject
|
||||
+{
|
||||
+ Q_OBJECT
|
||||
+
|
||||
+public:
|
||||
+ ConfigOtherToolKits(LXQt::Settings *settings, LXQt::Settings *configAppearanceSettings, QObject *parent = 0);
|
||||
+ ~ConfigOtherToolKits();
|
||||
+ QStringList getGTKThemes(QString version);
|
||||
+ QString getGTKThemeFromRCFile(QString version);
|
||||
+ QString getGTKConfigPath(QString version);
|
||||
+ bool backupGTKSettings(QString version);
|
||||
+
|
||||
+public slots:
|
||||
+ void setConfig();
|
||||
+ void setXSettingsConfig();
|
||||
+ void setGTKConfig(QString version, QString theme = QString());
|
||||
+
|
||||
+private:
|
||||
+ struct Config {
|
||||
+ QString iconTheme;
|
||||
+ QString styleTheme;
|
||||
+ QString fontName;
|
||||
+ QString toolButtonStyle;
|
||||
+ int buttonStyle;
|
||||
+ } mConfig;
|
||||
+ void writeConfig(QString path, const char *configString);
|
||||
+ QString getConfig(const char *configString);
|
||||
+ void updateConfigFromSettings();
|
||||
+
|
||||
+ LXQt::Settings *mSettings;
|
||||
+ LXQt::Settings *mConfigAppearanceSettings;
|
||||
+
|
||||
+ QProcess mXsettingsdProc;
|
||||
+ QTemporaryFile tempFile;
|
||||
+};
|
||||
+
|
||||
+#endif // CONFIGOTHERTOOLKITS_H
|
||||
--- a/lxqt-config-appearance/fontconfigfile.h
|
||||
+++ b/lxqt-config-appearance/fontconfigfile.h
|
||||
@@ -64,6 +64,7 @@ public:
|
||||
}
|
||||
void setAutohint(bool value);
|
||||
|
||||
+
|
||||
private Q_SLOTS:
|
||||
void save();
|
||||
|
||||
--- a/lxqt-config-appearance/fontsconfig.cpp
|
||||
+++ b/lxqt-config-appearance/fontsconfig.cpp
|
||||
@@ -188,6 +188,8 @@ void FontsConfig::updateQtFont()
|
||||
mQtSettings->endGroup();
|
||||
mQtSettings->sync();
|
||||
|
||||
+ emit updateSettings();
|
||||
+
|
||||
#ifdef Q_WS_X11
|
||||
qt_x11_apply_settings_in_all_apps();
|
||||
#endif
|
||||
--- a/lxqt-config-appearance/fontsconfig.h
|
||||
+++ b/lxqt-config-appearance/fontsconfig.h
|
||||
@@ -51,6 +51,9 @@ public:
|
||||
public Q_SLOTS:
|
||||
void initControls();
|
||||
|
||||
+signals:
|
||||
+ void updateSettings();
|
||||
+
|
||||
private Q_SLOTS:
|
||||
void updateQtFont();
|
||||
void antialiasToggled(bool toggled);
|
||||
--- a/lxqt-config-appearance/iconthemeconfig.cpp
|
||||
+++ b/lxqt-config-appearance/iconthemeconfig.cpp
|
||||
@@ -151,5 +151,7 @@ void IconThemeConfig::iconThemeSelected(
|
||||
|
||||
m_settings->setValue("icon_theme", theme);
|
||||
m_settings->sync();
|
||||
+
|
||||
+ emit updateSettings();
|
||||
}
|
||||
}
|
||||
--- a/lxqt-config-appearance/iconthemeconfig.h
|
||||
+++ b/lxqt-config-appearance/iconthemeconfig.h
|
||||
@@ -51,6 +51,9 @@ private:
|
||||
public slots:
|
||||
void initControls();
|
||||
|
||||
+signals:
|
||||
+ void updateSettings();
|
||||
+
|
||||
private slots:
|
||||
void iconThemeSelected(QTreeWidgetItem *item, int column);
|
||||
};
|
||||
--- a/lxqt-config-appearance/main.cpp
|
||||
+++ b/lxqt-config-appearance/main.cpp
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "lxqtthemeconfig.h"
|
||||
#include "styleconfig.h"
|
||||
#include "fontsconfig.h"
|
||||
+#include "configothertoolkits.h"
|
||||
|
||||
#include "../liblxqt-config-cursor/selectwnd.h"
|
||||
|
||||
@@ -58,14 +59,19 @@ int main (int argc, char **argv)
|
||||
|
||||
app.setActivationWindow(dialog);
|
||||
|
||||
+ LXQt::Settings mConfigAppearanceSettings("lxqt-config-appearance");
|
||||
+ ConfigOtherToolKits *configOtherToolKits = new ConfigOtherToolKits(settings, &mConfigAppearanceSettings, dialog);
|
||||
+
|
||||
QSettings& qtSettings = *settings; // use lxqt config file for Qt settings in Qt5.
|
||||
- StyleConfig* stylePage = new StyleConfig(settings, &qtSettings, dialog);
|
||||
+ StyleConfig* stylePage = new StyleConfig(settings, &qtSettings, &mConfigAppearanceSettings, configOtherToolKits, dialog);
|
||||
dialog->addPage(stylePage, QObject::tr("Widget Style"), QStringList() << "preferences-desktop-theme" << "preferences-desktop");
|
||||
QObject::connect(dialog, SIGNAL(reset()), stylePage, SLOT(initControls()));
|
||||
+ QObject::connect(stylePage, SIGNAL(updateSettings()), configOtherToolKits, SLOT(setConfig()));
|
||||
|
||||
IconThemeConfig* iconPage = new IconThemeConfig(settings, dialog);
|
||||
dialog->addPage(iconPage, QObject::tr("Icons Theme"), QStringList() << "preferences-desktop-icons" << "preferences-desktop");
|
||||
QObject::connect(dialog, SIGNAL(reset()), iconPage, SLOT(initControls()));
|
||||
+ QObject::connect(iconPage, SIGNAL(updateSettings()), configOtherToolKits, SLOT(setConfig()));
|
||||
|
||||
LXQtThemeConfig* themePage = new LXQtThemeConfig(settings, dialog);
|
||||
dialog->addPage(themePage, QObject::tr("LXQt Theme"), QStringList() << "preferences-desktop-color" << "preferences-desktop");
|
||||
@@ -74,6 +80,7 @@ int main (int argc, char **argv)
|
||||
FontsConfig* fontsPage = new FontsConfig(settings, &qtSettings, dialog);
|
||||
dialog->addPage(fontsPage, QObject::tr("Font"), QStringList() << "preferences-desktop-font" << "preferences-desktop");
|
||||
QObject::connect(dialog, SIGNAL(reset()), fontsPage, SLOT(initControls()));
|
||||
+ QObject::connect(fontsPage, SIGNAL(updateSettings()), configOtherToolKits, SLOT(setConfig()));
|
||||
|
||||
SelectWnd* cursorPage = new SelectWnd(sessionSettings, dialog);
|
||||
cursorPage->setCurrent();
|
||||
--- a/lxqt-config-appearance/styleconfig.cpp
|
||||
+++ b/lxqt-config-appearance/styleconfig.cpp
|
||||
@@ -41,25 +41,23 @@
|
||||
extern void qt_x11_apply_settings_in_all_apps();
|
||||
#endif
|
||||
|
||||
-StyleConfig::StyleConfig(LXQt::Settings* settings, QSettings* qtSettings, QWidget* parent) :
|
||||
+StyleConfig::StyleConfig(LXQt::Settings* settings, QSettings* qtSettings, LXQt::Settings *configAppearanceSettings, ConfigOtherToolKits *configOtherToolKits, QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::StyleConfig),
|
||||
mQtSettings(qtSettings),
|
||||
mSettings(settings)
|
||||
{
|
||||
+ mConfigAppearanceSettings = configAppearanceSettings;
|
||||
+ mConfigOtherToolKits = configOtherToolKits;
|
||||
ui->setupUi(this);
|
||||
|
||||
- connect(ui->styleList, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
|
||||
- this, SLOT(styleSelected(QTreeWidgetItem*,int)));
|
||||
+ initControls();
|
||||
|
||||
- const auto keys = QStyleFactory::keys();
|
||||
- for(const QString& name : keys)
|
||||
- {
|
||||
- QTreeWidgetItem *item = new QTreeWidgetItem(QStringList(name));
|
||||
- ui->styleList->addTopLevelItem(item);
|
||||
- }
|
||||
+ connect(ui->gtk2ComboBox, SIGNAL(activated(const QString &)), this, SLOT(gtk2StyleSelected(const QString &)));
|
||||
+ connect(ui->gtk3ComboBox, SIGNAL(activated(const QString &)), this, SLOT(gtk3StyleSelected(const QString &)));
|
||||
+ connect(ui->qtComboBox, SIGNAL(activated(const QString &)), this, SLOT(qtStyleSelected(const QString &)));
|
||||
|
||||
- initControls();
|
||||
+ connect(ui->advancedOptionsGroupBox, SIGNAL(toggled(bool)), this, SLOT(showAdvancedOptions(bool)));
|
||||
|
||||
connect(ui->toolButtonStyle, SIGNAL(currentIndexChanged(int)), SLOT(toolButtonStyleSelected(int)));
|
||||
connect(ui->singleClickActivate, SIGNAL(toggled(bool)), SLOT(singleClickActivateToggled(bool)));
|
||||
@@ -74,22 +72,20 @@ StyleConfig::~StyleConfig()
|
||||
|
||||
void StyleConfig::initControls()
|
||||
{
|
||||
- // read Qt style settings from Qt Trolltech.conf config
|
||||
- mQtSettings->beginGroup(QLatin1String("Qt"));
|
||||
- QString currentTheme = mQtSettings->value("style").toString();
|
||||
- mQtSettings->endGroup();
|
||||
|
||||
- QTreeWidgetItemIterator it(ui->styleList);
|
||||
- while (*it) {
|
||||
- if ((*it)->data(0, Qt::DisplayRole).toString() == currentTheme)
|
||||
- {
|
||||
- ui->styleList->setCurrentItem((*it));
|
||||
- break;
|
||||
- }
|
||||
- ++it;
|
||||
- }
|
||||
+ // Fill global themes
|
||||
+ QStringList qtThemes = QStyleFactory::keys();
|
||||
+ QStringList gtk2Themes = mConfigOtherToolKits->getGTKThemes("2.0");
|
||||
+ QStringList gtk3Themes = mConfigOtherToolKits->getGTKThemes("3.0");
|
||||
+
|
||||
+ if(!mConfigAppearanceSettings->contains("ControlGTKThemeEnabled"))
|
||||
+ mConfigAppearanceSettings->setValue("ControlGTKThemeEnabled", false);
|
||||
+ bool controlGTKThemeEnabled = mConfigAppearanceSettings->value("ControlGTKThemeEnabled").toBool();
|
||||
+
|
||||
+ showAdvancedOptions(controlGTKThemeEnabled);
|
||||
+ ui->advancedOptionsGroupBox->setChecked(controlGTKThemeEnabled);
|
||||
|
||||
- // read other widget related settings form LXQt settings.
|
||||
+ // read other widget related settings from LXQt settings.
|
||||
QByteArray tb_style = mSettings->value("tool_button_style").toByteArray();
|
||||
// convert toolbar style name to value
|
||||
QMetaEnum me = QToolBar::staticMetaObject.property(QToolBar::staticMetaObject.indexOfProperty("toolButtonStyle")).enumerator();
|
||||
@@ -101,24 +97,21 @@ void StyleConfig::initControls()
|
||||
// activate item views with single click
|
||||
ui->singleClickActivate->setChecked( mSettings->value("single_click_activate", false).toBool());
|
||||
|
||||
- update();
|
||||
-}
|
||||
|
||||
+ // Fill Qt themes
|
||||
+ ui->qtComboBox->addItems(qtThemes);
|
||||
|
||||
-void StyleConfig::styleSelected(QTreeWidgetItem* item, int column)
|
||||
-{
|
||||
- Q_UNUSED(column);
|
||||
- if (!item)
|
||||
- return;
|
||||
- QVariant themeName = item->data(0, Qt::DisplayRole);
|
||||
- mQtSettings->beginGroup(QLatin1String("Qt"));
|
||||
- mQtSettings->setValue("style", themeName);
|
||||
- mQtSettings->endGroup();
|
||||
- mQtSettings->sync();
|
||||
+ // Fill GTK themes
|
||||
+ ui->gtk2ComboBox->addItems(gtk2Themes);
|
||||
+ ui->gtk3ComboBox->addItems(gtk3Themes);
|
||||
+
|
||||
+ ui->gtk2ComboBox->setCurrentText(mConfigOtherToolKits->getGTKThemeFromRCFile("2.0"));
|
||||
+ ui->gtk3ComboBox->setCurrentText(mConfigOtherToolKits->getGTKThemeFromRCFile("3.0"));
|
||||
+ mSettings->beginGroup(QLatin1String("Qt"));
|
||||
+ ui->qtComboBox->setCurrentText(mSettings->value("style").toString());
|
||||
+ mSettings->endGroup();
|
||||
|
||||
-#ifdef Q_WS_X11
|
||||
- qt_x11_apply_settings_in_all_apps();
|
||||
-#endif
|
||||
+ update();
|
||||
}
|
||||
|
||||
void StyleConfig::toolButtonStyleSelected(int index)
|
||||
@@ -131,7 +124,8 @@ void StyleConfig::toolButtonStyleSelecte
|
||||
if(str)
|
||||
{
|
||||
mSettings->setValue("tool_button_style", str);
|
||||
- mSettings->sync();
|
||||
+ mSettings->sync();
|
||||
+ emit updateSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,3 +135,28 @@ void StyleConfig::singleClickActivateTog
|
||||
mSettings->sync();
|
||||
}
|
||||
|
||||
+void StyleConfig::qtStyleSelected(const QString &themeName)
|
||||
+{
|
||||
+ mQtSettings->beginGroup(QLatin1String("Qt"));
|
||||
+ mQtSettings->setValue("style", themeName);
|
||||
+ mQtSettings->endGroup();
|
||||
+ mQtSettings->sync();
|
||||
+}
|
||||
+
|
||||
+void StyleConfig::gtk3StyleSelected(const QString &themeName)
|
||||
+{
|
||||
+ mConfigOtherToolKits->setGTKConfig("3.0", themeName);
|
||||
+ mConfigOtherToolKits->setXSettingsConfig();
|
||||
+}
|
||||
+
|
||||
+void StyleConfig::gtk2StyleSelected(const QString &themeName)
|
||||
+{
|
||||
+ mConfigOtherToolKits->setGTKConfig("2.0", themeName);
|
||||
+ mConfigOtherToolKits->setXSettingsConfig();
|
||||
+}
|
||||
+
|
||||
+void StyleConfig::showAdvancedOptions(bool on)
|
||||
+{
|
||||
+ ui->uniformThemeLabel->setVisible(on);
|
||||
+ mConfigAppearanceSettings->setValue("ControlGTKThemeEnabled", on);
|
||||
+}
|
||||
--- a/lxqt-config-appearance/styleconfig.h
|
||||
+++ b/lxqt-config-appearance/styleconfig.h
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
#include <LXQt/Settings>
|
||||
+#include "configothertoolkits.h"
|
||||
|
||||
class QTreeWidgetItem;
|
||||
class QSettings;
|
||||
@@ -43,14 +44,24 @@ class StyleConfig : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
- explicit StyleConfig(LXQt::Settings *settings, QSettings *qtSettings, QWidget *parent = 0);
|
||||
+ explicit StyleConfig(LXQt::Settings *settings,
|
||||
+ QSettings *qtSettings, LXQt::Settings *configAppearanceSettings,
|
||||
+ ConfigOtherToolKits *configOtherToolKits, QWidget *parent = 0);
|
||||
~StyleConfig();
|
||||
|
||||
public slots:
|
||||
void initControls();
|
||||
|
||||
+signals:
|
||||
+ void updateSettings();
|
||||
+
|
||||
private slots:
|
||||
- void styleSelected(QTreeWidgetItem* item, int column);
|
||||
+ void gtk2StyleSelected(const QString &themeName);
|
||||
+ void gtk3StyleSelected(const QString &themeName);
|
||||
+ void qtStyleSelected(const QString &themeName);
|
||||
+
|
||||
+ void showAdvancedOptions(bool on);
|
||||
+
|
||||
void toolButtonStyleSelected(int index);
|
||||
void singleClickActivateToggled(bool toggled);
|
||||
|
||||
@@ -58,6 +69,8 @@ private:
|
||||
Ui::StyleConfig *ui;
|
||||
QSettings *mQtSettings;
|
||||
LXQt::Settings *mSettings;
|
||||
+ LXQt::Settings *mConfigAppearanceSettings;
|
||||
+ ConfigOtherToolKits *mConfigOtherToolKits;
|
||||
};
|
||||
|
||||
#endif // STYLECONFIG_H
|
||||
--- a/lxqt-config-appearance/styleconfig.ui
|
||||
+++ b/lxqt-config-appearance/styleconfig.ui
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
- <width>490</width>
|
||||
- <height>363</height>
|
||||
+ <width>609</width>
|
||||
+ <height>344</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
@@ -24,38 +24,83 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
- <item row="1" column="0" colspan="2">
|
||||
- <widget class="QTreeWidget" name="styleList">
|
||||
+ <item row="4" column="0" colspan="2">
|
||||
+ <widget class="QGroupBox" name="advancedOptionsGroupBox">
|
||||
<property name="sizePolicy">
|
||||
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
- <verstretch>1</verstretch>
|
||||
+ <verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
- <property name="alternatingRowColors">
|
||||
+ <property name="maximumSize">
|
||||
+ <size>
|
||||
+ <width>16777215</width>
|
||||
+ <height>16777215</height>
|
||||
+ </size>
|
||||
+ </property>
|
||||
+ <property name="title">
|
||||
+ <string>Set GTK themes (GTK configuration files will be overwritten!)</string>
|
||||
+ </property>
|
||||
+ <property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
- <property name="rootIsDecorated">
|
||||
+ <property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
- <attribute name="headerVisible">
|
||||
- <bool>false</bool>
|
||||
- </attribute>
|
||||
- <column>
|
||||
- <property name="text">
|
||||
- <string notr="true">1</string>
|
||||
- </property>
|
||||
- </column>
|
||||
+ <layout class="QVBoxLayout" name="verticalLayout">
|
||||
+ <item>
|
||||
+ <layout class="QFormLayout" name="formLayout_2">
|
||||
+ <item row="2" column="0">
|
||||
+ <widget class="QLabel" name="label_4">
|
||||
+ <property name="sizePolicy">
|
||||
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
+ <horstretch>0</horstretch>
|
||||
+ <verstretch>0</verstretch>
|
||||
+ </sizepolicy>
|
||||
+ </property>
|
||||
+ <property name="text">
|
||||
+ <string>GTK 3 Theme</string>
|
||||
+ </property>
|
||||
+ </widget>
|
||||
+ </item>
|
||||
+ <item row="2" column="1">
|
||||
+ <widget class="QComboBox" name="gtk3ComboBox"/>
|
||||
+ </item>
|
||||
+ <item row="1" column="0">
|
||||
+ <widget class="QLabel" name="label_3">
|
||||
+ <property name="text">
|
||||
+ <string>GTK 2 Theme</string>
|
||||
+ </property>
|
||||
+ </widget>
|
||||
+ </item>
|
||||
+ <item row="1" column="1">
|
||||
+ <widget class="QComboBox" name="gtk2ComboBox"/>
|
||||
+ </item>
|
||||
+ <item row="3" column="1">
|
||||
+ <widget class="QLabel" name="uniformThemeLabel">
|
||||
+ <property name="text">
|
||||
+ <string>To attempt uniform theming, either select similar style/theme
|
||||
+(if available) across all lists, or select 'gtk2' Qt style (if available)
|
||||
+ to mimic GTK themes.
|
||||
+
|
||||
+Make sure 'xsettingsd' is installed to help GTK applications apply
|
||||
+themes on the fly.</string>
|
||||
+ </property>
|
||||
+ </widget>
|
||||
+ </item>
|
||||
+ </layout>
|
||||
+ </item>
|
||||
+ </layout>
|
||||
</widget>
|
||||
</item>
|
||||
- <item row="2" column="0">
|
||||
+ <item row="5" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Toolbar button style:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
- <item row="2" column="1">
|
||||
+ <item row="5" column="1">
|
||||
<widget class="QComboBox" name="toolButtonStyle">
|
||||
<item>
|
||||
<property name="text">
|
||||
@@ -84,13 +129,23 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
- <item row="3" column="0" colspan="2">
|
||||
+ <item row="6" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="singleClickActivate">
|
||||
<property name="text">
|
||||
<string>Activate item on single click</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
+ <item row="1" column="1">
|
||||
+ <widget class="QComboBox" name="qtComboBox"/>
|
||||
+ </item>
|
||||
+ <item row="1" column="0">
|
||||
+ <widget class="QLabel" name="label_5">
|
||||
+ <property name="text">
|
||||
+ <string>Qt Style</string>
|
||||
+ </property>
|
||||
+ </widget>
|
||||
+ </item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
@ -1,18 +0,0 @@
|
||||
Description: Make a path for GTK settings if it does not exist.
|
||||
Author: P.L. Lucas <selairi@gmail.com>
|
||||
Bug: https://github.com/lxqt/lxqt/issues/1548
|
||||
Applied-Upstream: https://github.com/lxqt/lxqt-config/commit/5fe0f9288e432a669686af14657b7f508eefb77e
|
||||
Last-Update: 2018-09-03
|
||||
--- a/lxqt-config-appearance/configothertoolkits.cpp
|
||||
+++ b/lxqt-config-appearance/configothertoolkits.cpp
|
||||
@@ -212,6 +212,10 @@ void ConfigOtherToolKits::writeConfig(QS
|
||||
path = _get_config_path(path);
|
||||
|
||||
QFile file(path);
|
||||
+ if(! file.exists()) {
|
||||
+ QFileInfo fileInfo(file);
|
||||
+ QDir::home().mkpath(fileInfo.path());
|
||||
+ }
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
return;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
gtk-appearance-settings.patch
|
||||
set-default-gtk-theme.patch
|
||||
mkpath-for-null-gtk-settings.patch
|
@ -1,72 +0,0 @@
|
||||
Description: Set default GTK theme if rc file doesn't exists.
|
||||
Author: P.L. Lucas <selairi@gmail.com>
|
||||
Applied-Upstream: https://github.com/lxqt/lxqt-config/commit/4c3ad403dc14dde4fe41e56cf3272ac11e30346f
|
||||
Last-Update: 2018-10-05
|
||||
---
|
||||
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
|
||||
--- a/lxqt-config-appearance/configothertoolkits.cpp
|
||||
+++ b/lxqt-config-appearance/configothertoolkits.cpp
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <QFont>
|
||||
#include <QDateTime>
|
||||
#include <QMessageBox>
|
||||
+#include <QProcess>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
@@ -246,7 +247,7 @@ QString ConfigOtherToolKits::getGTKTheme
|
||||
QFile file(gtkrcPath);
|
||||
if(file.exists()) {
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
- return QString();
|
||||
+ return getDefaultGTKTheme();
|
||||
while (!file.atEnd()) {
|
||||
QByteArray line = file.readLine().trimmed();
|
||||
if(line.startsWith("gtk-theme-name")) {
|
||||
@@ -264,7 +265,7 @@ QString ConfigOtherToolKits::getGTKTheme
|
||||
QFile file(gtkrcPath);
|
||||
if(file.exists()) {
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
- return QString();
|
||||
+ return getDefaultGTKTheme();
|
||||
bool settingsFound = false;
|
||||
while (!file.atEnd()) {
|
||||
QByteArray line = file.readLine().trimmed();
|
||||
@@ -283,7 +284,26 @@ QString ConfigOtherToolKits::getGTKTheme
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
- return QString();
|
||||
+ return getDefaultGTKTheme();
|
||||
+}
|
||||
+
|
||||
+QString ConfigOtherToolKits::getDefaultGTKTheme()
|
||||
+{
|
||||
+ // Get the GTK default theme. Command line:
|
||||
+ // $ gsettings get org.gnome.desktop.interface gtk-theme
|
||||
+ QProcess gsettings;
|
||||
+ QStringList args;
|
||||
+ args << "get" << "org.gnome.desktop.interface" << "gtk-theme";
|
||||
+ gsettings.start("gsettings", args);
|
||||
+ if(! gsettings.waitForFinished())
|
||||
+ return QString();
|
||||
+ QByteArray defaultTheme = gsettings.readAll().trimmed();
|
||||
+ gsettings.close();
|
||||
+ if(defaultTheme.size() <= 1)
|
||||
+ return QString();
|
||||
+ // The theme has got quotation marks. Remove it:
|
||||
+ defaultTheme.replace("'","");
|
||||
+ return QString(defaultTheme);
|
||||
}
|
||||
|
||||
void ConfigOtherToolKits::updateConfigFromSettings()
|
||||
--- a/lxqt-config-appearance/configothertoolkits.h
|
||||
+++ b/lxqt-config-appearance/configothertoolkits.h
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
QString getGTKThemeFromRCFile(QString version);
|
||||
QString getGTKConfigPath(QString version);
|
||||
bool backupGTKSettings(QString version);
|
||||
+ QString getDefaultGTKTheme();
|
||||
|
||||
public slots:
|
||||
void setConfig();
|
@ -0,0 +1,2 @@
|
||||
# Translation files may be long
|
||||
lxqt-config source: very-long-line-length-in-source-file * > 512 [*.ts:*]
|
@ -0,0 +1,5 @@
|
||||
Bug-Database: https://github.com/lxqt/lxqt-config/issues
|
||||
Bug-Submit: https://github.com/lxqt/lxqt-config/issues/new
|
||||
Changelog: https://github.com/lxqt/lxqt-config/blob/master/CHANGELOG
|
||||
Repository: https://github.com/lxqt/lxqt-config.git
|
||||
Repository-Browse: https://github.com/lxqt/lxqt-config
|
@ -1,50 +1,52 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQINBFXQeMMBEACif4+9pTrC6uNmRng0ZbzLh7p3cazmbnp2YFgDQDJZ7ZNmebxy
|
||||
ngRuRhjGuDcFAL/37BwJnrBpfZFK9ljoH4Fo5Jm9cOELaTy7AIcEiV9dKMyrKF1E
|
||||
C76d8jHVuzuPbI92DkFdLZAdk+qjrrAy0x43PvUd+aaBGLcFs1ZMk7gOvElc2d95
|
||||
zWWSp5anjukmGbp+EsStnWJkF6VHj56qmklfYy5ioiVBOSpXo/RsACAcIlz8C8A1
|
||||
d4tNMiB2uF2OrUfrL8DD6m3nBqep+AYbIQrxMl9kUQH3I33e9kH/L+SHQyE6phS8
|
||||
Czq06WjV4TcJ9VWxm7hQCNLYSxhZYYr1AW45lS5+xmfBOq2qeLgvjbFxa8PPrsp6
|
||||
Bqgt8MjwUkXjU5IB7YulUBvFU2l0MJZWDBuNy0oNtCe1cU3JyIqLKjvzQQQ9eD5L
|
||||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DNxzUgKZHbnza
|
||||
j1vZyAeC+JV79X1hOVpprj1TJwy65lpxXNyYnGqeIOgyFokn9fOHXv8aMQwpNuUr
|
||||
bdUJ1C75jYrvwy/NR1DczIFFYgsbkDGDtjVBjyMc5JAgvUBz37/iVPJfWP6dKVnf
|
||||
abRnUVzHgvgK7bnab00SA1TiWvjHURGjo+5rnRtv8X/AgStc2Phjq68TMIgMn0F2
|
||||
kjUVvfQotNqzo9madNshvUDmsGtAzKh4e0dS1ear7u3nRp4Z7fqSrTEtXKNbEPwZ
|
||||
wdWrWmmQLacNQBSe/FtcMzGF6xIVr4lnrL0bFjqBdQpdTC7vns3QSKk8/GFiEfpv
|
||||
kzXrDbGV7jX2OWDjNHKcmXX2+E1CsNaJgS7zOgZw5jvbvlTLJUwyYNlM1VLI2OFW
|
||||
Oa86l8pqli+B7rpTbsAE9Ut8qUaWjm87oUNSJbaKgqNnMaE+b/8VJaEeWHgQJwsD
|
||||
bJSJ/O/vzlRtDjOJ1JDlMRLs7TnOFeUh5pgwyaJoidYbJEiGlMGJbI6BjwhDTBFO
|
||||
NLJtd3SsRjc7ICtGdCvej59IvCDTjxtkhx5okF03APi1aXpHQrE18/arFD7BpoGO
|
||||
sw==
|
||||
=gSIv
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
|
@ -1,3 +1,5 @@
|
||||
version=4
|
||||
opts="pgpsigurlmangle=s/$/.asc/" \
|
||||
https://github.com/lxqt/lxqt-config/releases .*/lxqt-config-([\d\.]+).tar.xz
|
||||
opts="searchmode=plain, \
|
||||
pgpsigurlmangle=s/$/.asc/, \
|
||||
uversionmangle=s/(\d+\.\d+\.\d+).*/$1/" \
|
||||
https://api.github.com/repos/lxqt/@PACKAGE@/releases https:\/\/github.com\/lxqt\/@PACKAGE@\/releases\/download\/@ANY_VERSION@\/@PACKAGE@-@ANY_VERSION@.tar.xz
|
||||
|
Loading…
Reference in new issue