diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-03-22 17:29:31 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-03-22 17:37:50 +0000 |
| commit | be9fbab855fe865828a141042a158bbb0c456a72 (patch) | |
| tree | 8b5d41f3f0c622fd462b5ebfbb708912f22755a6 /src/ui/widget/labelled.cpp | |
| parent | Sync upstream libUEMF (0.2.6) (diff) | |
| download | inkscape-be9fbab855fe865828a141042a158bbb0c456a72.tar.gz inkscape-be9fbab855fe865828a141042a158bbb0c456a72.zip | |
Document Properties: General UI cleanup
Try to achieve consistent look and reasonable alignment.
Account for some gtk3 changes and some minor code cleanup.
Diffstat (limited to 'src/ui/widget/labelled.cpp')
| -rw-r--r-- | src/ui/widget/labelled.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ui/widget/labelled.cpp b/src/ui/widget/labelled.cpp index dfbc01ddd..159669b24 100644 --- a/src/ui/widget/labelled.cpp +++ b/src/ui/widget/labelled.cpp @@ -24,7 +24,7 @@ Labelled::Labelled(Glib::ustring const &label, Glib::ustring const &tooltip, Glib::ustring const &icon, bool mnemonic) : _widget(widget), - _label(new Gtk::Label(label, Gtk::ALIGN_END, Gtk::ALIGN_CENTER, mnemonic)), + _label(new Gtk::Label(label, Gtk::ALIGN_START, Gtk::ALIGN_CENTER, mnemonic)), _suffix(new Gtk::Label(suffix, Gtk::ALIGN_START)) { g_assert(g_utf8_validate(icon.c_str(), -1, nullptr)); @@ -32,7 +32,7 @@ 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_EXPAND_WIDGET, 6); + pack_start(*Gtk::manage(_label), Gtk::PACK_SHRINK, 6); pack_start(*Gtk::manage(_widget), Gtk::PACK_SHRINK, 6); if (mnemonic) { _label->set_mnemonic_widget(*_widget); @@ -79,6 +79,18 @@ bool Labelled::on_mnemonic_activate ( bool group_cycling ) return _widget->mnemonic_activate ( 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; + } + + Gtk::HBox::set_hexpand(expand); +} + } // namespace Widget } // namespace UI } // namespace Inkscape |
