mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-30 15:31:34 +00:00
cellrenderertoggle: Use the cell renderer's state flags as a base for rendering
This allows us to pick the underlying widget's state flags that we don't explicitly set here.
This commit is contained in:
parent
42d2a1984c
commit
70970146ca
@ -363,11 +363,13 @@ gtk_cell_renderer_toggle_render (GtkCellRenderer *cell,
|
|||||||
if (width <= 0 || height <= 0)
|
if (width <= 0 || height <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!priv->activatable)
|
|
||||||
state = GTK_STATE_FLAG_INSENSITIVE;
|
|
||||||
else
|
|
||||||
state = gtk_cell_renderer_get_state (cell, widget, flags);
|
state = gtk_cell_renderer_get_state (cell, widget, flags);
|
||||||
|
|
||||||
|
if (!priv->activatable)
|
||||||
|
state |= GTK_STATE_FLAG_INSENSITIVE;
|
||||||
|
|
||||||
|
state &= ~(GTK_STATE_FLAG_INCONSISTENT | GTK_STATE_FLAG_ACTIVE);
|
||||||
|
|
||||||
if (priv->inconsistent)
|
if (priv->inconsistent)
|
||||||
state |= GTK_STATE_FLAG_INCONSISTENT;
|
state |= GTK_STATE_FLAG_INCONSISTENT;
|
||||||
else if (priv->active)
|
else if (priv->active)
|
||||||
|
Loading…
Reference in New Issue
Block a user