Yet another attempt to standardize button heights.
Use the same string for all ArdourButtons to define the height. Height can still vary if you use a different font, though.
This commit is contained in:
parent
aed4ab6ec9
commit
f3d524deb7
@ -512,7 +512,17 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
|
|||||||
CairoWidget::on_size_request (req);
|
CairoWidget::on_size_request (req);
|
||||||
|
|
||||||
if ((_elements & Text) && !_text.empty()) {
|
if ((_elements & Text) && !_text.empty()) {
|
||||||
_layout->get_pixel_size (_text_width, _text_height);
|
|
||||||
|
//calc our real width for our string (but ignore the height, because that results in inconsistent button heights)
|
||||||
|
int ignored;
|
||||||
|
_layout->get_pixel_size (_text_width, ignored);
|
||||||
|
|
||||||
|
//calc the height using some text with both ascenders and descenders
|
||||||
|
std::string t = _layout->get_text();
|
||||||
|
_layout->set_text ("WjgO"); //what we put here probably doesn't matter, as long as its the same for everyone
|
||||||
|
_layout->get_pixel_size (ignored, _text_height);
|
||||||
|
_layout->set_text (t);
|
||||||
|
|
||||||
if (_text_width + _diameter < 75) {
|
if (_text_width + _diameter < 75) {
|
||||||
xpad = 7;
|
xpad = 7;
|
||||||
} else {
|
} else {
|
||||||
|
@ -165,12 +165,10 @@ MixerStrip::init ()
|
|||||||
|
|
||||||
input_button.set_text (_("Input"));
|
input_button.set_text (_("Input"));
|
||||||
input_button.set_name ("mixer strip button");
|
input_button.set_name ("mixer strip button");
|
||||||
input_button.set_size_request (-1, 20);
|
|
||||||
input_button_box.pack_start (input_button, true, true);
|
input_button_box.pack_start (input_button, true, true);
|
||||||
|
|
||||||
output_button.set_text (_("Output"));
|
output_button.set_text (_("Output"));
|
||||||
output_button.set_name ("mixer strip button");
|
output_button.set_name ("mixer strip button");
|
||||||
output_button.set_size_request (-1, 20);
|
|
||||||
|
|
||||||
ARDOUR_UI::instance()->set_tip (&meter_point_button, _("Click to select metering point"), "");
|
ARDOUR_UI::instance()->set_tip (&meter_point_button, _("Click to select metering point"), "");
|
||||||
meter_point_button.set_name ("mixer strip button");
|
meter_point_button.set_name ("mixer strip button");
|
||||||
@ -259,15 +257,12 @@ MixerStrip::init ()
|
|||||||
name_button.set_text (""); /* back to empty */
|
name_button.set_text (""); /* back to empty */
|
||||||
name_button.layout()->set_ellipsize (Pango::ELLIPSIZE_END);
|
name_button.layout()->set_ellipsize (Pango::ELLIPSIZE_END);
|
||||||
name_button.signal_size_allocate().connect (sigc::mem_fun (*this, &MixerStrip::name_button_resized));
|
name_button.signal_size_allocate().connect (sigc::mem_fun (*this, &MixerStrip::name_button_resized));
|
||||||
name_button.set_size_request (-1, 20);
|
|
||||||
|
|
||||||
ARDOUR_UI::instance()->set_tip (&group_button, _("Mix group"), "");
|
ARDOUR_UI::instance()->set_tip (&group_button, _("Mix group"), "");
|
||||||
group_button.set_name ("mixer strip button");
|
group_button.set_name ("mixer strip button");
|
||||||
group_button.set_size_request (-1, 20);
|
|
||||||
|
|
||||||
_comment_button.set_name (X_("mixer strip button"));
|
_comment_button.set_name (X_("mixer strip button"));
|
||||||
_comment_button.signal_clicked.connect (sigc::mem_fun (*this, &RouteUI::toggle_comment_editor));
|
_comment_button.signal_clicked.connect (sigc::mem_fun (*this, &RouteUI::toggle_comment_editor));
|
||||||
_comment_button.set_size_request (-1, 20);
|
|
||||||
|
|
||||||
global_vpacker.set_border_width (1);
|
global_vpacker.set_border_width (1);
|
||||||
global_vpacker.set_spacing (0);
|
global_vpacker.set_spacing (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user