add std::string variant of set_size_request_to_display_given_string()
This commit is contained in:
parent
9f4a00fa89
commit
b9c53ea395
@ -65,11 +65,16 @@ namespace Gtkmm2ext {
|
||||
gint hpadding,
|
||||
gint vpadding);
|
||||
|
||||
LIBGTKMM2EXT_API void set_size_request_to_display_given_text (Gtk::Widget &w,
|
||||
std::string const & text,
|
||||
gint hpadding,
|
||||
gint vpadding);
|
||||
LIBGTKMM2EXT_API void set_size_request_to_display_given_text (Gtk::Widget &w,
|
||||
const std::vector<std::string>&,
|
||||
gint hpadding,
|
||||
gint vpadding);
|
||||
|
||||
|
||||
LIBGTKMM2EXT_API Glib::RefPtr<Gdk::Pixbuf> pixbuf_from_string (const std::string& name,
|
||||
const Pango::FontDescription& font,
|
||||
int clip_width,
|
||||
|
@ -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…
Reference in New Issue
Block a user