Commit c2657115 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels
Browse files

input-sources: don't show button if not needed

parent 40da22a4
......@@ -137,6 +137,21 @@ gf_input_sources_button_set_property (GObject *object,
}
}
static void
gf_input_sources_button_show (GtkWidget *widget)
{
GfInputSourcesButton *self;
GList *input_sources;
self = GF_INPUT_SOURCES_BUTTON (widget);
input_sources = gf_input_source_manager_get_input_sources (self->manager);
if (g_list_length (input_sources) <= 1)
return;
GTK_WIDGET_CLASS (gf_input_sources_button_parent_class)->show (widget);
}
static void
gf_input_sources_button_clicked (GtkButton *button)
{
......@@ -166,15 +181,19 @@ static void
gf_input_sources_button_class_init (GfInputSourcesButtonClass *self_class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkButtonClass *button_class;
object_class = G_OBJECT_CLASS (self_class);
widget_class = GTK_WIDGET_CLASS (self_class);
button_class = GTK_BUTTON_CLASS (self_class);
object_class->constructed = gf_input_sources_button_constructed;
object_class->dispose = gf_input_sources_button_dispose;
object_class->set_property = gf_input_sources_button_set_property;
widget_class->show = gf_input_sources_button_show;
button_class->clicked = gf_input_sources_button_clicked;
install_properties (object_class);
......
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