summaryrefslogtreecommitdiff
path: root/gtk/gtkpasswordentry.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-06-05 20:15:28 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2020-06-05 20:35:11 +0100
commite63419fbf4f26ab45e9403026b32537029d75888 (patch)
treefd7db4728e18093bf3cdf50dd4e281e42c1d4918 /gtk/gtkpasswordentry.c
parent428bb09a351995d879b0f4cb0f12b89cc5b60e3f (diff)
downloadgtk+-e63419fbf4f26ab45e9403026b32537029d75888.tar.gz
a11y: Implement GtkPasswordEntryAccessible properly
GtkPasswordEntryAccessible is not a GtkEntryAccessible any more, so it will need a proper implementation of various interfaces and functionality in order to work like any other entry.
Diffstat (limited to 'gtk/gtkpasswordentry.c')
-rw-r--r--gtk/gtkpasswordentry.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gtk/gtkpasswordentry.c b/gtk/gtkpasswordentry.c
index 99eaf0b39b..66acb6fa94 100644
--- a/gtk/gtkpasswordentry.c
+++ b/gtk/gtkpasswordentry.c
@@ -20,7 +20,7 @@
#include "config.h"
-#include "gtkpasswordentry.h"
+#include "gtkpasswordentryprivate.h"
#include "gtkaccessible.h"
#include "gtktextprivate.h"
@@ -35,7 +35,7 @@
#include "gtkstylecontext.h"
#include "gtkeventcontrollerkey.h"
-#include "a11y/gtkpasswordentryaccessible.h"
+#include "a11y/gtkpasswordentryaccessibleprivate.h"
/**
* SECTION:gtkpasswordentry
@@ -116,6 +116,11 @@ gtk_password_entry_toggle_peek (GtkPasswordEntry *entry)
visibility = gtk_text_get_visibility (GTK_TEXT (priv->entry));
gtk_text_set_visibility (GTK_TEXT (priv->entry), !visibility);
+
+ /* Update the accessible object to reflect the change of visibility */
+ GtkAccessible *accessible = GTK_ACCESSIBLE (_gtk_widget_peek_accessible (GTK_WIDGET (entry)));
+ if (accessible != NULL)
+ gtk_password_entry_accessible_update_visibility (GTK_PASSWORD_ENTRY_ACCESSIBLE (accessible));
}
static void
@@ -430,6 +435,16 @@ gtk_password_entry_editable_init (GtkEditableInterface *iface)
iface->get_delegate = gtk_password_entry_get_delegate;
}
+GtkText *
+gtk_password_entry_get_text_widget (GtkPasswordEntry *entry)
+{
+ GtkPasswordEntryPrivate *priv = gtk_password_entry_get_instance_private (entry);
+
+ g_return_val_if_fail (GTK_IS_PASSWORD_ENTRY (entry), NULL);
+
+ return GTK_TEXT (priv->entry);
+}
+
/**
* gtk_password_entry_new:
*