From 7608d838aa34d96d4d8a97253b5ec6b1af75f3f6 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Wed, 20 Apr 2016 17:20:04 +0200 Subject: [PATCH] GTK: improve history navigation * increase maximum numbers of items in the history * empty the "forward" history if we enter a directory via normal navigation --- src/HSFM/GUI/Gtk/Callbacks.hs | 2 +- src/HSFM/GUI/Gtk/Utils.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HSFM/GUI/Gtk/Callbacks.hs b/src/HSFM/GUI/Gtk/Callbacks.hs index 749c5ff..7b62fc9 100644 --- a/src/HSFM/GUI/Gtk/Callbacks.hs +++ b/src/HSFM/GUI/Gtk/Callbacks.hs @@ -464,7 +464,7 @@ goDir :: MyGUI -> MyView -> Item -> IO () goDir mygui myview item = do cdir <- getCurrentDir myview modifyTVarIO (history myview) - (\(p, n) -> (path cdir `addHistory` p, n)) + (\(p, _) -> (path cdir `addHistory` p, [])) refreshView' mygui myview item diff --git a/src/HSFM/GUI/Gtk/Utils.hs b/src/HSFM/GUI/Gtk/Utils.hs index a18a845..b976da1 100644 --- a/src/HSFM/GUI/Gtk/Utils.hs +++ b/src/HSFM/GUI/Gtk/Utils.hs @@ -157,5 +157,5 @@ addHistory i xs | length xs == maxLength = i : take (maxLength - 1) xs | otherwise = i : xs where - maxLength = 5 + maxLength = 10