Skip to content

Commit bfeba68

Browse files
committed
Expand search entry in header bar
1 parent d52b395 commit bfeba68

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/PopupWindow.vala

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Plotinus.PopupWindow : Gtk.Window {
1818
destroy_with_parent = true;
1919
modal = true;
2020

21-
// Width is determined by the width of the search entry
21+
// Width is determined by the width of the search entry/command list
2222
set_default_size(-1, 300);
2323
set_size_request(-1, 200);
2424

@@ -36,10 +36,12 @@ class Plotinus.PopupWindow : Gtk.Window {
3636
set_titlebar(header_bar);
3737

3838
var search_entry = new Gtk.SearchEntry();
39-
// TODO: This is currently an unfortunate necessity as stable versions of GTK+
40-
// do not support expanding packed widgets. The fix will be in a future release
41-
// (see https://bugzilla.gnome.org/show_bug.cgi?id=724332).
42-
search_entry.set_size_request(600, -1);
39+
search_entry.hexpand = true;
40+
if (Gtk.get_major_version() == 3 && Gtk.get_minor_version() < 22) {
41+
// GTK+ < 3.22 does not support expanding packed widgets
42+
// (see https://bugzilla.gnome.org/show_bug.cgi?id=724332)
43+
search_entry.set_size_request(600, -1);
44+
}
4345
search_entry.margin = 4;
4446
header_bar.custom_title = search_entry;
4547

0 commit comments

Comments
 (0)