mirror of
https://github.com/anotherhadi/usbguard-tui.git
synced 2026-05-11 22:02:34 +02:00
Edit mouse actions
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
+14
-3
@@ -146,10 +146,21 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
|
||||
case tea.MouseWheelMsg:
|
||||
if m.state == statePopup {
|
||||
var cmd tea.Cmd
|
||||
m.actionList, cmd = m.actionList.Update(msg)
|
||||
return m, cmd
|
||||
switch msg.Button {
|
||||
case tea.MouseWheelUp:
|
||||
m.actionList.CursorUp()
|
||||
case tea.MouseWheelDown:
|
||||
m.actionList.CursorDown()
|
||||
}
|
||||
} else {
|
||||
switch msg.Button {
|
||||
case tea.MouseWheelUp:
|
||||
m.list.CursorUp()
|
||||
case tea.MouseWheelDown:
|
||||
m.list.CursorDown()
|
||||
}
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
if m.state == stateList {
|
||||
|
||||
Reference in New Issue
Block a user