LayoutCombinator class: code clean up

- ComboType becomes CombboChooser
- removed the stupid doFirst
- better comboDescription default implemenation
This commit is contained in:
Andrea Rossato
2008-01-29 22:49:52 +00:00
parent 055a6b1232
commit 2797c0d71b
2 changed files with 12 additions and 15 deletions

View File

@@ -62,7 +62,7 @@ onWorkspace :: WorkspaceId -- ^ tags of workspaces to match
-> (l1 a) -- ^ layout to use on matched workspaces
-> (l2 a) -- ^ layout to use everywhere else
-> CombinedLayout PerWorkspace l1 l2 a
onWorkspace wsId l1 l2 = CombinedLayout (PerWorkspace [wsId]) l1 l2
onWorkspace wsId = CombinedLayout (PerWorkspace [wsId])
-- | Specify one layout to use on a particular set of workspaces, and
-- another to use on all other workspaces.
@@ -70,7 +70,7 @@ onWorkspaces :: [WorkspaceId] -- ^ tags of workspaces to match
-> (l1 a) -- ^ layout to use on matched workspaces
-> (l2 a) -- ^ layout to use everywhere else
-> CombinedLayout PerWorkspace l1 l2 a
onWorkspaces wsIds l1 l2 = CombinedLayout (PerWorkspace wsIds) l1 l2
onWorkspaces wsIds = CombinedLayout (PerWorkspace wsIds)
-- | Structure for representing a workspace-specific layout along with
-- a layout for all other workspaces. We store the tags of workspaces
@@ -86,7 +86,6 @@ instance LayoutCombinator PerWorkspace a where
chooser (PerWorkspace wsIds) = do
t <- getCurrentTag
return $ if t `elem` wsIds then DoFirst else DoSecond
doFirst (PerWorkspace _) = True
-- | Get the tag of the currently active workspace. Note that this
-- is only guaranteed to be the same workspace for which doLayout