diff options
author | David Robillard <d@drobilla.net> | 2011-11-23 08:35:41 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-11-23 08:35:41 +0000 |
commit | e70249ab658ef1b02da01d84bf2d9b46847e5194 (patch) | |
tree | 91c3e5e04152e201e19eec85b725fdefe76a5cb8 /libs | |
parent | 8301e6c55fe3d827b155618ef52eba1966b44d78 (diff) |
Pack toolbar combo boxes with expand=false and remove size kludges.
Turns out gtk these days sizes combo boxes with precisely enough space if
packed to not expand, none of this mess is necessary any more.
git-svn-id: svn://localhost/ardour2/branches/3.0@10790 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/utils.h | 21 | ||||
-rw-r--r-- | libs/gtkmm2ext/utils.cc | 8 | ||||
-rw-r--r-- | libs/surfaces/generic_midi/gmcp_gui.cc | 2 |
3 files changed, 8 insertions, 23 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/utils.h b/libs/gtkmm2ext/gtkmm2ext/utils.h index 82eeaf71ea..a4c6c49886 100644 --- a/libs/gtkmm2ext/gtkmm2ext/utils.h +++ b/libs/gtkmm2ext/gtkmm2ext/utils.h @@ -60,23 +60,14 @@ namespace Gtkmm2ext { gint hpadding, gint vpadding); - Glib::RefPtr<Gdk::Pixbuf> pixbuf_from_string (const std::string& name, - const Pango::FontDescription& font, - int clip_width, - int clip_height, - Gdk::Color fg); + Glib::RefPtr<Gdk::Pixbuf> pixbuf_from_string (const std::string& name, + const Pango::FontDescription& font, + int clip_width, + int clip_height, + Gdk::Color fg); void set_popdown_strings (Gtk::ComboBoxText&, - const std::vector<std::string>&, - bool set_size = false, - gint hpadding = 0, gint vpadding = 0); - - // Combo's are stupid - they steal space from the entry for the button -#ifdef GTKOSX - static const guint32 COMBO_FUDGE = 38; -#else - static const guint32 COMBO_FUDGE = 24; -#endif + const std::vector<std::string>&); template<class T> void deferred_delete (void *ptr) { delete static_cast<T *> (ptr); diff --git a/libs/gtkmm2ext/utils.cc b/libs/gtkmm2ext/utils.cc index ff5e5d8a9c..d9e1d15e9f 100644 --- a/libs/gtkmm2ext/utils.cc +++ b/libs/gtkmm2ext/utils.cc @@ -63,7 +63,6 @@ get_pixel_size (Glib::RefPtr<Pango::Layout> layout, void Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w, const gchar *text, gint hpadding, gint vpadding) - { int width, height; w.ensure_style (); @@ -76,7 +75,6 @@ void Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w, const std::vector<std::string>& strings, gint hpadding, gint vpadding) - { int width, height; int width_max = 0; @@ -220,16 +218,12 @@ Gtkmm2ext::pixbuf_from_string(const string& name, const Pango::FontDescription& } void -Gtkmm2ext::set_popdown_strings (Gtk::ComboBoxText& cr, const vector<string>& strings, bool set_size, gint hpadding, gint vpadding) +Gtkmm2ext::set_popdown_strings (Gtk::ComboBoxText& cr, const vector<string>& strings) { vector<string>::const_iterator i; cr.clear (); - if (set_size) { - set_size_request_to_display_given_text (cr, strings, COMBO_FUDGE+10+hpadding, 15+vpadding); - } - for (i = strings.begin(); i != strings.end(); ++i) { cr.append_text (*i); } diff --git a/libs/surfaces/generic_midi/gmcp_gui.cc b/libs/surfaces/generic_midi/gmcp_gui.cc index c5ffce369d..88ba20a78e 100644 --- a/libs/surfaces/generic_midi/gmcp_gui.cc +++ b/libs/surfaces/generic_midi/gmcp_gui.cc @@ -71,7 +71,7 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p) popdowns.push_back ((*x).name); } - set_popdown_strings (map_combo, popdowns, true, 5, 2); + set_popdown_strings (map_combo, popdowns); if (cp.current_binding().empty()) { map_combo.set_active_text (popdowns[0]); |