From abdae636eb7de3ffb713306a86c6df075d87e76b Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Thu, 20 Feb 2025 18:57:36 -0600 Subject: [PATCH] Group tabs should match the size of a generic ArdourButton --- gtk2_ardour/group_tabs.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/group_tabs.cc b/gtk2_ardour/group_tabs.cc index b8e13a7e9a..b682c601b7 100644 --- a/gtk2_ardour/group_tabs.cc +++ b/gtk2_ardour/group_tabs.cc @@ -49,6 +49,8 @@ using Gtkmm2ext::Keyboard; list GroupTabs::_used_colors; +#define BASELINESTRETCH (1.25) + GroupTabs::GroupTabs () : _dragging_new_tab (0) , _menu (0) @@ -140,8 +142,16 @@ GroupTabs::set_offset (double offset) void GroupTabs::on_size_request (Gtk::Requisition *req) { - req->width = std::max (16.f, rintf (16.f * UIConfiguration::instance().get_ui_scale())); - req->height = std::max (16.f, rintf (16.f * UIConfiguration::instance().get_ui_scale())); + Glib::RefPtr layout; + layout = Pango::Layout::create (get_pango_context ()); + layout->set_text (X_("Tab Text")); + int tw, th; + layout->get_pixel_size (tw, th); + + int size = (int) ceil(th * BASELINESTRETCH + 1.0); //@robin this should match ArdourButton impl + + req->width = size; + req->height = size; } bool