mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
add std::string variant of set_size_request_to_display_given_string()
This commit is contained in:
parent
9f4a00fa89
commit
b9c53ea395
2 changed files with 16 additions and 0 deletions
|
|
@ -65,11 +65,16 @@ namespace Gtkmm2ext {
|
||||||
gint hpadding,
|
gint hpadding,
|
||||||
gint vpadding);
|
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,
|
LIBGTKMM2EXT_API void set_size_request_to_display_given_text (Gtk::Widget &w,
|
||||||
const std::vector<std::string>&,
|
const std::vector<std::string>&,
|
||||||
gint hpadding,
|
gint hpadding,
|
||||||
gint vpadding);
|
gint vpadding);
|
||||||
|
|
||||||
|
|
||||||
LIBGTKMM2EXT_API Glib::RefPtr<Gdk::Pixbuf> pixbuf_from_string (const std::string& name,
|
LIBGTKMM2EXT_API Glib::RefPtr<Gdk::Pixbuf> pixbuf_from_string (const std::string& name,
|
||||||
const Pango::FontDescription& font,
|
const Pango::FontDescription& font,
|
||||||
int clip_width,
|
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);
|
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
|
void
|
||||||
Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w,
|
Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w,
|
||||||
const std::vector<std::string>& strings,
|
const std::vector<std::string>& strings,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue