From 6769de07f7e06ddf6eea728bd7072ebfe6eff017 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 28 May 2013 03:39:09 +0200 Subject: use Data.Default wherever possible, and deprecate the things it replaces Ignore-this: 898458b1d2868a70dfb09faf473dc7aa darcs-hash:20130528013909-76d51-863278165b6f149c47b08b31b34e85ddcab19f1f.gz --- XMonad/Layout/ShowWName.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'XMonad/Layout/ShowWName.hs') diff --git a/XMonad/Layout/ShowWName.hs b/XMonad/Layout/ShowWName.hs index 827dc59..39572e3 100644 --- a/XMonad/Layout/ShowWName.hs +++ b/XMonad/Layout/ShowWName.hs @@ -17,6 +17,7 @@ module XMonad.Layout.ShowWName -- $usage showWName , showWName' + , def , defaultSWNConfig , SWNConfig(..) , ShowWName @@ -43,7 +44,7 @@ import XMonad.Util.XUtils -- | A layout modifier to show the workspace name when switching showWName :: l a -> ModifiedLayout ShowWName l a -showWName = ModifiedLayout (SWN True defaultSWNConfig Nothing) +showWName = ModifiedLayout (SWN True def Nothing) -- | A layout modifier to show the workspace name when switching. It -- is possible to provide a custom configuration. @@ -60,14 +61,18 @@ data SWNConfig = , swn_fade :: Rational -- ^ Time in seconds of the name visibility } deriving (Read, Show) -defaultSWNConfig :: SWNConfig -defaultSWNConfig = +instance Default SWNConfig where + def = SWNC { swn_font = "-misc-fixed-*-*-*-*-20-*-*-*-*-*-*-*" , swn_bgcolor = "black" , swn_color = "white" , swn_fade = 1 } +{-# DEPRECATED defaultSWNConfig "Use def (from Data.Default, and re-exported from XMonad.Layout.ShowWName) instead." #-} +defaultSWNConfig :: SWNConfig +defaultSWNConfig = def + instance LayoutModifier ShowWName a where redoLayout sn r _ wrs = doShow sn r wrs -- cgit v1.2.3