Commit e7b0a478 authored by Matthias Clasen's avatar Matthias Clasen

Always show close buttons

The resizing is too distracting otherwise, and reserving space
would be unnecessarily complicated.
parent 73e7219b
......@@ -72,29 +72,14 @@ gtk_closable_tab_init (GtkClosableTab *self)
g_object_bind_property (self, "title", self->label, "label", G_BINDING_DEFAULT);
self->button = gtk_button_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_MENU);
gtk_widget_show (self->button);
gtk_button_set_relief (GTK_BUTTON (self->button), GTK_RELIEF_NONE);
gtk_box_pack_end (GTK_BOX (self->box), self->button, FALSE, FALSE, 0);
g_signal_connect_swapped (self->button, "clicked", G_CALLBACK (close_tab), self);
}
static void
gtk_closable_tab_state_flags_changed (GtkWidget *widget,
GtkStateFlags old_state)
{
GtkClosableTab *tab = GTK_CLOSABLE_TAB (widget);
gboolean checked;
checked = (gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_CHECKED) != 0;
gtk_widget_set_visible (tab->button, checked);
}
static void
gtk_closable_tab_class_init (GtkClosableTabClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
widget_class->state_flags_changed = gtk_closable_tab_state_flags_changed;
}
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