forked from AuroraMiddleware/gtk
Implement support for ATK_STATE_HAS_TOOLTIP
https://bugzilla.gnome.org/show_bug.cgi?id=738982
This commit is contained in:
parent
318c97c959
commit
2893a71a3e
@ -395,6 +395,9 @@ gtk_widget_accessible_ref_state_set (AtkObject *accessible)
|
||||
else
|
||||
atk_state_set_add_state (state_set, ATK_STATE_VERTICAL);
|
||||
}
|
||||
|
||||
if (gtk_widget_get_has_tooltip (widget))
|
||||
atk_state_set_add_state (state_set, ATK_STATE_HAS_TOOLTIP);
|
||||
}
|
||||
return state_set;
|
||||
}
|
||||
@ -502,6 +505,11 @@ gtk_widget_accessible_notify_gtk (GObject *obj,
|
||||
state = ATK_STATE_HORIZONTAL;
|
||||
value = (gtk_orientable_get_orientation (orientable) == GTK_ORIENTATION_HORIZONTAL);
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "has-tooltip") == 0)
|
||||
{
|
||||
state = ATK_STATE_HAS_TOOLTIP;
|
||||
value = gtk_widget_get_has_tooltip (widget);
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
|
@ -84,6 +84,7 @@ testdata = \
|
||||
headerbar.ui headerbar.txt \
|
||||
tree.ui tree.txt \
|
||||
actionbar.ui actionbar.txt \
|
||||
tooltips.ui tooltips.txt \
|
||||
$(NULL)
|
||||
|
||||
test_in_files = \
|
||||
|
78
testsuite/a11y/tooltips.txt
Normal file
78
testsuite/a11y/tooltips.txt
Normal file
@ -0,0 +1,78 @@
|
||||
window1
|
||||
"frame"
|
||||
index: 0
|
||||
state: enabled resizable sensitive showing visible
|
||||
toolkit: gtk
|
||||
<AtkComponent>
|
||||
layer: window
|
||||
alpha: 1
|
||||
box1
|
||||
"filler"
|
||||
parent: window1
|
||||
index: 0
|
||||
state: enabled horizontal sensitive showing visible
|
||||
toolkit: gtk
|
||||
<AtkComponent>
|
||||
layer: widget
|
||||
alpha: 1
|
||||
button-with-tooltip-text
|
||||
"push button"
|
||||
parent: box1
|
||||
index: 0
|
||||
description: Tooltip1
|
||||
state: enabled focusable sensitive showing visible has-tooltip
|
||||
toolkit: gtk
|
||||
<AtkComponent>
|
||||
layer: widget
|
||||
alpha: 1
|
||||
<AtkImage>
|
||||
image size: -1 x -1
|
||||
image description: (null)
|
||||
<AtkAction>
|
||||
action 0 name: click
|
||||
action 0 description: Clicks the button
|
||||
button-with-has-tooltip-true
|
||||
"push button"
|
||||
parent: box1
|
||||
index: 1
|
||||
state: enabled focusable sensitive showing visible has-tooltip
|
||||
toolkit: gtk
|
||||
<AtkComponent>
|
||||
layer: widget
|
||||
alpha: 1
|
||||
<AtkImage>
|
||||
image size: -1 x -1
|
||||
image description: (null)
|
||||
<AtkAction>
|
||||
action 0 name: click
|
||||
action 0 description: Clicks the button
|
||||
button-without-tooltip
|
||||
"push button"
|
||||
parent: box1
|
||||
index: 2
|
||||
state: enabled focusable sensitive showing visible
|
||||
toolkit: gtk
|
||||
<AtkComponent>
|
||||
layer: widget
|
||||
alpha: 1
|
||||
<AtkImage>
|
||||
image size: -1 x -1
|
||||
image description: (null)
|
||||
<AtkAction>
|
||||
action 0 name: click
|
||||
action 0 description: Clicks the button
|
||||
button-with-has-tooltip-false
|
||||
"push button"
|
||||
parent: box1
|
||||
index: 3
|
||||
state: enabled focusable sensitive showing visible
|
||||
toolkit: gtk
|
||||
<AtkComponent>
|
||||
layer: widget
|
||||
alpha: 1
|
||||
<AtkImage>
|
||||
image size: -1 x -1
|
||||
image description: (null)
|
||||
<AtkAction>
|
||||
action 0 name: click
|
||||
action 0 description: Clicks the button
|
33
testsuite/a11y/tooltips.ui
Normal file
33
testsuite/a11y/tooltips.ui
Normal file
@ -0,0 +1,33 @@
|
||||
<interface>
|
||||
<object class='GtkWindow' id='window1'>
|
||||
<property name='visible'>True</property>
|
||||
<child>
|
||||
<object class='GtkBox' id='box1'>
|
||||
<property name='visible'>True</property>
|
||||
<child>
|
||||
<object class='GtkButton' id='button-with-tooltip-text'>
|
||||
<property name='visible'>True</property>
|
||||
<property name="tooltip_text">Tooltip1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class='GtkButton' id='button-with-has-tooltip-true'>
|
||||
<property name='visible'>True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class='GtkButton' id='button-without-tooltip'>
|
||||
<property name='visible'>True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class='GtkButton' id='button-with-has-tooltip-false'>
|
||||
<property name='visible'>True</property>
|
||||
<property name="has_tooltip">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
Loading…
Reference in New Issue
Block a user