From 9d595a67c3a486fba7faafaea6420f9f25c1066e Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Tue, 6 Aug 2024 22:58:19 -0400 Subject: [PATCH] gt gtk styling --- ...yleplugins-fix-build-against-Qt-5.15.patch | 44 ------ ...qt5-styleplugins-fix-gtk2-background.patch | 25 ---- modules/freya/packages/qt.scm | 133 ++++++++++++++---- modules/freya/system.scm | 5 +- 4 files changed, 112 insertions(+), 95 deletions(-) delete mode 100644 modules/freya/packages/patches/qt5-styleplugins-fix-build-against-Qt-5.15.patch delete mode 100644 modules/freya/packages/patches/qt5-styleplugins-fix-gtk2-background.patch diff --git a/modules/freya/packages/patches/qt5-styleplugins-fix-build-against-Qt-5.15.patch b/modules/freya/packages/patches/qt5-styleplugins-fix-build-against-Qt-5.15.patch deleted file mode 100644 index 7eb7441..0000000 --- a/modules/freya/packages/patches/qt5-styleplugins-fix-build-against-Qt-5.15.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 335dbece103e2cbf6c7cf819ab6672c2956b17b3 Mon Sep 17 00:00:00 2001 -From: Fabian Vogt -Date: Thu, 28 May 2020 12:35:42 +0200 -Subject: [PATCH] fix build against Qt 5.15 - -With 0a93db4d82c051164923a10e4382b12de9049b45 ("Unify application -palette handling between QGuiApplication and QApplication") -QApplicationPrivate::setSystemPalette is no longer used and necessary. ---- - src/plugins/styles/gtk2/qgtkstyle.cpp | 2 ++ - src/plugins/styles/gtk2/qgtkstyle_p.cpp | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/src/plugins/styles/gtk2/qgtkstyle.cpp b/src/plugins/styles/gtk2/qgtkstyle.cpp -index 36169c9..2544593 100644 ---- a/src/plugins/styles/gtk2/qgtkstyle.cpp -+++ b/src/plugins/styles/gtk2/qgtkstyle.cpp -@@ -440,7 +440,9 @@ void QGtkStyle::polish(QApplication *app) - // not supported as these should be entirely determined by - // current Gtk settings - if (app->desktopSettingsAware() && d->isThemeAvailable()) { -+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - QApplicationPrivate::setSystemPalette(standardPalette()); -+#endif - QApplicationPrivate::setSystemFont(d->getThemeFont()); - d->applyCustomPaletteHash(); - if (!d->isKDE4Session()) -diff --git a/src/plugins/styles/gtk2/qgtkstyle_p.cpp b/src/plugins/styles/gtk2/qgtkstyle_p.cpp -index e57b3d8..e71beb0 100644 ---- a/src/plugins/styles/gtk2/qgtkstyle_p.cpp -+++ b/src/plugins/styles/gtk2/qgtkstyle_p.cpp -@@ -508,7 +508,9 @@ void QGtkStyleUpdateScheduler::updateTheme() - if (oldTheme != QGtkStylePrivate::getThemeName()) { - oldTheme = QGtkStylePrivate::getThemeName(); - QPalette newPalette = qApp->style()->standardPalette(); -+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - QApplicationPrivate::setSystemPalette(newPalette); -+#endif - QApplication::setPalette(newPalette); - if (!QGtkStylePrivate::instances.isEmpty()) { - QGtkStylePrivate::instances.last()->initGtkWidgets(); --- -2.26.2 - diff --git a/modules/freya/packages/patches/qt5-styleplugins-fix-gtk2-background.patch b/modules/freya/packages/patches/qt5-styleplugins-fix-gtk2-background.patch deleted file mode 100644 index 888ec0b..0000000 --- a/modules/freya/packages/patches/qt5-styleplugins-fix-gtk2-background.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 20b0985a77df913585628d49a3b541fb957ae366 Mon Sep 17 00:00:00 2001 -From: gamezelda -Date: Thu, 4 Jun 2020 00:06:50 +0200 -Subject: [PATCH] fix setting background palette - ---- - src/plugins/styles/gtk2/qgtkstyle.cpp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/plugins/styles/gtk2/qgtkstyle.cpp b/src/plugins/styles/gtk2/qgtkstyle.cpp -index 2544593..6138bd2 100644 ---- a/src/plugins/styles/gtk2/qgtkstyle.cpp -+++ b/src/plugins/styles/gtk2/qgtkstyle.cpp -@@ -442,6 +442,8 @@ void QGtkStyle::polish(QApplication *app) - if (app->desktopSettingsAware() && d->isThemeAvailable()) { - #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - QApplicationPrivate::setSystemPalette(standardPalette()); -+#else -+ QApplication::setPalette(standardPalette()); - #endif - QApplicationPrivate::setSystemFont(d->getThemeFont()); - d->applyCustomPaletteHash(); --- -2.27.0 - diff --git a/modules/freya/packages/qt.scm b/modules/freya/packages/qt.scm index 2971432..ca689b9 100644 --- a/modules/freya/packages/qt.scm +++ b/modules/freya/packages/qt.scm @@ -1,28 +1,111 @@ (define-module (freya packages qt) - #:use-module (guix packages) - #:use-module (guix download) - #:use-module (guix build-system gnu) - #:use-module ((guix licenses) #:prefix license:) - #:use-module (guix utils) - #:use-module (gnu packages node)) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix utils) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages base) + #:use-module (gnu packages gtk) + #:use-module (gnu packages xorg) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages qt)) -;(define-public qt5-styleplugins -; (let ((commit "7bd6205398b2d89b3ac083b2f6f00b197f40057a") -; (revision "1")) -; (package -; (name "qt5-styleplugins") -; (version (git-version "5.0.0" revision commit)) -; (source (origin -; (method git-fetch) -; (uri (git-reference -; (url "https://github.com/qt/qtstyleplugins") -; (commit commit))) -; (patches (list -; (local-file "patches/qt5-styleplugins-fix-gtk2-background.patch") -; (local-file "patches/qt5-styleplugins-fixbuild-against-QT-5.15.patch"))) -; (file-name (git-file-name name version)) -; (sha256 -; (base32 -; "0gy0g0kxb3q1wjqrypnvmrxcb4ld3advikchygpwpfp4s9v0mmvd")))) -; (build-system meson-build-system) +(define-public qt5-styleplugins + (let ((commit "7bd6205398b2d89b3ac083b2f6f00b197f40057a") + (revision "1")) + (package + (name "qt5-styleplugins") + (version (git-version "5.0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/qt/qtstyleplugins") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0pi30l6g8bk1z83n6q6khjcm789szzz52aq1r9va6285i5j8ykac")))) + (build-system gnu-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (invoke "qmake" + (string-append "prefix=" out))))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (qt5 (assoc-ref inputs "qtbase"))) + (invoke "make" (string-append "INSTALL_ROOT=\"" out "\"") "install") + (let ((lib (string-append out qt5 "/lib"))) + (invoke "mv" lib out) + (invoke "rm" "-fr" (string-append out "/gnu")))))) + ))) + (native-inputs + (list qttools-5 + findutils + coreutils)) + (inputs + (list qtbase-5)) + (home-page "") + (synopsis "") + (description "") + (license license:expat)))) + +(define-public qt6gtk2 + (package + (name "qt6gtk2") + (version "0.2") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/trialuser02/qt6gtk2" + "/archive/refs/tags/" version ".tar.gz")) + (sha256 + (base32 + "133f8ax1clbsc4ppdibfjcfz38153rznplp1sgfcrfi7bkgrm00c")))) + (build-system gnu-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (gtk2 (assoc-ref inputs "gtk+")) + (x11 (assoc-ref inputs "libx11"))) + (substitute* "qt6gtk2.pri" + (("UI_DIR") (string-append + "PKG_CONFIG = " + (assoc-ref inputs "pkg-config") + "/bin/pkg-config" + "\nPKG_CONFIG_PATH = " + gtk2 "/include" ":" x11 "/include" + "\nUI_DIR"))) + (invoke "qmake" + (string-append "prefix=" out)) + ))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (qt5 (assoc-ref inputs "qtbase"))) + (invoke "make" (string-append "INSTALL_ROOT=\"" out "\"") "install") + (let ((lib (string-append out qt5 "/lib"))) + (invoke "mv" lib out) + (invoke "rm" "-fr" (string-append out "/gnu")))))) + ))) + (native-inputs + (list pkg-config + qttools + coreutils)) + (inputs + (list qtbase + gtk+-2 + libx11 + libxkbcommon)) + (home-page "") + (synopsis "") + (description "") + (license license:expat))) diff --git a/modules/freya/system.scm b/modules/freya/system.scm index 0ae9cfc..109c3ca 100644 --- a/modules/freya/system.scm +++ b/modules/freya/system.scm @@ -33,6 +33,7 @@ #:use-module (freya packages certs) #:use-module (freya packages linux) #:use-module (freya packages gl) + #:use-module (freya packages qt) #:use-module (freya packages networking) #:use-module (freya packages virtualization)) @@ -183,7 +184,9 @@ hypridle bluez-new blueman-new - mesa) + mesa + qt5-styleplugins + qt6gtk2) %my-base-packages)) ;; Below is the list of system services. TO search for available