st/theme-context: Make property setter public
There's no good reason to only expose the getter of a READWRITE property. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
This commit is contained in:
parent
794f0bcc75
commit
b01d429266
@ -99,18 +99,6 @@ static void st_theme_context_get_property (GObject *object,
|
|||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
static void
|
|
||||||
st_theme_context_set_scale_factor (StThemeContext *context,
|
|
||||||
int scale_factor)
|
|
||||||
{
|
|
||||||
if (scale_factor == context->scale_factor)
|
|
||||||
return;
|
|
||||||
|
|
||||||
context->scale_factor = scale_factor;
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (context), props[PROP_SCALE_FACTOR]);
|
|
||||||
st_theme_context_changed (context);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
st_theme_context_finalize (GObject *object)
|
st_theme_context_finalize (GObject *object)
|
||||||
@ -578,6 +566,27 @@ st_theme_context_get_scale_factor (StThemeContext *context)
|
|||||||
return context->scale_factor;
|
return context->scale_factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* st_theme_context_set_scale_factor:
|
||||||
|
* @context: a #StThemeContext
|
||||||
|
* @factor: the new factor
|
||||||
|
*
|
||||||
|
* Set the new scale factor of @context.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
st_theme_context_set_scale_factor (StThemeContext *context,
|
||||||
|
int scale_factor)
|
||||||
|
{
|
||||||
|
g_return_if_fail (ST_IS_THEME_CONTEXT (context));
|
||||||
|
|
||||||
|
if (scale_factor == context->scale_factor)
|
||||||
|
return;
|
||||||
|
|
||||||
|
context->scale_factor = scale_factor;
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (context), props[PROP_SCALE_FACTOR]);
|
||||||
|
st_theme_context_changed (context);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* st_theme_context_get_resolution:
|
* st_theme_context_get_resolution:
|
||||||
* @context: a #StThemeContext
|
* @context: a #StThemeContext
|
||||||
|
@ -62,6 +62,8 @@ StThemeNode * st_theme_context_intern_node (StThemeContext
|
|||||||
StThemeNode *node);
|
StThemeNode *node);
|
||||||
|
|
||||||
int st_theme_context_get_scale_factor (StThemeContext *context);
|
int st_theme_context_get_scale_factor (StThemeContext *context);
|
||||||
|
void st_theme_context_set_scale_factor (StThemeContext *context,
|
||||||
|
int factor);
|
||||||
|
|
||||||
double st_theme_context_get_resolution (StThemeContext *context);
|
double st_theme_context_get_resolution (StThemeContext *context);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user