From 7917eb30964900e347405e79c87d7f86de540f79 Mon Sep 17 00:00:00 2001 From: QC Date: Sun, 21 Jul 2013 16:48:51 +0200 Subject: [PATCH] [3791] Fix labels not click-able. * Use RadioButton.with_label again, then manually set ellipsize on auto-added label. --- src/browsers/gmpc-nowplaying2.vala | 62 ++++++++++++++------------------------ 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/src/browsers/gmpc-nowplaying2.vala b/src/browsers/gmpc-nowplaying2.vala index 62cafe09..fca50c9f 100644 --- a/src/browsers/gmpc-nowplaying2.vala +++ b/src/browsers/gmpc-nowplaying2.vala @@ -654,17 +654,14 @@ namespace Gmpc var text_view = new Gmpc.MetaData.Widgets.TextLabel(song, Gmpc.MetaData.Type.SONG_TXT); alib.add(text_view); notebook.append_page(alib, new Gtk.Label("Lyrics")); - var button = new Gtk.RadioButton(group);//.with_label(group,("Lyrics")); - var label = new Gtk.Label(_("Lyrics")); - label.ellipsize = Pango.EllipsizeMode.END; - label.set_alignment(0.0f, 0.5f); -// button.add(label); + var button = new Gtk.RadioButton.with_label(group,("Lyrics")); + ((button as Gtk.Bin).get_child() as + Gtk.Label).set_ellipsize(Pango.EllipsizeMode.END); if(group != null) hboxje.pack_start(new Gtk.VSeparator(), false, false, 0); group = button.get_group(); hboxje.pack_start(button, false, false, 0); - hboxje.pack_start(label, true, true, 0); var j = i; button.clicked.connect((source) => { @@ -687,16 +684,14 @@ namespace Gmpc var text_view = new Gmpc.MetaData.Widgets.TextLabel(song, Gmpc.MetaData.Type.ALBUM_TXT); alib.add(text_view); notebook.append_page(alib, new Gtk.Label("Album information")); - var button = new Gtk.RadioButton(group); - var label = new Gtk.Label(_("Album information")); - label.ellipsize = Pango.EllipsizeMode.END; - label.set_alignment(0.0f, 0.5f); + var button = new Gtk.RadioButton.with_label(group,_("Album information")); + ((button as Gtk.Bin).get_child() as + Gtk.Label).set_ellipsize(Pango.EllipsizeMode.END); if(group != null) hboxje.pack_start(new Gtk.VSeparator(), false, false, 0); group = button.get_group(); hboxje.pack_start(button, false, false, 0); - hboxje.pack_start(label, true, true, 0); var j = i; button.clicked.connect((source) => { @@ -717,16 +712,15 @@ namespace Gmpc var alib = new Gtk.Alignment(0f,0f,1f,0f); var text_view_queried = false; notebook.append_page(alib, new Gtk.Label(_("Guitar Tabs"))); - var button = new Gtk.RadioButton(group);//.with_label(group,_("Guitar Tabs")); - var label = new Gtk.Label(_("Guitar Tabs")); - label.ellipsize = Pango.EllipsizeMode.END; - label.set_alignment(0.0f, 0.5f); + var button = new Gtk.RadioButton.with_label(group,_("Guitar Tabs")); + ((button as Gtk.Bin).get_child() as + Gtk.Label).set_ellipsize(Pango.EllipsizeMode.END); + //button.add(label); if(group != null) hboxje.pack_start(new Gtk.VSeparator(), false, false, 0); group = button.get_group(); hboxje.pack_start(button, false, false, 0); - hboxje.pack_start(label, true, true, 0); var j = i; /* Only query the guitar-tab when opened or first notebook page*/ button.clicked.connect((source) => @@ -765,16 +759,13 @@ namespace Gmpc notebook.append_page(similar_songs_box, new Gtk.Label(_("Similar Songs"))); - var button = new Gtk.RadioButton(group);//.with_label(group,_("Similar Songs")); - var label = new Gtk.Label(_("Similar Songs")); - label.ellipsize = Pango.EllipsizeMode.END; - label.set_alignment(0.0f, 0.5f); - //button.add(label); + var button = new Gtk.RadioButton.with_label(group,_("Similar Songs")); + ((button as Gtk.Bin).get_child() as + Gtk.Label).set_ellipsize(Pango.EllipsizeMode.END); if(group != null) hboxje.pack_start(new Gtk.VSeparator(), false, false, 0); group = button.get_group(); hboxje.pack_start(button, false, false, 0); - hboxje.pack_start(label, true, true, 0); var j = i; /* Only query when opened or first notebook page*/ @@ -814,16 +805,13 @@ namespace Gmpc notebook.append_page(similar_artist, new Gtk.Label(_("Similar Artist"))); - var button = new Gtk.RadioButton(group);//.with_label(group,_("Similar Artist")); - var label = new Gtk.Label(_("Similar Artist")); - label.ellipsize = Pango.EllipsizeMode.END; - label.set_alignment(0.0f, 0.5f); - //button.add(label); + var button = new Gtk.RadioButton.with_label(group,_("Similar Artist")); + ((button as Gtk.Bin).get_child() as + Gtk.Label).set_ellipsize(Pango.EllipsizeMode.END); if(group != null) hboxje.pack_start(new Gtk.VSeparator(), false, false, 0); group = button.get_group(); hboxje.pack_start(button, false, false, 0); - hboxje.pack_start(label, true, true, 0); var j = i; button.clicked.connect((source) => @@ -845,16 +833,13 @@ namespace Gmpc var text_view_queried = false; notebook.append_page(alib, new Gtk.Label(_("Artist information"))); - var button = new Gtk.RadioButton(group);//.with_label(group,_("Artist information")); - var label = new Gtk.Label(_("Artist information")); - label.ellipsize = Pango.EllipsizeMode.END; - label.set_alignment(0.0f, 0.5f); - //button.add(label); + var button = new Gtk.RadioButton.with_label(group,_("Artist information")); + ((button as Gtk.Bin).get_child() as + Gtk.Label).set_ellipsize(Pango.EllipsizeMode.END); if(group != null) hboxje.pack_start(new Gtk.VSeparator(), false, false, 0); group = button.get_group(); hboxje.pack_start(button, false, false, 0); - hboxje.pack_start(label, true, true, 0); var j = i; /* Only query the guitar-tab when opened or first notebook page*/ button.clicked.connect((source) => @@ -889,16 +874,13 @@ namespace Gmpc var text_view_queried = false; notebook.append_page(alib, new Gtk.Label(_("Songs from album"))); - var button = new Gtk.RadioButton(group);//.with_label(group,_("Songs from album")); - var label = new Gtk.Label(_("Songs from album")); - label.ellipsize = Pango.EllipsizeMode.END; - label.set_alignment(0.0f, 0.5f); - //button.add(label); + var button = new Gtk.RadioButton.with_label(group,_("Songs from album")); + ((button as Gtk.Bin).get_child() as + Gtk.Label).set_ellipsize(Pango.EllipsizeMode.END); if(group != null) hboxje.pack_start(new Gtk.VSeparator(), false, false, 0); group = button.get_group(); hboxje.pack_start(button, false, false, 0); - hboxje.pack_start(label, true, true, 0); var j = i; var sl = new Gmpc.DataView("now-playing-song-from-album"); var sl_model = new Gmpc.MpdData.Model(); -- 2.11.4.GIT