st: Remove caps-lock feedback warning from StEntry.
Caps-lock feedback has been moved to be shown in the various dialogs instead in the password-entries itself. Hence, there is no need for caps-lock feedback handling in StEntry now. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/619
This commit is contained in:
parent
b4f1fc2305
commit
35171aed37
@ -110,7 +110,6 @@ struct _StEntryPrivate
|
|||||||
|
|
||||||
gfloat spacing;
|
gfloat spacing;
|
||||||
|
|
||||||
gboolean capslock_warning_shown;
|
|
||||||
gboolean has_ibeam;
|
gboolean has_ibeam;
|
||||||
|
|
||||||
CoglPipeline *text_shadow_material;
|
CoglPipeline *text_shadow_material;
|
||||||
@ -216,61 +215,14 @@ st_entry_get_property (GObject *gobject,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
show_capslock_feedback (StEntry *entry)
|
|
||||||
{
|
|
||||||
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
|
|
||||||
if (priv->secondary_icon == NULL)
|
|
||||||
{
|
|
||||||
ClutterActor *icon = g_object_new (ST_TYPE_ICON,
|
|
||||||
"style-class", "capslock-warning",
|
|
||||||
"icon-name", "dialog-warning-symbolic",
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
st_entry_set_secondary_icon (entry, icon);
|
|
||||||
priv->capslock_warning_shown = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
remove_capslock_feedback (StEntry *entry)
|
|
||||||
{
|
|
||||||
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
|
|
||||||
if (priv->capslock_warning_shown)
|
|
||||||
{
|
|
||||||
st_entry_set_secondary_icon (entry, NULL);
|
|
||||||
priv->capslock_warning_shown = FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
keymap_state_changed (ClutterKeymap *keymap,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
StEntry *entry = ST_ENTRY (user_data);
|
|
||||||
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
|
|
||||||
|
|
||||||
if (clutter_text_get_password_char (CLUTTER_TEXT (priv->entry)) != 0)
|
|
||||||
{
|
|
||||||
if (clutter_keymap_get_caps_lock_state (keymap))
|
|
||||||
show_capslock_feedback (entry);
|
|
||||||
else
|
|
||||||
remove_capslock_feedback (entry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
st_entry_dispose (GObject *object)
|
st_entry_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
StEntry *entry = ST_ENTRY (object);
|
StEntry *entry = ST_ENTRY (object);
|
||||||
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
|
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
|
||||||
ClutterKeymap *keymap;
|
|
||||||
|
|
||||||
cogl_clear_object (&priv->text_shadow_material);
|
cogl_clear_object (&priv->text_shadow_material);
|
||||||
|
|
||||||
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
|
|
||||||
g_signal_handlers_disconnect_by_func (keymap, keymap_state_changed, entry);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (st_entry_parent_class)->dispose (object);
|
G_OBJECT_CLASS (st_entry_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -568,15 +520,9 @@ clutter_text_focus_in_cb (ClutterText *text,
|
|||||||
ClutterActor *actor)
|
ClutterActor *actor)
|
||||||
{
|
{
|
||||||
StEntry *entry = ST_ENTRY (actor);
|
StEntry *entry = ST_ENTRY (actor);
|
||||||
ClutterKeymap *keymap;
|
|
||||||
|
|
||||||
st_entry_update_hint_visibility (entry);
|
st_entry_update_hint_visibility (entry);
|
||||||
|
|
||||||
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
|
|
||||||
keymap_state_changed (keymap, entry);
|
|
||||||
g_signal_connect (keymap, "state-changed",
|
|
||||||
G_CALLBACK (keymap_state_changed), entry);
|
|
||||||
|
|
||||||
st_widget_add_style_pseudo_class (ST_WIDGET (actor), "focus");
|
st_widget_add_style_pseudo_class (ST_WIDGET (actor), "focus");
|
||||||
clutter_text_set_cursor_visible (text, TRUE);
|
clutter_text_set_cursor_visible (text, TRUE);
|
||||||
}
|
}
|
||||||
@ -586,29 +532,12 @@ clutter_text_focus_out_cb (ClutterText *text,
|
|||||||
ClutterActor *actor)
|
ClutterActor *actor)
|
||||||
{
|
{
|
||||||
StEntry *entry = ST_ENTRY (actor);
|
StEntry *entry = ST_ENTRY (actor);
|
||||||
ClutterKeymap *keymap;
|
|
||||||
|
|
||||||
st_widget_remove_style_pseudo_class (ST_WIDGET (actor), "focus");
|
st_widget_remove_style_pseudo_class (ST_WIDGET (actor), "focus");
|
||||||
|
|
||||||
st_entry_update_hint_visibility (entry);
|
st_entry_update_hint_visibility (entry);
|
||||||
|
|
||||||
clutter_text_set_cursor_visible (text, FALSE);
|
clutter_text_set_cursor_visible (text, FALSE);
|
||||||
remove_capslock_feedback (entry);
|
|
||||||
|
|
||||||
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
|
|
||||||
g_signal_handlers_disconnect_by_func (keymap, keymap_state_changed, entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_text_password_char_cb (GObject *object,
|
|
||||||
GParamSpec *pspec,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
StEntry *entry = ST_ENTRY (user_data);
|
|
||||||
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
|
|
||||||
|
|
||||||
if (clutter_text_get_password_char (CLUTTER_TEXT (priv->entry)) == 0)
|
|
||||||
remove_capslock_feedback (entry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1054,9 +983,6 @@ st_entry_init (StEntry *entry)
|
|||||||
g_signal_connect (priv->entry, "key-focus-out",
|
g_signal_connect (priv->entry, "key-focus-out",
|
||||||
G_CALLBACK (clutter_text_focus_out_cb), entry);
|
G_CALLBACK (clutter_text_focus_out_cb), entry);
|
||||||
|
|
||||||
g_signal_connect (priv->entry, "notify::password-char",
|
|
||||||
G_CALLBACK (clutter_text_password_char_cb), entry);
|
|
||||||
|
|
||||||
g_signal_connect (priv->entry, "button-press-event",
|
g_signal_connect (priv->entry, "button-press-event",
|
||||||
G_CALLBACK (clutter_text_button_press_event), entry);
|
G_CALLBACK (clutter_text_button_press_event), entry);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user