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.

Minor button fixes

Egor Khindikaynen6161679f34d6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 098a7c3f..c4d028df 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -68,9 +68,11 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
playback reads as a single object, and tempo, signature, grid and launch quantize use
one value-over-label cell so the row scans as a strip of readouts. The position readout
is now large enough to read across the room and says underneath which clock it is
- showing. Nothing was dropped: the three add-track buttons collapse into a **+ Track**
- menu, launch quantize appears in Session where it applies, and **Follow playhead** moved
- to the View menu.
+ showing. The four switches — metronome, follow playhead, snap and automation — are icons
+ now instead of words, each drawing the thing it does. Nothing was dropped: the three
+ add-track buttons collapse into a **+ Track** menu, launch quantize appears in Session
+ where it applies, and Follow playhead is both a button in the row and **View ▸ Follow
+ playhead**, which stay in step with each other.
- **Master shows the gain it is applying,** in dB, next to its fader and meter — the
handle position is no longer the only readout.
- **The arrangement and the modular canvas are islands, and groups stop weighing as much as
diff --git a/DESIGN.md b/DESIGN.md
index 92ec31dc..c595718e 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -284,9 +284,9 @@ then, pinned right, what the machine is doing. Transport, position and loop shar
single `Border.console` recess on `Brush.SurfaceAbyss` so playback reads as one object;
tempo, signature, grid and launch quantize use one `.cell` shape — mono value over an 8px
`.CellLabel` — so the row scans as a strip of readouts rather than a queue of pills.
-The three switches — metronome, snap, automation — are icon-only 28px `tp-icon` toggles
-that draw the thing they do (a metronome, a horseshoe magnet, a breakpoint envelope) and
-carry their name in a tooltip; none sets a Foreground, so the engaged state turns the
+The four switches — metronome, follow playhead, snap, automation — are icon-only 28px
+`tp-icon` toggles that draw the thing they do (a metronome, a playhead on its ruler, a
+horseshoe magnet, a breakpoint envelope) and carry their name in a tooltip; none sets a Foreground, so the engaged state turns the
glyph brass through the base `ToggleButton:checked`. Controls that belong to one context
appear only there: launch quantize in Session, "Re-enable" only while a lane is
overridden.
diff --git a/src/managed/Nota.App/MainWindow.Menu.cs b/src/managed/Nota.App/MainWindow.Menu.cs
index 02207230..19f0eb2a 100644
--- a/src/managed/Nota.App/MainWindow.Menu.cs
+++ b/src/managed/Nota.App/MainWindow.Menu.cs
@@ -157,16 +157,9 @@ public partial class MainWindow
_vm.Settings.Save();
_vm.StatusText = Timeline.ShowSections ? "Sections lane shown" : "Sections lane hidden";
}
- // Follow: keep the arrangement scrolling with the playhead during playback. Lives in
- // the View menu since the single-row transport (1b) has no room for a toolbar toggle.
+ // Follow: mirrors the transport bar's Follow button — one state, two surfaces.
private void OnMenuToggleFollow(object? sender, EventArgs e)
- {
- bool on = !Timeline.FollowPlayhead;
- Timeline.FollowPlayhead = on;
- if (sender is NativeMenuItem mi) mi.IsChecked = on;
- if (on) Timeline.RecenterOnPlayhead(); // jump to the cursor now
- if (_vm is not null) _vm.StatusText = on ? "Following the playhead" : "Follow playhead off";
- }
+ => SetFollowPlayhead(!Timeline.FollowPlayhead);
// Cycles how much of the arrangement prints clip names: every clip → the head of each run
// (the default, so a repeated pattern reads as one block) → none.
diff --git a/src/managed/Nota.App/MainWindow.axaml b/src/managed/Nota.App/MainWindow.axaml
index bc7f6d28..2ede3b92 100644
--- a/src/managed/Nota.App/MainWindow.axaml
+++ b/src/managed/Nota.App/MainWindow.axaml
@@ -62,6 +62,8 @@
<NativeMenuItem Header="Toggle overview" Click="OnMenuToggleOverview"/>
<NativeMenuItem Header="Toggle sections" Click="OnMenuToggleSections"/>
<NativeMenuItemSeparator/>
+ <!-- Header text is matched from code to keep this checkmark in step with the
+ transport bar's Follow button — see MainWindow.SetFollowPlayhead. -->
<NativeMenuItem Header="Follow playhead" Click="OnMenuToggleFollow" ToggleType="CheckBox"/>
<NativeMenuItemSeparator/>
<NativeMenuItem Header="Clip names" Click="OnMenuCycleClipNames"/>
@@ -114,9 +116,8 @@
handing 22px back to the arrangement. Reads left to right as: which view ·
what plays (a recessed console fusing transport, position and loop) · the
numbers you set · the switches you flip · then, pinned right, what the machine
- is doing. Everything the two old rows carried is still here; Follow playhead
- moved to View ▸ Follow playhead and launch quantize shows only in Session,
- where it applies. -->
+ is doing. Everything the two old rows carried is still here; launch quantize
+ shows only in Session, where it applies. -->
<Border DockPanel.Dock="Top" Classes="Panel" Height="60" Padding="14,0">
<Grid ColumnDefinitions="Auto,Auto,Auto,Auto,*,Auto,Auto,Auto,Auto,Auto">
@@ -219,6 +220,23 @@
</Canvas>
</Viewbox>
</ToggleButton>
+ <!-- Follow playhead: keep the arrangement scrolling with the cursor. The
+ playhead marker standing on its ruler. A flag (block + point) rather than a
+ bare triangle: at 15px a flat triangle over a stem reads as "⊥". Viewport
+ brackets around it were tried too and collapse into noise at this size. Mirrored by View ▸ Follow playhead,
+ which shares one code path. -->
+ <ToggleButton x:Name="FollowBtn" Classes="tp-icon" Click="OnToggleFollow"
+ ToolTip.Tip="Follow playhead — scroll the arrangement to keep the cursor in view">
+ <Viewbox Width="15" Height="15">
+ <Canvas Width="24" Height="24">
+ <Path Stroke="{Binding $parent[ToggleButton].Foreground}" StrokeThickness="1.7"
+ StrokeLineCap="Round" Data="M3.5 17.8 H20.5"/>
+ <Path Fill="{Binding $parent[ToggleButton].Foreground}" Data="M6.5 5 H12.5 V9 L9.5 12.5 L6.5 9 Z"/>
+ <Path Stroke="{Binding $parent[ToggleButton].Foreground}" StrokeThickness="1.7"
+ StrokeLineCap="Round" Data="M9.5 12.5 V17.8"/>
+ </Canvas>
+ </Viewbox>
+ </ToggleButton>
<!-- Snapping on/off, independent of which grid the GRID cell shows. Off is the
same as holding Alt, but latched. A horseshoe magnet: the poles are banded
off the body by a transparent gap, so the shape reads on any button state. -->
diff --git a/src/managed/Nota.App/MainWindow.axaml.cs b/src/managed/Nota.App/MainWindow.axaml.cs
index 67144561..38e2ea53 100644
--- a/src/managed/Nota.App/MainWindow.axaml.cs
+++ b/src/managed/Nota.App/MainWindow.axaml.cs
@@ -514,6 +514,36 @@ public partial class MainWindow : Window
e.Handled = true;
}
+ // Follow: keep the arrangement scrolling with the playhead during playback. The bar
+ // button and View ▸ Follow playhead are two faces of one state, so both land here.
+ private void OnToggleFollow(object? sender, RoutedEventArgs e) => SetFollowPlayhead(FollowBtn.IsChecked == true);
+
+ internal void SetFollowPlayhead(bool on)
+ {
+ Timeline.FollowPlayhead = on;
+ if (FollowBtn.IsChecked != on) FollowBtn.IsChecked = on;
+ // The View-menu twin lives in the native menu, which has no generated field —
+ // look it up once by the header declared in MainWindow.axaml.
+ _followMenuItem ??= FindMenuItem(NativeMenu.GetMenu(this), "Follow playhead");
+ if (_followMenuItem is not null) _followMenuItem.IsChecked = on;
+ if (on) Timeline.RecenterOnPlayhead(); // jump to the cursor now
+ if (_vm is not null) _vm.StatusText = on ? "Following the playhead" : "Follow playhead off";
+ }
+
+ private NativeMenuItem? _followMenuItem;
+
+ private static NativeMenuItem? FindMenuItem(NativeMenu? menu, string header)
+ {
+ if (menu is null) return null;
+ foreach (var item in menu.Items)
+ {
+ if (item is not NativeMenuItem mi) continue;
+ if (mi.Header == header) return mi;
+ if (FindMenuItem(mi.Menu, header) is { } found) return found;
+ }
+ return null;
+ }
+
// Snap on/off. Separate from the GRID cell, which only picks the denomination:
// the latch is what you reach for to nudge something off-grid for a while.
private void OnToggleSnapEnabled(object? sender, RoutedEventArgs e)