Commit 2a7b5a51 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Merge branch 'matthiasc/for-master' into 'master'

menubutton: Propagate focus-on-click

See merge request !3424
parents 6712106c ae41697d
Pipeline #273917 failed with stages
in 23 minutes
......@@ -25,6 +25,7 @@
<object class="GtkButton">
<property name="valign">center</property>
<property name="action-name">win.run</property>
<property name="focus-on-click">0</property>
<property name="label" translatable="yes">Run</property>
</object>
</child>
......@@ -32,6 +33,7 @@
<object class="GtkToggleButton">
<property name="icon-name">edit-find-symbolic</property>
<property name="valign">center</property>
<property name="focus-on-click">0</property>
<property name="active" bind-source="searchbar" bind-property="search-mode-enabled" bind-flags="bidirectional|sync-create"/>
<accessibility>
<property name="label" translatable="yes">Search</property>
......@@ -41,6 +43,7 @@
<child type="end">
<object class="GtkMenuButton" id="gear_menu_button">
<property name="valign">center</property>
<property name="focus-on-click">0</property>
<property name="menu-model">gear_menu</property>
<property name="icon-name">open-menu-symbolic</property>
<accessibility>
......
......@@ -25,12 +25,14 @@
</style>
<child>
<object class="GtkToggleButton" id="normal_radio">
<property name="focus-on-click">0</property>
<property name="label" translatable="yes">Normal</property>
<property name="active">1</property>
</object>
</child>
<child>
<object class="GtkToggleButton" id="symbolic_radio">
<property name="focus-on-click">0</property>
<property name="label" translatable="yes">Symbolic</property>
<property name="group">normal_radio</property>
<signal name="notify::active" handler="symbolic_toggled" swapped="yes" after="yes"/>
......@@ -40,6 +42,7 @@
</child>
<child type="end">
<object class="GtkMenuButton" id="gear_menu_button">
<property name="focus-on-click">0</property>
<property name="valign">center</property>
<property name="menu-model">gear_menu</property>
<property name="icon-name">open-menu-symbolic</property>
......@@ -47,6 +50,7 @@
</child>
<child type="end">
<object class="GtkToggleButton" id="search">
<property name="focus-on-click">0</property>
<style>
<class name="image-button"/>
</style>
......
......@@ -102,6 +102,7 @@
<object class="GtkHeaderBar" id="header">
<child type="start">
<object class="GtkButton">
<property name="focus-on-click">0</property>
<property name="icon-name">document-open-symbolic</property>
<property name="tooltip-text">Open node file</property>
<signal name="clicked" handler="open_cb"/>
......@@ -109,6 +110,7 @@
</child>
<child type="start">
<object class="GtkButton">
<property name="focus-on-click">0</property>
<property name="icon-name">document-save-symbolic</property>
<property name="tooltip-text">Save to node file</property>
<signal name="clicked" handler="save_cb"/>
......@@ -116,6 +118,7 @@
</child>
<child type="start">
<object class="GtkButton">
<property name="focus-on-click">0</property>
<property name="icon-name">insert-image-symbolic</property>
<property name="tooltip-text">Export to image</property>
<signal name="clicked" handler="export_image_cb"/>
......@@ -123,6 +126,7 @@
</child>
<child type="start">
<object class="GtkButton">
<property name="focus-on-click">0</property>
<property name="icon-name">edit-copy-symbolic</property>
<property name="tooltip-text">Copy image to clipboard</property>
<signal name="clicked" handler="clip_image_cb"/>
......@@ -130,12 +134,14 @@
</child>
<child type="start">
<object class="GtkMenuButton">
<property name="focus-on-click">0</property>
<property name="label">Save Testcase</property>
<property name="popover">testcase_popover</property>
</object>
</child>
<child type="end">
<object class="GtkMenuButton" id="gear_menu_button">
<property name="focus-on-click">0</property>
<property name="valign">center</property>
<property name="menu-model">gear_menu</property>
<property name="icon-name">open-menu-symbolic</property>
......@@ -143,6 +149,7 @@
</child>
<child type="end">
<object class="GtkToggleButton" id="dark_bg_button">
<property name="focus-on-click">0</property>
<property name="valign">center</property>
<property name="has-frame">0</property>
<property name="icon-name">display-brightness-symbolic</property>
......
......@@ -438,6 +438,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<child type="end">
<object class="GtkMenuButton" id="gear_menu_button">
<property name="valign">center</property>
<property name="focus-on-click">0</property>
<property name="popover">
<object class="GtkPopoverMenu" id="gear_menu">
<property name="menu-model">gear_menu_model</property>
......
......@@ -214,6 +214,22 @@ gtk_menu_button_get_property (GObject *object,
}
}
static void
gtk_menu_button_notify (GObject *object,
GParamSpec *pspec)
{
if (strcmp (pspec->name, "focus-on-click") == 0)
{
GtkMenuButton *self = GTK_MENU_BUTTON (object);
gtk_widget_set_focus_on_click (self->button,
gtk_widget_get_focus_on_click (GTK_WIDGET (self)));
}
if (G_OBJECT_CLASS (gtk_menu_button_parent_class)->notify)
G_OBJECT_CLASS (gtk_menu_button_parent_class)->notify (object, pspec);
}
static void
gtk_menu_button_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state_flags)
......@@ -318,6 +334,7 @@ gtk_menu_button_class_init (GtkMenuButtonClass *klass)
gobject_class->set_property = gtk_menu_button_set_property;
gobject_class->get_property = gtk_menu_button_get_property;
gobject_class->notify = gtk_menu_button_notify;
gobject_class->dispose = gtk_menu_button_dispose;
widget_class->measure = gtk_menu_button_measure;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment