From 6737bb3d381996533d712d5cf0258f05b799894f Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 8 Sep 2022 09:00:32 -1000 Subject: [PATCH] imp: ui: mouse-clicking below the list no longer navigates back I and mail list think it's too obtrusive, eg sometimes it navigates when you just want to focus the window. --- hledger-ui/Hledger/UI/AccountsScreen.hs | 3 --- hledger-ui/Hledger/UI/BalancesheetScreen.hs | 3 --- hledger-ui/Hledger/UI/RegisterScreen.hs | 3 --- hledger-ui/Hledger/UI/TransactionScreen.hs | 3 --- 4 files changed, 12 deletions(-) diff --git a/hledger-ui/Hledger/UI/AccountsScreen.hs b/hledger-ui/Hledger/UI/AccountsScreen.hs index 8ce49669b..2acbf09e1 100644 --- a/hledger-ui/Hledger/UI/AccountsScreen.hs +++ b/hledger-ui/Hledger/UI/AccountsScreen.hs @@ -267,9 +267,6 @@ asHandle ev = do VtyEvent e | e `elem` moveLeftEvents -> put' $ popScreen ui -- or on a click in the app's left margin. This is a VtyEvent since not in a clickable widget. VtyEvent (EvMouseUp x _y (Just BLeft)) | x==0 -> put' $ popScreen ui - -- or on clicking a blank list item. - MouseUp _ (Just BLeft) Location{loc=(_,y)} | clickedacct == "" -> put' $ popScreen ui - where clickedacct = maybe "" asItemAccountName $ listElements (_assList sst) !? y -- RIGHT enters register screen for selected account (if there is one), -- centering its selected transaction if possible diff --git a/hledger-ui/Hledger/UI/BalancesheetScreen.hs b/hledger-ui/Hledger/UI/BalancesheetScreen.hs index 328472522..e21b90b1c 100644 --- a/hledger-ui/Hledger/UI/BalancesheetScreen.hs +++ b/hledger-ui/Hledger/UI/BalancesheetScreen.hs @@ -267,9 +267,6 @@ bsHandle ev = do VtyEvent e | e `elem` moveLeftEvents -> put' $ popScreen ui -- or on a click in the app's left margin. This is a VtyEvent since not in a clickable widget. VtyEvent (EvMouseUp x _y (Just BLeft)) | x==0 -> put' $ popScreen ui - -- or on clicking a blank list item. - MouseUp _ (Just BLeft) Location{loc=(_,y)} | clickedacct == "" -> put' $ popScreen ui - where clickedacct = maybe "" asItemAccountName $ listElements (_bssList sst) !? y -- enter register screen for selected account (if there is one), -- centering its selected transaction if possible diff --git a/hledger-ui/Hledger/UI/RegisterScreen.hs b/hledger-ui/Hledger/UI/RegisterScreen.hs index 0adbf4b5a..cda9137d1 100644 --- a/hledger-ui/Hledger/UI/RegisterScreen.hs +++ b/hledger-ui/Hledger/UI/RegisterScreen.hs @@ -276,9 +276,6 @@ rsHandle ev = do VtyEvent e | e `elem` moveLeftEvents -> put' $ popScreen ui -- or on a click in the app's left margin. This is a VtyEvent since not in a clickable widget. VtyEvent (EvMouseUp x _y (Just BLeft)) | x==0 -> put' $ popScreen ui - -- or on clicking a blank list item. - MouseUp _ (Just BLeft) Location{loc=(_,y)} | clickeddate == "" -> put' $ popScreen ui - where clickeddate = maybe "" rsItemDate $ listElements _rssList !? y -- enter transaction screen on RIGHT VtyEvent e | e `elem` moveRightEvents -> diff --git a/hledger-ui/Hledger/UI/TransactionScreen.hs b/hledger-ui/Hledger/UI/TransactionScreen.hs index b732876eb..424192410 100644 --- a/hledger-ui/Hledger/UI/TransactionScreen.hs +++ b/hledger-ui/Hledger/UI/TransactionScreen.hs @@ -170,9 +170,6 @@ tsHandle ev = do VtyEvent e | e `elem` moveLeftEvents -> put' . popScreen $ tsSelect i t ui -- Probably not necessary to tsSelect here, but it's safe. -- or on a click in the app's left margin. VtyEvent (EvMouseUp x _y (Just BLeft)) | x==0 -> put' . popScreen $ tsSelect i t ui - -- or on clicking the blank area below the transaction. - MouseUp _ (Just BLeft) Location{loc=(_,y)} | y+1 > numentrylines -> put' . popScreen $ tsSelect i t ui - where numentrylines = length (T.lines $ showTxn ropts rspec j t) - 1 VtyEvent (EvKey (KChar 'l') [MCtrl]) -> redraw VtyEvent (EvKey (KChar 'z') [MCtrl]) -> suspend ui