mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
first half of the mega-by-hand-commit-by-commit merge from 2.X
git-svn-id: svn://localhost/ardour2/branches/3.0@4980 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
ece2bacb2c
commit
54d9f2f2d8
38 changed files with 510 additions and 304 deletions
|
|
@ -59,8 +59,8 @@ Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w, const gchar *
|
|||
|
||||
void
|
||||
Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w,
|
||||
const std::vector<std::string>& strings,
|
||||
gint hpadding, gint vpadding)
|
||||
const std::vector<std::string>& strings,
|
||||
gint hpadding, gint vpadding)
|
||||
|
||||
{
|
||||
int width, height;
|
||||
|
|
@ -68,11 +68,10 @@ Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w,
|
|||
int height_max = 0;
|
||||
w.ensure_style ();
|
||||
|
||||
for (vector<string>::const_iterator i = strings.begin();
|
||||
i != strings.end(); ++i) {
|
||||
get_ink_pixel_size (w.create_pango_layout (*i), width, height);
|
||||
width_max = max(width_max,width);
|
||||
height_max = max(height_max, height);
|
||||
for (vector<string>::const_iterator i = strings.begin(); i != strings.end(); ++i) {
|
||||
get_ink_pixel_size (w.create_pango_layout (*i), width, height);
|
||||
width_max = max(width_max,width);
|
||||
height_max = max(height_max, height);
|
||||
}
|
||||
w.set_size_request(width_max + hpadding, height_max + vpadding);
|
||||
}
|
||||
|
|
@ -85,11 +84,36 @@ Gtkmm2ext::init ()
|
|||
}
|
||||
|
||||
void
|
||||
Gtkmm2ext::set_popdown_strings (Gtk::ComboBoxText& cr, const vector<string>& strings)
|
||||
Gtkmm2ext::set_popdown_strings (Gtk::ComboBoxText& cr, const vector<string>& strings, bool set_size, gint hpadding, gint vpadding)
|
||||
{
|
||||
vector<string>::const_iterator i;
|
||||
|
||||
cr.clear ();
|
||||
|
||||
for (vector<string>::const_iterator i = strings.begin(); i != strings.end(); ++i) {
|
||||
if (set_size) {
|
||||
vector<string> copy;
|
||||
|
||||
for (i = strings.begin(); i != strings.end(); ++i) {
|
||||
if ((*i).find_first_of ("gy") != string::npos) {
|
||||
/* contains a descender */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == strings.end()) {
|
||||
|
||||
/* make a copy of the strings then add one that has a descener */
|
||||
|
||||
copy = strings;
|
||||
copy.push_back ("g");
|
||||
set_size_request_to_display_given_text (cr, copy, COMBO_FUDGE+10+hpadding, 15+vpadding);
|
||||
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue