mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-23 23:17:46 +01:00
add std::string variant of set_size_request_to_display_given_string()
This commit is contained in:
parent
53d8318a26
commit
e614f1f7c2
2 changed files with 16 additions and 0 deletions
|
|
@ -76,6 +76,17 @@ Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w, const gchar *
|
|||
w.set_size_request(width + hpadding, height + vpadding);
|
||||
}
|
||||
|
||||
void
|
||||
Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w, std::string const & text,
|
||||
gint hpadding, gint vpadding)
|
||||
{
|
||||
int width, height;
|
||||
w.ensure_style ();
|
||||
|
||||
get_pixel_size (w.create_pango_layout (text), width, height);
|
||||
w.set_size_request(width + hpadding, height + vpadding);
|
||||
}
|
||||
|
||||
void
|
||||
Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w,
|
||||
const std::vector<std::string>& strings,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue