Skip to content

armgit / nota

Public Imported from GitHub
0

Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.

(fix) Compact Mixer: show the whole name in the MIDI-in selector (#553)

vv7r4c54a36a5969
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8a8de4e5..df7daa1a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -65,6 +65,12 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
French interface got the English manual and a Russian OS with an English interface got the
Russian one.
+### Fixed
+- **Compact Mixer: the MIDI-in selector shows its whole name** (#550): the drop-down on an
+ instrument strip left 20 px for the chosen name, so "Aucune" read "ucun" and a longer track
+ name lost both ends. It now leaves about 29 px, writes the name from the left and ends a longer
+ one with "…". The regular strip is unchanged.
+
## [0.59.2] — 2026-11-08
### Added
diff --git a/src/managed/Nota.App/MixerView.cs b/src/managed/Nota.App/MixerView.cs
index 395d597f..4362d46b 100644
--- a/src/managed/Nota.App/MixerView.cs
+++ b/src/managed/Nota.App/MixerView.cs
@@ -21,9 +21,11 @@ using System.Globalization;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
+using Avalonia.Controls.Templates;
using Avalonia.Input;
using Avalonia.Layout;
using Avalonia.Media;
+using Avalonia.Styling;
using Nota.Application;
using Nota.Application.Editing;
using Nota.Application.Localization;
@@ -916,10 +918,24 @@ public sealed partial class MixerView : UserControl
FontSize = 8, Height = 16, MinHeight = 0, Padding = new Thickness(5, 0),
HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalContentAlignment = HorizontalAlignment.Stretch,
};
+ if (compact)
+ {
+ // Plain strings drawn by a template, so the closed box builds a live TextBlock that
+ // trims with "…". A TextBlock handed over as the item's Content is shown there as a
+ // picture of itself, centred, and a name wider than the box lost both ends (#550).
+ // No recycling: the closed box would keep the first TextBlock, whose Text is set once, and
+ // go on showing the previous name after another source is picked.
+ cb.ItemTemplate = new FuncDataTemplate<string>((label, _) => new TextBlock { Text = label, FontSize = 8, TextTrimming = TextTrimming.CharacterEllipsis }, supportsRecycling: false);
+ var item = new Style(x => x.OfType<ComboBoxItem>());
+ item.Setters.Add(new Setter(TemplatedControl.PaddingProperty, new Thickness(5, 1)));
+ item.Setters.Add(new Setter(Layoutable.MinHeightProperty, 0.0));
+ cb.Styles.Add(item);
+ }
var sources = new List<int>();
void Add(string label, int src)
{
- cb.Items.Add(new ComboBoxItem { Content = new TextBlock { Text = label, FontSize = 8, TextTrimming = TextTrimming.CharacterEllipsis }, Padding = new Thickness(5, 1), MinHeight = 0 });
+ if (compact) cb.Items.Add(label);
+ else cb.Items.Add(new ComboBoxItem { Content = new TextBlock { Text = label, FontSize = 8, TextTrimming = TextTrimming.CharacterEllipsis }, Padding = new Thickness(5, 1), MinHeight = 0 });
sources.Add(src);
}
Add(Loc.T("common.none"), -1);
@@ -938,6 +954,7 @@ public sealed partial class MixerView : UserControl
if (compact) // one line: the selector alone, its label in the tooltip (specs/070)
{
cb.Height = 14;
+ cb.Padding = new Thickness(1, 0); // the arrow column keeps 32 px of the 62; leave the text what is left
ToolTip.SetTip(cb, Loc.T("mixer.midi_in"));
return new Border { Height = IoH, BorderBrush = BorderInner, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(4, 2), Child = cb };
}