mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-04 01:28:45 -04:00
fix(gioui): arrow keys leave table row/col titles
This commit is contained in:
parent
b18a284252
commit
f0f391356c
@ -24,8 +24,6 @@ type ScrollTable struct {
|
|||||||
Table tracker.Table
|
Table tracker.Table
|
||||||
focused bool
|
focused bool
|
||||||
requestFocus bool
|
requestFocus bool
|
||||||
colTag bool
|
|
||||||
rowTag bool
|
|
||||||
cursorMoved bool
|
cursorMoved bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,13 +158,7 @@ func (s *ScrollTableStyle) handleEvents(gtx layout.Context) {
|
|||||||
|
|
||||||
for {
|
for {
|
||||||
e, ok := gtx.Event(
|
e, ok := gtx.Event(
|
||||||
key.FocusFilter{
|
key.Filter{Focus: s.ScrollTable.RowTitleList, Name: "→"},
|
||||||
Target: &s.ScrollTable.rowTag,
|
|
||||||
},
|
|
||||||
key.Filter{
|
|
||||||
Focus: &s.ScrollTable.rowTag,
|
|
||||||
Name: "→",
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
if !ok {
|
if !ok {
|
||||||
break
|
break
|
||||||
@ -178,13 +170,7 @@ func (s *ScrollTableStyle) handleEvents(gtx layout.Context) {
|
|||||||
|
|
||||||
for {
|
for {
|
||||||
e, ok := gtx.Event(
|
e, ok := gtx.Event(
|
||||||
key.FocusFilter{
|
key.Filter{Focus: s.ScrollTable.ColTitleList, Name: "↓"},
|
||||||
Target: &s.ScrollTable.colTag,
|
|
||||||
},
|
|
||||||
key.Filter{
|
|
||||||
Focus: &s.ScrollTable.colTag,
|
|
||||||
Name: "↓",
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
if !ok {
|
if !ok {
|
||||||
break
|
break
|
||||||
@ -225,8 +211,6 @@ func (s *ScrollTableStyle) layoutRowTitles(gtx C, p image.Point) {
|
|||||||
gtx.Constraints.Min.X = p.X
|
gtx.Constraints.Min.X = p.X
|
||||||
gtx.Constraints.Max.Y -= p.Y
|
gtx.Constraints.Max.Y -= p.Y
|
||||||
gtx.Constraints.Min.Y = gtx.Constraints.Max.Y
|
gtx.Constraints.Min.Y = gtx.Constraints.Max.Y
|
||||||
defer clip.Rect(image.Rectangle{Max: gtx.Constraints.Max}).Push(gtx.Ops).Pop()
|
|
||||||
event.Op(gtx.Ops, &s.ScrollTable.rowTag)
|
|
||||||
s.RowTitleStyle.Layout(gtx)
|
s.RowTitleStyle.Layout(gtx)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,8 +219,6 @@ func (s *ScrollTableStyle) layoutColTitles(gtx C, p image.Point) {
|
|||||||
gtx.Constraints.Min.Y = p.Y
|
gtx.Constraints.Min.Y = p.Y
|
||||||
gtx.Constraints.Max.X -= p.X
|
gtx.Constraints.Max.X -= p.X
|
||||||
gtx.Constraints.Min.X = gtx.Constraints.Max.X
|
gtx.Constraints.Min.X = gtx.Constraints.Max.X
|
||||||
defer clip.Rect(image.Rectangle{Max: gtx.Constraints.Max}).Push(gtx.Ops).Pop()
|
|
||||||
event.Op(gtx.Ops, &s.ScrollTable.colTag)
|
|
||||||
s.ColTitleStyle.Layout(gtx)
|
s.ColTitleStyle.Layout(gtx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user