Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 179351 Details for
Bug 255632
qt-4.4.2 doesn't get its color scheme
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
libqt4-read-kde4-kdeglobals.patch (text/plain), 7.28 KB, created by
Markos Chandras (RETIRED)
on 2009-01-22 16:42:55 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Markos Chandras (RETIRED)
Created:
2009-01-22 16:42:55 UTC
Size:
7.28 KB
patch
obsolete
>--- src/gui/kernel/qapplication_x11.cpp >+++ src/gui/kernel/qapplication_x11.cpp >@@ -632,6 +632,26 @@ > } > > /*! \internal >+ Gets the current KDE 3 or 4 home path >+*/ >+QString QApplicationPrivate::kdeHome() >+{ >+ static QString kdeHomePath; >+ if (kdeHomePath.isEmpty()) { >+ kdeHomePath = QString::fromLocal8Bit(qgetenv("KDEHOME")); >+ if (kdeHomePath.isEmpty()) { >+ QString session = QString::fromLocal8Bit(qgetenv("DESKTOP_SESSION")); >+ QDir homeDir(QDir::homePath()); >+ QString kdeConfDir(QLatin1String("/.kde")); >+ if (session == QLatin1String("kde4") && homeDir.exists(QLatin1String(".kde4"))) >+ kdeConfDir = QLatin1String("/.kde4"); >+ kdeHomePath = QDir::homePath() + kdeConfDir; >+ } >+ } >+ return kdeHomePath; >+} >+ >+/*! \internal > apply the settings to the application > */ > bool QApplicationPrivate::x11_apply_settings() >@@ -689,11 +709,24 @@ > if (groupCount == QPalette::NColorGroups) > QApplicationPrivate::setSystemPalette(pal); > >+ QString session = QString::fromLocal8Bit(qgetenv("DESKTOP_SESSION")); >+ > if (!appFont) { >- QString str = settings.value(QLatin1String("font")).toString(); >- if (!str.isEmpty()) { >- QFont font(QApplication::font()); >- font.fromString(str); >+ QFont font(QApplication::font()); >+ QString fontDescription; >+ // Override Qt font if KDE4 settings can be used >+ if (session == QLatin1String("kde4")) { >+ QSettings kdeSettings(kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat); >+ fontDescription = kdeSettings.value(QLatin1String("font")).toString(); >+ if (fontDescription.isEmpty()) { >+ // KDE stores fonts without quotes >+ fontDescription = kdeSettings.value(QLatin1String("font")).toStringList().join(QLatin1String(",")); >+ } >+ } >+ if (fontDescription.isEmpty()) >+ fontDescription = settings.value(QLatin1String("font")).toString(); >+ if (!fontDescription .isEmpty()) { >+ font.fromString(fontDescription ); > QApplicationPrivate::setSystemFont(font); > } > } >@@ -712,6 +745,25 @@ > > // read new QStyle > QString stylename = settings.value(QLatin1String("style")).toString(); >+ if (stylename.isEmpty() && !QApplicationPrivate::styleOverride && X11->use_xrender) { >+ QStringList availableStyles = QStyleFactory::keys(); >+ // Override Qt style if KDE4 settings can be used >+ if (session == QLatin1String("kde4")) { >+ QSettings kdeSettings(kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat); >+ QString kde4Style = kdeSettings.value(QLatin1String("widgetStyle"), >+ QLatin1String("Oxygen")).toString(); >+ foreach (const QString style, availableStyles) { >+ if (style.toLower() == kde4Style.toLower()) >+ stylename = kde4Style; >+ } >+ // Set QGtkStyle for GNOME >+ } else if (X11->desktopEnvironment == DE_GNOME) { >+ QString gtkStyleKey = QString::fromLatin1("GTK+"); >+ if (availableStyles.contains(gtkStyleKey)) >+ stylename = gtkStyleKey; >+ } >+ } >+ > if (QCoreApplication::startingUp()) { > if (!stylename.isEmpty() && !QApplicationPrivate::styleOverride) > QApplicationPrivate::styleOverride = new QString(stylename); >@@ -859,14 +911,12 @@ > XFree((char *)data); > } > >-// Reads a KDE3 color setting >+// Reads a KDE color setting > static QColor kdeColor(const QString &key) > { >- QString kdeHome = QString::fromLocal8Bit(qgetenv("KDEHOME")); >- if (kdeHome.isEmpty()) >- kdeHome = QDir::homePath() + QLatin1String("/.kde"); >- QSettings settings(kdeHome + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat); >- QVariant variant = settings.value(key); >+ QSettings kdeSettings(QApplicationPrivate::kdeHome() + >+ QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat); >+ QVariant variant = kdeSettings.value(key); > if (variant.isValid()) { > QStringList values = variant.toStringList(); > if (values.size() == 3) { >@@ -1088,23 +1588,33 @@ > // Setup KDE palette > QColor color; > color = kdeColor(QLatin1String("buttonBackground")); >+ if (!color.isValid()) >+ color = kdeColor(QLatin1String("Colors:Button/BackgroundNormal")); > if (color.isValid()) > btn = color; > > color = kdeColor(QLatin1String("background")); >+ if (!color.isValid()) >+ color = kdeColor(QLatin1String("Colors:Window/BackgroundNormal")); > if (color.isValid()) > bg = color; > > color = kdeColor(QLatin1String("foreground")); >+ if (!color.isValid()) >+ color = kdeColor(QLatin1String("Colors:View/ForegroundNormal")); > if (color.isValid()) { > fg = color; > } > > color = kdeColor(QLatin1String("windowForeground")); >+ if (!color.isValid()) >+ color = kdeColor(QLatin1String("Colors:Window/ForegroundNormal")); > if (color.isValid()) > wfg = color; > > color = kdeColor(QLatin1String("windowBackground")); >+ if (!color.isValid()) >+ color = kdeColor(QLatin1String("Colors:View/BackgroundNormal")); > if (color.isValid()) > base = color; > } >@@ -1121,23 +1161,31 @@ > highlight = QColor(selectBackground); > highlightText = QColor(selectForeground); > } >- // Use KDE3 color settings if present >+ // Use KDE3 or KDE4 color settings if present > if (kdeColors) { > QColor color = kdeColor(QLatin1String("selectBackground")); >+ if (!color.isValid()) >+ color = kdeColor(QLatin1String("Colors:Selection/BackgroundNormal")); > if (color.isValid()) > highlight = color; > > color = kdeColor(QLatin1String("selectForeground")); >+ if (!color.isValid()) >+ color = kdeColor(QLatin1String("Colors:Selection/ForegroundNormal")); > if (color.isValid()) > highlightText = color; > > color = kdeColor(QLatin1String("alternateBackground")); >+ if (!color.isValid()) >+ color = kdeColor(QLatin1String("Colors:View/BackgroundAlternate")); > if (color.isValid()) > pal.setColor(QPalette::AlternateBase, color); > else > pal.setBrush(QPalette::AlternateBase, pal.base().color().darker(110)); > > color = kdeColor(QLatin1String("buttonForeground")); >+ if (!color.isValid()) >+ color = kdeColor(QLatin1String("Colors:Button/ForegroundNormal")); > if (color.isValid()) > pal.setColor(QPalette::ButtonText, color); > } >--- src/gui/kernel/qapplication_p.h >+++ src/gui/kernel/qapplication_p.h >@@ -183,6 +183,7 @@ > > #if defined(Q_WS_X11) > #ifndef QT_NO_SETTINGS >+ static QString kdeHome(); > static bool x11_apply_settings(); > #endif > static void reset_instance_pointer();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 255632
:
179287
|
179288
| 179351 |
179353