From 26db9dec522ad82dd5d72e5dfbbebed832532dab Mon Sep 17 00:00:00 2001 From: "Geoffrey D. Bennett" Date: Sun, 26 Nov 2023 22:56:09 +1030 Subject: [PATCH] Improve layout for larger interfaces without speaker switching The Clarett 8Pre layout was very wide; it would be preferable if the main window output controls were placed below the global & input controls like for the Gen 3 18i8 and 18i20. Rather than use the presence of speaker switching to determine which main window layout to use, check the number of input & output controls, and use the taller layout if the total is 12 or more. --- src/iface-mixer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/iface-mixer.c b/src/iface-mixer.c index d94b09f..f2aab53 100644 --- a/src/iface-mixer.c +++ b/src/iface-mixer.c @@ -383,9 +383,13 @@ static GtkWidget *create_main_window_controls(struct alsa_card *card) { gtk_widget_set_margin(top, 10); gtk_grid_set_spacing(GTK_GRID(top), 10); + int input_count = get_max_elem_by_name(card->elems, "Line", "Capture Switch"); + int output_count = get_max_elem_by_name(card->elems, "Line", "Playback Volume"); + create_global_controls(card, top, &x); create_input_controls(card, top, &x); - if (card->has_speaker_switching) { + + if (input_count + output_count >= 12) { x = 0; GtkWidget *sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); gtk_grid_attach(GTK_GRID(top), sep, 0, 3, 3, 1);