From 5929a0b1cdb9eeb176c7bbb84d3a8e30fdd38900 Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Mon, 1 Apr 2019 17:19:32 +1100 Subject: Realign and reorder guides UI --- src/ui/widget/labelled.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/ui/widget/labelled.cpp') diff --git a/src/ui/widget/labelled.cpp b/src/ui/widget/labelled.cpp index 159669b24..83d2684aa 100644 --- a/src/ui/widget/labelled.cpp +++ b/src/ui/widget/labelled.cpp @@ -32,8 +32,18 @@ Labelled::Labelled(Glib::ustring const &label, Glib::ustring const &tooltip, _icon = Gtk::manage(sp_get_icon_image(icon, Gtk::ICON_SIZE_LARGE_TOOLBAR)); pack_start(*_icon, Gtk::PACK_SHRINK); } - pack_start(*Gtk::manage(_label), Gtk::PACK_SHRINK, 6); - pack_start(*Gtk::manage(_widget), Gtk::PACK_SHRINK, 6); + + set_spacing(6); + // Setting margins separately allows for more control over them +#if GTK_CHECK_VERSION(3,12,0) + set_margin_start(6); + set_margin_end(6); +#else + set_margin_left(6); + set_margin_right(6); +#endif + pack_start(*Gtk::manage(_label), Gtk::PACK_SHRINK); + pack_start(*Gtk::manage(_widget), Gtk::PACK_SHRINK); if (mnemonic) { _label->set_mnemonic_widget(*_widget); } @@ -82,11 +92,9 @@ bool Labelled::on_mnemonic_activate ( bool group_cycling ) void Labelled::set_hexpand(bool expand) { - if (expand) { - child_property_pack_type(*_widget) = Gtk::PACK_END; - } else { - child_property_pack_type(*_widget) = Gtk::PACK_START; - } + // should only have 2 children, but second child may not be _widget + child_property_pack_type(*get_children().back()) = expand ? Gtk::PACK_END + : Gtk::PACK_START; Gtk::HBox::set_hexpand(expand); } -- cgit v1.2.3