From fe2fe5376009087761112d3d491c575cd3993cd6 Mon Sep 17 00:00:00 2001 From: pasqu4le Date: Fri, 27 Apr 2018 13:19:07 +0200 Subject: [PATCH] renamed MenuTypes (forgot in the previous commit) --- src/Widgets/Manager.hs | 8 ++++---- src/Widgets/Menu.hs | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Widgets/Manager.hs b/src/Widgets/Manager.hs index f9a0463..14a41c6 100644 --- a/src/Widgets/Manager.hs +++ b/src/Widgets/Manager.hs @@ -67,10 +67,10 @@ handlePrompt ev pr state = do handleMain :: BrickEvent Name (ThreadEvent Tab.Tab) -> State -> EventM Name (Next State) handleMain (VtyEvent ev) = case ev of EvKey KEsc [] -> halt - EvKey KBS [] -> updateMenu Menu.MainMenu - EvKey (KChar 'l') [] -> updateMenu Menu.SelectionMenu - EvKey (KChar 'a') [] -> updateMenu Menu.TabMenu - EvKey (KChar 'p') [] -> updateMenu Menu.PaneMenu + EvKey KBS [] -> updateMenu Menu.Main + EvKey (KChar 'l') [] -> updateMenu Menu.Selection + EvKey (KChar 'a') [] -> updateMenu Menu.Tab + EvKey (KChar 'p') [] -> updateMenu Menu.Pane EvKey (KChar 'q') [] -> halt EvKey (KChar 'x') [MCtrl] -> updateClipboard Menu.makeCutBoard EvKey (KChar 'c') [MCtrl] -> updateClipboard Menu.makeCopyBoard diff --git a/src/Widgets/Menu.hs b/src/Widgets/Menu.hs index 0bed186..a83dba6 100644 --- a/src/Widgets/Menu.hs +++ b/src/Widgets/Menu.hs @@ -12,7 +12,7 @@ import Brick.Widgets.Border (borderWithLabel, border) import Graphics.Vty (Event(EvKey), Key(..), Modifier(MCtrl)) data Menu = Menu {clipboard :: Clipboard, menuType :: MenuType} -data MenuType = MainMenu | SelectionMenu | TabMenu | PaneMenu +data MenuType = Main | Selection | Tab | Pane data Clipboard = CopyBoard {fromEntry :: Entry.Entry} | CutBoard {fromEntry :: Entry.Entry} | EmptyBoard instance Show Clipboard where @@ -21,7 +21,7 @@ instance Show Clipboard where -- creation functions make :: Menu -make = Menu {clipboard = EmptyBoard, menuType = MainMenu} +make = Menu {clipboard = EmptyBoard, menuType = Main} makeCopyBoard :: Entry.Entry -> Clipboard makeCopyBoard = CopyBoard @@ -35,10 +35,10 @@ render m = hBox . (renderClipboard (clipboard m) :) . renderButtons (menuType m) renderButtons :: MenuType -> Pane.Pane -> [Widget Name] renderButtons tp pane = map renderButton $ case tp of - MainMenu -> mainButtons - SelectionMenu -> (backButton :) . selectionButtons $ Pane.selectedEntry pane - TabMenu -> (backButton :) . tabButtons $ Pane.currentTab pane - PaneMenu -> backButton : paneButtons + Main -> mainButtons + Selection -> (backButton :) . selectionButtons $ Pane.selectedEntry pane + Tab -> (backButton :) . tabButtons $ Pane.currentTab pane + Pane -> backButton : paneButtons renderButton :: (Widget Name, Maybe String, Name) -> Widget Name renderButton (bContent, bLabel, bName) = clickable bName $ case bLabel of