Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
C# audioaudio-unitavaloniacpp20cross-platformdawdigital-audio-workstationdspjucelinux-audiomcp-servermidimusicmusic-productionpiano-rollplugin-hostsequencersynthesizervstvst3
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
//
// Marks a control that exists on the mockup but whose feature isn't implemented
// yet (HANDOFF §4). The badge itself is a visible chip with a tooltip; the
// feature control it sits on is left disabled so the layout doesn't shift when
// the feature ships. Two variants: "N/A" (not implemented) and "M7+" (planned
// for a later milestone).
using Avalonia;
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Media;
using Nota.Application.Localization;
namespace Nota.App;
public enum NaBadgeKind { NA, Future }
public sealed class NaBadge : Border
{
public static readonly StyledProperty<NaBadgeKind> KindProperty =
AvaloniaProperty.Register<NaBadge, NaBadgeKind>(nameof(Kind));
public NaBadgeKind Kind
{
get => GetValue(KindProperty);
set => SetValue(KindProperty, value);
}
private readonly TextBlock _label = new()
{
FontSize = 9,
FontWeight = FontWeight.Bold,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Center,
};
public NaBadge()
{
CornerRadius = NotaRadius.Group;
Padding = new Thickness(6, 1);
Height = 16;
VerticalAlignment = VerticalAlignment.Center;
Child = _label;
_label.BindResource(TextBlock.FontFamilyProperty, "Font.Measure");
Apply();
}
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs e)
{
base.OnPropertyChanged(e);
if (e.Property == KindProperty) Apply();
}
private void Apply()
{
if (Kind == NaBadgeKind.Future)
{
_label.Text = "N/A";
// Neutral: "not built yet" is not active, selected or changed, so it takes no brass.
this.BindResource(BackgroundProperty, "Brush.SurfaceRaised");
_label.BindResource(TextBlock.ForegroundProperty, "Brush.TextTertiary");
ToolTip.SetTip(this, Loc.T("control.na_badge.not_available_yet"));
}
else
{
_label.Text = "N/A";
this.BindResource(BackgroundProperty, "Brush.SurfaceRaised");
_label.BindResource(TextBlock.ForegroundProperty, "Brush.TextTertiary");
ToolTip.SetTip(this, Loc.T("control.na_badge.not_available_yet"));
}
}
}