On 26.09.25 15:13, Will Godfrey wrote:
Confirmed fixed for the main and mixer windows, but still not correct in
the bank window - slightly less of a problem actually.

On 26.09.25 18:08, ichthyo wrote:
Indeed I noticed that too, yesterday evening, but I can not yet explain it.

After looking a bit around, it's pretty much obvious what is going on here.
The logic was implemented two times, for the refresh() and the draw() function.

The different label colour is set only in the refresh() handler,
but the draw() is invoked much more frequently, and so the change is
overwritten immediately.

Furthermore, the refresh() used `gen_text` for the legacy case,
while the draw() used `bank_text` for both cases.

I think it should always  be `bank_text` for legacy or `yoshi_ins_typ`

See my proposed patch, attached to this message


you can directly apply this patch from the git tree with


git am BugFix-bank-label-colour-handled-inconsistently.patch



-- Hermann





From ea883763641590785342ba3977d61b3d239d7a0a Mon Sep 17 00:00:00 2001
From: Ichthyostega <[email protected]>
Date: Sun, 28 Sep 2025 18:41:39 +0200
Subject: [PATCH] BugFix: bank label colour handled inconsistently

- the refresh() function differentiated between legacy and Yoshimi instruments,
  but used `gen_text` for the legacy case
- the draw() handler used `bank_text` and did not differentiate by instrument type

Since draw() is called on any drawing and typically after event handling,
the colour setting is overwritten immediately and never becomes visible.

Solution: handle both with the same logic,
          and use `bank_text` as as the label text colour for legacy instruments
---
 src/UI/BankUI.fl | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/UI/BankUI.fl b/src/UI/BankUI.fl
index b235091e..5430ce06 100644
--- a/src/UI/BankUI.fl
+++ b/src/UI/BankUI.fl
@@ -155,9 +155,9 @@ class BankSlot {: {public Fl_Button, BankProcess_}
     bankID = bk;
     lastSeen = last;
     if (bank->engines_used(rt, bk, nslot) & 8)
-        labelcolor(yoshi_ins_typ);
+        labelcolor(yoshi_ins_typ);      // Slot marked as Yoshimi-format instrument in the banks-file
     else
-        labelcolor(gen_text);} {}
+        labelcolor(bank_text);} {}
   }
   decl {int *what, *whatslot, nslot, highlight, *nselected;} {private local
   }
@@ -215,8 +215,11 @@ class BankSlot {: {public Fl_Button, BankProcess_}
     //frame for label
     draw_box(value() ? (down_box() ? down_box() : fl_down(box())) : box(), x(), y(), w(), h(), Fl_Color(17));
 
-    labelcolor(bank_text);
-        draw_label();
+    if (engine & 8)   // Slot marked as Yoshimi-format instrument in the banks-file
+        labelcolor(yoshi_ins_typ);
+    else
+        labelcolor(bank_text);
+    draw_label();
 
     if (Fl::focus() == this) draw_focus();} {}
   }
-- 
2.47.3

_______________________________________________
Yoshimi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to