win32: Fall back to raleigh with the classic theme
This is not ideal, we should have a real classic windows theme, but at least its better than everything being pink, which is what happens otherwise when theming is not enables.
This commit is contained in:
@ -961,6 +961,7 @@ gtk_extra_sources = \
|
|||||||
gtk-win32-base.css \
|
gtk-win32-base.css \
|
||||||
gtk-win32.css \
|
gtk-win32.css \
|
||||||
gtk-win32-xp.css \
|
gtk-win32-xp.css \
|
||||||
|
gtk-win32-classic.css \
|
||||||
gtkversion.h.in \
|
gtkversion.h.in \
|
||||||
gtkmarshalers.list \
|
gtkmarshalers.list \
|
||||||
fallback-c89.c
|
fallback-c89.c
|
||||||
@ -1036,7 +1037,7 @@ gtktypebuiltins.c: @REBUILD@ $(gtk_public_h_sources) $(deprecated_h_sources) gtk
|
|||||||
gtkresources.h: gtk.gresource.xml
|
gtkresources.h: gtk.gresource.xml
|
||||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/gtk.gresource.xml \
|
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/gtk.gresource.xml \
|
||||||
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register
|
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register
|
||||||
gtkresources.c: gtk.gresource.xml gtk-default.css gtk-win32.css $(DND_CURSORS)
|
gtkresources.c: gtk.gresource.xml gtk-default.css gtk-win32.css gtk-win32-xp.css gtk-win32-base.css gtk-win32-classic.css $(DND_CURSORS)
|
||||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/gtk.gresource.xml \
|
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/gtk.gresource.xml \
|
||||||
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register
|
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register
|
||||||
|
|
||||||
|
4
gtk/gtk-win32-classic.css
Normal file
4
gtk/gtk-win32-classic.css
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/* We should have a real win32 classic theme that picks up
|
||||||
|
colors from the settings. But for now, at least don't break
|
||||||
|
when win32 is in classic mode by just using raleigh. */
|
||||||
|
@import url("Raleigh.css");
|
@ -5,6 +5,7 @@
|
|||||||
<file>gtk-win32.css</file>
|
<file>gtk-win32.css</file>
|
||||||
<file>gtk-win32-xp.css</file>
|
<file>gtk-win32-xp.css</file>
|
||||||
<file>gtk-win32-base.css</file>
|
<file>gtk-win32-base.css</file>
|
||||||
|
<file>gtk-win32-classic.css</file>
|
||||||
<file alias="cursor/dnd-ask.png">cursor_dnd_ask.png</file>
|
<file alias="cursor/dnd-ask.png">cursor_dnd_ask.png</file>
|
||||||
<file alias="cursor/dnd-link.png">cursor_dnd_link.png</file>
|
<file alias="cursor/dnd-link.png">cursor_dnd_link.png</file>
|
||||||
<file alias="cursor/dnd-none.png">cursor_dnd_none.png</file>
|
<file alias="cursor/dnd-none.png">cursor_dnd_none.png</file>
|
||||||
|
@ -45,10 +45,6 @@
|
|||||||
#include "quartz/gdkquartz.h"
|
#include "quartz/gdkquartz.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GDK_WINDOWING_WIN32
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef GDK_DEPRECATED
|
#undef GDK_DEPRECATED
|
||||||
#undef GDK_DEPRECATED_FOR
|
#undef GDK_DEPRECATED_FOR
|
||||||
#define GDK_DEPRECATED
|
#define GDK_DEPRECATED
|
||||||
@ -331,14 +327,6 @@ gtk_settings_class_init (GtkSettingsClass *class)
|
|||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||||
guint result;
|
guint result;
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
OSVERSIONINFO version;
|
|
||||||
BOOL version_res;
|
|
||||||
|
|
||||||
memset (&version, 0, sizeof (version));
|
|
||||||
version.dwOSVersionInfoSize = sizeof (version);
|
|
||||||
version_res = GetVersionEx (&version);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gobject_class->finalize = gtk_settings_finalize;
|
gobject_class->finalize = gtk_settings_finalize;
|
||||||
gobject_class->get_property = gtk_settings_get_property;
|
gobject_class->get_property = gtk_settings_get_property;
|
||||||
@ -420,9 +408,7 @@ gtk_settings_class_init (GtkSettingsClass *class)
|
|||||||
P_("Theme Name"),
|
P_("Theme Name"),
|
||||||
P_("Name of theme to load"),
|
P_("Name of theme to load"),
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
(version_res && version.dwMajorVersion >= 6) ?
|
_gtk_win32_theme_get_default (),
|
||||||
"gtk-win32" :
|
|
||||||
"gtk-win32-xp",
|
|
||||||
#else
|
#else
|
||||||
"Raleigh",
|
"Raleigh",
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
static HINSTANCE uxtheme_dll = NULL;
|
static HINSTANCE uxtheme_dll = NULL;
|
||||||
static gboolean use_xp_theme = FALSE;
|
static gboolean use_xp_theme = FALSE;
|
||||||
|
static OSVERSIONINFO os_version;
|
||||||
static HTHEME needs_alpha_fixup1 = NULL;
|
static HTHEME needs_alpha_fixup1 = NULL;
|
||||||
static HTHEME needs_alpha_fixup2 = NULL;
|
static HTHEME needs_alpha_fixup2 = NULL;
|
||||||
static HTHEME needs_alpha_fixup3 = NULL;
|
static HTHEME needs_alpha_fixup3 = NULL;
|
||||||
@ -84,7 +85,6 @@ static GHashTable *hthemes_by_class = NULL;
|
|||||||
static void
|
static void
|
||||||
_gtk_win32_theme_init (void)
|
_gtk_win32_theme_init (void)
|
||||||
{
|
{
|
||||||
OSVERSIONINFO version;
|
|
||||||
char *buf;
|
char *buf;
|
||||||
char dummy;
|
char dummy;
|
||||||
int n, k;
|
int n, k;
|
||||||
@ -141,9 +141,10 @@ _gtk_win32_theme_init (void)
|
|||||||
|
|
||||||
hthemes_by_class = g_hash_table_new (g_str_hash, g_str_equal);
|
hthemes_by_class = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
|
|
||||||
memset (&version, 0, sizeof (version));
|
memset (&os_version, 0, sizeof (os_version));
|
||||||
version.dwOSVersionInfoSize = sizeof (version);
|
os_version.dwOSVersionInfoSize = sizeof (os_version);
|
||||||
if (GetVersionEx (&version) && version.dwMajorVersion == 5)
|
GetVersionEx (&os_version);
|
||||||
|
if (os_version.dwMajorVersion == 5)
|
||||||
{
|
{
|
||||||
needs_alpha_fixup1 = _gtk_win32_lookup_htheme_by_classname ("scrollbar");
|
needs_alpha_fixup1 = _gtk_win32_lookup_htheme_by_classname ("scrollbar");
|
||||||
needs_alpha_fixup2 = _gtk_win32_lookup_htheme_by_classname ("toolbar");
|
needs_alpha_fixup2 = _gtk_win32_lookup_htheme_by_classname ("toolbar");
|
||||||
@ -444,3 +445,16 @@ _gtk_win32_theme_color_resolve (const char *theme_class,
|
|||||||
#endif
|
#endif
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
_gtk_win32_theme_get_default (void)
|
||||||
|
{
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
_gtk_win32_theme_init ();
|
||||||
|
|
||||||
|
if (use_xp_theme)
|
||||||
|
return (os_version.dwMajorVersion >= 6) ? "gtk-win32" : "gtk-win32-xp";
|
||||||
|
#endif
|
||||||
|
return "gtk-win32-classic";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ GtkSymbolicColor *_gtk_win32_theme_color_parse (GtkCssParser *parser);
|
|||||||
gboolean _gtk_win32_theme_color_resolve (const char *theme_class,
|
gboolean _gtk_win32_theme_color_resolve (const char *theme_class,
|
||||||
gint id,
|
gint id,
|
||||||
GdkRGBA *color);
|
GdkRGBA *color);
|
||||||
|
const char * _gtk_win32_theme_get_default (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user