From b18a2842528df5e7e83f2a1a3c4481fc200cbe56 Mon Sep 17 00:00:00 2001 From: "5684185+vsariola@users.noreply.github.com" <5684185+vsariola@users.noreply.github.com> Date: Fri, 1 Mar 2024 22:43:27 +0200 Subject: [PATCH] feat(gioui): + and - keys add/subtract elements in tables Closes #65. --- CHANGELOG.md | 3 +++ tracker/gioui/scroll_table.go | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0df68ec..72ccddd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Massive rewrite of the GUI, in particular allowing better copying, pasting and scrolling of table-based data (order list and note data). - Dbgain unit, which allows defining the gain in decibels (-40 dB to +40dB) +- `+` and `-` keys add/subtract values in order editor and pattern editor + ([#65][i65]) ### Fixed - 32-bit su_load_gmdls clobbered ebx, even though __stdcall demands it to be not @@ -140,6 +142,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). [0.3.0]: https://github.com/vsariola/sointu/compare/v0.2.0...v0.3.0 [0.2.0]: https://github.com/vsariola/sointu/compare/v0.1.0...v0.2.0 [0.1.0]: https://github.com/vsariola/sointu/compare/4klang-3.11...v0.1.0 +[i65]: https://github.com/vsariola/sointu/issues/65 [i112]: https://github.com/vsariola/sointu/issues/112 [i116]: https://github.com/vsariola/sointu/issues/116 [i120]: https://github.com/vsariola/sointu/issues/120 diff --git a/tracker/gioui/scroll_table.go b/tracker/gioui/scroll_table.go index 8187cf9..3410c62 100644 --- a/tracker/gioui/scroll_table.go +++ b/tracker/gioui/scroll_table.go @@ -123,8 +123,8 @@ func (s *ScrollTableStyle) handleEvents(gtx layout.Context) { key.Filter{Focus: s.ScrollTable, Name: "C", Required: key.ModShortcut}, key.Filter{Focus: s.ScrollTable, Name: "V", Required: key.ModShortcut}, key.Filter{Focus: s.ScrollTable, Name: "X", Required: key.ModShortcut}, - key.Filter{Focus: s.ScrollTable, Name: ",", Required: key.ModShift}, - key.Filter{Focus: s.ScrollTable, Name: ".", Required: key.ModShift}, + key.Filter{Focus: s.ScrollTable, Name: "+"}, + key.Filter{Focus: s.ScrollTable, Name: "-"}, ) if !ok { break @@ -291,10 +291,12 @@ func (s *ScrollTable) command(gtx C, e key.Event) { s.Table.SetCursorX(0) case key.NameEnd: s.Table.SetCursorX(s.Table.Width() - 1) - case ".": + case "+": s.Table.Add(1) - case ",": + return + case "-": s.Table.Add(-1) + return } if !e.Modifiers.Contain(key.ModShift) { s.Table.SetCursor2(s.Table.Cursor())