From 64a597ef910a460c874e960ffbee3fb618818286 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Fri, 22 May 2020 23:54:36 -0500 Subject: [PATCH] Override GTK theme to control GtkCombo* sizes --- src/AudacityApp.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index 68c8c0d6f..99154628e 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -52,6 +52,9 @@ It handles initialization and termination by subclassing wxApp. #ifdef __WXGTK__ #include +#ifdef HAVE_GTK +#include +#endif #endif // chmod, lstat, geteuid @@ -1180,6 +1183,24 @@ bool AudacityApp::OnInit() #if defined(__WXMAC__) // Disable window animation wxSystemOptions::SetOption(wxMAC_WINDOW_PLAIN_TRANSITION, 1); +#endif + + // Some GTK themes produce larger combo boxes that make them taller + // than our single toolbar height restriction. This will remove some + // of the extra space themes add. + // + // NOTE: It's important that the widgets are created with an initial + // size, otherwise this override will not work. +#if defined(__WXGTK3__) && defined(HAVE_GTK) + // LLL: I've been unsuccessful at overriding GTK3 styles :-( +#elif defined(__WXGTK__) && defined(HAVE_GTK) + gtk_rc_parse_string("style \"audacity\" {\n" + " GtkButton::inner_border = { 0, 0, 0, 0 }\n" + " xthickness = 4\n" + " ythickness = 0\n" + "}\n" + "widget_class \"*GtkCombo*\" style \"audacity\""); + #endif // Don't use AUDACITY_NAME here.