forked from AuroraMiddleware/gtk
stylecascade: Remove function
Inline it.
This commit is contained in:
parent
6de50aa7d9
commit
f2d4b07f4b
@ -21,7 +21,6 @@
|
||||
|
||||
#include "gtkstyleprovider.h"
|
||||
#include "gtkstyleproviderprivate.h"
|
||||
#include "gtksettingsprivate.h"
|
||||
|
||||
typedef struct _GtkStyleCascadeIter GtkStyleCascadeIter;
|
||||
typedef struct _GtkStyleProviderData GtkStyleProviderData;
|
||||
@ -310,14 +309,6 @@ _gtk_style_cascade_new (void)
|
||||
return g_object_new (GTK_TYPE_STYLE_CASCADE, NULL);
|
||||
}
|
||||
|
||||
GtkStyleCascade *
|
||||
_gtk_style_cascade_get_for_screen (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
|
||||
return _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen));
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_style_cascade_set_parent (GtkStyleCascade *cascade,
|
||||
GtkStyleCascade *parent)
|
||||
|
@ -49,7 +49,6 @@ struct _GtkStyleCascadeClass
|
||||
GType _gtk_style_cascade_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkStyleCascade * _gtk_style_cascade_new (void);
|
||||
GtkStyleCascade * _gtk_style_cascade_get_for_screen (GdkScreen *screen);
|
||||
|
||||
void _gtk_style_cascade_set_parent (GtkStyleCascade *cascade,
|
||||
GtkStyleCascade *parent);
|
||||
|
@ -637,7 +637,7 @@ gtk_style_context_init (GtkStyleContext *style_context)
|
||||
priv->info->state_flags = GTK_STATE_FLAG_DIR_LTR;
|
||||
|
||||
gtk_style_context_set_cascade (style_context,
|
||||
_gtk_style_cascade_get_for_screen (priv->screen));
|
||||
_gtk_settings_get_style_cascade (gtk_settings_get_for_screen (priv->screen)));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1084,7 +1084,7 @@ gtk_style_context_add_provider (GtkStyleContext *context,
|
||||
|
||||
priv = context->priv;
|
||||
|
||||
if (priv->cascade == _gtk_style_cascade_get_for_screen (priv->screen))
|
||||
if (priv->cascade == _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (priv->screen)))
|
||||
{
|
||||
GtkStyleCascade *new_cascade;
|
||||
|
||||
@ -1120,7 +1120,7 @@ gtk_style_context_remove_provider (GtkStyleContext *context,
|
||||
|
||||
priv = context->priv;
|
||||
|
||||
if (priv->cascade == _gtk_style_cascade_get_for_screen (priv->screen))
|
||||
if (priv->cascade == _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (priv->screen)))
|
||||
return;
|
||||
|
||||
_gtk_style_cascade_remove_provider (priv->cascade, provider);
|
||||
@ -1193,7 +1193,7 @@ gtk_style_context_add_provider_for_screen (GdkScreen *screen,
|
||||
g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
|
||||
g_return_if_fail (!GTK_IS_SETTINGS (provider) || _gtk_settings_get_screen (GTK_SETTINGS (provider)) == screen);
|
||||
|
||||
cascade = _gtk_style_cascade_get_for_screen (screen);
|
||||
cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen));
|
||||
_gtk_style_cascade_add_provider (cascade, provider, priority);
|
||||
}
|
||||
|
||||
@ -1216,7 +1216,7 @@ gtk_style_context_remove_provider_for_screen (GdkScreen *screen,
|
||||
g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
|
||||
g_return_if_fail (!GTK_IS_SETTINGS (provider));
|
||||
|
||||
cascade = _gtk_style_cascade_get_for_screen (screen);
|
||||
cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen));
|
||||
_gtk_style_cascade_remove_provider (cascade, provider);
|
||||
}
|
||||
|
||||
@ -2541,6 +2541,7 @@ gtk_style_context_set_screen (GtkStyleContext *context,
|
||||
GdkScreen *screen)
|
||||
{
|
||||
GtkStyleContextPrivate *priv;
|
||||
GtkStyleCascade *screen_cascade;
|
||||
|
||||
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
|
||||
g_return_if_fail (GDK_IS_SCREEN (screen));
|
||||
@ -2549,13 +2550,14 @@ gtk_style_context_set_screen (GtkStyleContext *context,
|
||||
if (priv->screen == screen)
|
||||
return;
|
||||
|
||||
if (priv->cascade == _gtk_style_cascade_get_for_screen (priv->screen))
|
||||
screen_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen));
|
||||
if (priv->cascade == screen_cascade)
|
||||
{
|
||||
gtk_style_context_set_cascade (context, _gtk_style_cascade_get_for_screen (screen));
|
||||
gtk_style_context_set_cascade (context, screen_cascade);
|
||||
}
|
||||
else
|
||||
{
|
||||
_gtk_style_cascade_set_parent (priv->cascade, _gtk_style_cascade_get_for_screen (screen));
|
||||
_gtk_style_cascade_set_parent (priv->cascade, screen_cascade);
|
||||
}
|
||||
|
||||
priv->screen = screen;
|
||||
|
Loading…
Reference in New Issue
Block a user