feat(gioui): + and - keys add/subtract elements in tables

Closes #65.
This commit is contained in:
5684185+vsariola@users.noreply.github.com 2024-03-01 22:43:27 +02:00
parent 1c020fffa3
commit b18a284252
2 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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())