From a83cce26cd86e87131321ba19a7ba32a9763fb28 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Wed, 25 Jul 2018 00:04:44 +0200 Subject: Improve the look of prefs buttons --- src/ui/widget/preferences-widget.cpp | 16 ++++++++++++---- src/ui/widget/preferences-widget.h | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/ui/widget') diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 2b5378416..171a20418 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -880,14 +880,22 @@ bool PrefEntryFileButtonHBox::on_mnemonic_activate ( bool group_cycling ) return relatedEntry->mnemonic_activate ( group_cycling ); } -void PrefOpenFolder::init(Glib::ustring const &entry_string, Glib::ustring const &button_text) +void PrefOpenFolder::init(Glib::ustring const &entry_string, Glib::ustring const &tooltip) { relatedEntry = new Gtk::Entry(); - relatedButton = new Gtk::Button(button_text); + relatedButton = new Gtk::Button(); + Gtk::HBox* pixlabel = new Gtk::HBox(false, 3); + Gtk::Image *im = sp_get_icon_image("document-open", Gtk::ICON_SIZE_BUTTON); + pixlabel->pack_start(*im); + Gtk::Label *l = new Gtk::Label(); + l->set_markup_with_mnemonic(_("_Browse...")); + pixlabel->pack_start(*l); + relatedButton->add(*pixlabel); + relatedButton->set_tooltip_text(tooltip); relatedEntry->set_text(entry_string); relatedEntry->set_sensitive(false); - this->pack_start(*relatedEntry); - this->pack_start(*relatedButton); + this->pack_end(*relatedButton, false, false, 4); + this->pack_start(*relatedEntry, true, true, 0); relatedButton->signal_clicked().connect( sigc::mem_fun(*this, &PrefOpenFolder::onRelatedButtonClickedCallback)); diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h index 2a2b2c5f8..d8d0123d0 100644 --- a/src/ui/widget/preferences-widget.h +++ b/src/ui/widget/preferences-widget.h @@ -250,7 +250,7 @@ protected: class PrefOpenFolder : public Gtk::HBox { public: - void init(Glib::ustring const &entry_string, Glib::ustring const &button_text); + void init(Glib::ustring const &entry_string, Glib::ustring const &tooltip); protected: Gtk::Button *relatedButton; Gtk::Entry *relatedEntry; -- cgit v1.2.3