widget-factory: hook up callbacks to the tab close buttons

Just to show that buttons in notebook tabs work.
This commit is contained in:
Matthias Clasen 2015-07-24 11:58:38 -04:00
parent a8512e097a
commit 13b4500f52
2 changed files with 19 additions and 2 deletions

View File

@ -1226,6 +1226,20 @@ open_popover_text_changed (GtkEntry *entry, GParamSpec *pspec, GtkWidget *button
gtk_widget_set_sensitive (button, strlen (text) > 0);
}
static gboolean
show_page_again (gpointer data)
{
gtk_widget_show (GTK_WIDGET (data));
return G_SOURCE_REMOVE;
}
static void
tab_close_cb (GtkWidget *page)
{
gtk_widget_hide (page);
g_timeout_add (2500, show_page_again, page);
}
static void
activate (GApplication *app)
{
@ -1274,6 +1288,7 @@ activate (GApplication *app)
gtk_builder_add_callback_symbol (builder, "on_range_from_changed", (GCallback)on_range_from_changed);
gtk_builder_add_callback_symbol (builder, "on_range_to_changed", (GCallback)on_range_to_changed);
gtk_builder_add_callback_symbol (builder, "osd_frame_button_press", (GCallback)osd_frame_button_press);
gtk_builder_add_callback_symbol (builder, "tab_close_cb", (GCallback)tab_close_cb);
gtk_builder_connect_signals (builder, NULL);

View File

@ -3476,7 +3476,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property>
<property name="show-border">False</property>
<child>
<object class="GtkBox">
<object class="GtkBox" id="closable_page_1">
<property name="visible">True</property>
<property name="height-request">120</property>
</object>
@ -3498,6 +3498,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property>
<property name="relief">none</property>
<property name="focus-on-click">False</property>
<signal name="clicked" handler="tab_close_cb" object="closable_page_1"/>
<style>
<class name="small-button"/>
</style>
@ -3516,7 +3517,7 @@ microphone-sensitivity-medium-symbolic</property>
</object>
</child>
<child>
<object class="GtkBox">
<object class="GtkBox" id="closable_page_2">
<property name="visible">True</property>
<property name="vexpand">True</property>
</object>
@ -3538,6 +3539,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property>
<property name="relief">none</property>
<property name="focus-on-click">False</property>
<signal name="clicked" handler="tab_close_cb" object="closable_page_2"/>
<style>
<class name="small-button"/>
</style>