mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 21:51:08 +00:00
window: add a "client-decorated" style class when the window is so
The theme might want to apply some specific theming to a client decorated toplevel window, so add a style class for that.
This commit is contained in:
parent
2d13802f62
commit
4bcaadac51
@ -5136,6 +5136,22 @@ update_window_buttons (GtkWindow *window)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_client_decorated (GtkWidget *widget,
|
||||||
|
gboolean value)
|
||||||
|
{
|
||||||
|
GtkStyleContext *context;
|
||||||
|
GtkWindowPrivate *priv = GTK_WINDOW (widget)->priv;
|
||||||
|
|
||||||
|
context = gtk_widget_get_style_context (widget);
|
||||||
|
priv->client_decorated = value;
|
||||||
|
|
||||||
|
if (value)
|
||||||
|
gtk_style_context_add_class (context, "client-decorated");
|
||||||
|
else
|
||||||
|
gtk_style_context_remove_class (context, "client-decorated");
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
create_decoration (GtkWidget *widget)
|
create_decoration (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
@ -5156,7 +5172,7 @@ create_decoration (GtkWidget *widget)
|
|||||||
|
|
||||||
#ifdef GDK_WINDOWING_WAYLAND
|
#ifdef GDK_WINDOWING_WAYLAND
|
||||||
if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (widget)))
|
if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (widget)))
|
||||||
priv->client_decorated = TRUE;
|
set_client_decorated (widget, TRUE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!priv->client_decorated &&
|
if (!priv->client_decorated &&
|
||||||
@ -5169,7 +5185,7 @@ create_decoration (GtkWidget *widget)
|
|||||||
if (visual)
|
if (visual)
|
||||||
{
|
{
|
||||||
gtk_widget_set_visual (widget, visual);
|
gtk_widget_set_visual (widget, visual);
|
||||||
priv->client_decorated = TRUE;
|
set_client_decorated (widget, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user