forked from AuroraMiddleware/gtk
Rename 'window-unfocused' to 'backdrop'
'window-unfocused' is too long and mentions "focus" which is historically loaded with the meaning "input focus". 'backdrop' isn't generally used in GUI speak and still conveys the state the widgets in an unfocused or background toplevel window are in.
This commit is contained in:
parent
7a00a95508
commit
e9adaabc5e
@ -2073,7 +2073,7 @@ parse_selector_pseudo_class (GtkCssScanner *scanner,
|
||||
{ "inconsistent", 0, GTK_STATE_FLAG_INCONSISTENT },
|
||||
{ "focused", 0, GTK_STATE_FLAG_FOCUSED },
|
||||
{ "focus", 0, GTK_STATE_FLAG_FOCUSED },
|
||||
{ "window-unfocused", 0, GTK_STATE_FLAG_WINDOW_UNFOCUSED },
|
||||
{ "backdrop", 0, GTK_STATE_FLAG_BACKDROP },
|
||||
{ NULL, }
|
||||
}, nth_child_classes[] = {
|
||||
{ "first", GTK_REGION_FIRST, 0 },
|
||||
|
@ -154,7 +154,7 @@ _gtk_css_selector_print (const GtkCssSelector *selector,
|
||||
"insensitive",
|
||||
"inconsistent",
|
||||
"focus",
|
||||
"window-unfocused"
|
||||
"backdrop"
|
||||
};
|
||||
guint i;
|
||||
|
||||
|
@ -842,7 +842,7 @@ typedef enum
|
||||
* @GTK_STATE_FLAG_INSENSITIVE: Widget is insensitive.
|
||||
* @GTK_STATE_FLAG_INCONSISTENT: Widget is inconsistent.
|
||||
* @GTK_STATE_FLAG_FOCUSED: Widget has the keyboard focus.
|
||||
* @GTK_STATE_FLAG_WINDOW_UNFOCUSED: Widget's toplevel window is unfocused.
|
||||
* @GTK_STATE_FLAG_BACKDROP: Widget is in a background toplevel window.
|
||||
*
|
||||
* Describes a widget state.
|
||||
*/
|
||||
@ -855,7 +855,7 @@ typedef enum
|
||||
GTK_STATE_FLAG_INSENSITIVE = 1 << 3,
|
||||
GTK_STATE_FLAG_INCONSISTENT = 1 << 4,
|
||||
GTK_STATE_FLAG_FOCUSED = 1 << 5,
|
||||
GTK_STATE_FLAG_WINDOW_UNFOCUSED = 1 << 6
|
||||
GTK_STATE_FLAG_BACKDROP = 1 << 6
|
||||
} GtkStateFlags;
|
||||
|
||||
/**
|
||||
|
@ -3783,8 +3783,8 @@ gtk_widget_unparent (GtkWidget *widget)
|
||||
gtk_widget_queue_compute_expand (old_parent);
|
||||
}
|
||||
|
||||
/* Unset window-unfocused since we are no longer inside a toplevel window */
|
||||
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_WINDOW_UNFOCUSED);
|
||||
/* Unset BACKDROP since we are no longer inside a toplevel window */
|
||||
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_BACKDROP);
|
||||
if (priv->context)
|
||||
gtk_style_context_set_parent (priv->context, NULL);
|
||||
|
||||
|
@ -478,7 +478,7 @@ static void gtk_window_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
|
||||
static void ensure_state_flag_window_unfocused (GtkWidget *widget);
|
||||
static void ensure_state_flag_backdrop (GtkWidget *widget);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_BIN,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
||||
@ -4893,7 +4893,7 @@ gtk_window_map (GtkWidget *widget)
|
||||
else
|
||||
gtk_window_set_focus_visible (window, visible_focus == GTK_POLICY_ALWAYS);
|
||||
|
||||
ensure_state_flag_window_unfocused (widget);
|
||||
ensure_state_flag_backdrop (widget);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -5543,7 +5543,7 @@ gtk_window_state_event (GtkWidget *widget,
|
||||
update_grip_visibility (GTK_WINDOW (widget));
|
||||
|
||||
if (event->changed_mask & GDK_WINDOW_STATE_FOCUSED)
|
||||
ensure_state_flag_window_unfocused (widget);
|
||||
ensure_state_flag_backdrop (widget);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -9697,7 +9697,7 @@ gtk_window_set_has_user_ref_count (GtkWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_state_flag_window_unfocused (GtkWidget *widget)
|
||||
ensure_state_flag_backdrop (GtkWidget *widget)
|
||||
{
|
||||
GdkWindow *window;
|
||||
gboolean window_focused = TRUE;
|
||||
@ -9707,9 +9707,9 @@ ensure_state_flag_window_unfocused (GtkWidget *widget)
|
||||
window_focused = gdk_window_get_state (window) & GDK_WINDOW_STATE_FOCUSED;
|
||||
|
||||
if (!window_focused)
|
||||
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_WINDOW_UNFOCUSED, FALSE);
|
||||
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_BACKDROP, FALSE);
|
||||
else
|
||||
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_WINDOW_UNFOCUSED);
|
||||
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_BACKDROP);
|
||||
|
||||
gtk_widget_queue_draw (widget);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user