mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 20:21:51 -07:00
Exported shrinkWhile from Decoration to use in GridSelect
This commit is contained in:
@@ -96,17 +96,6 @@ tupadd (a,b) (c,d) = (a+c,b+d)
|
|||||||
tupmul :: (Num t1, Num t) => (t, t1) -> (t, t1) -> (t, t1)
|
tupmul :: (Num t1, Num t) => (t, t1) -> (t, t1) -> (t, t1)
|
||||||
tupmul (a,b) (c,d) = (a*c,b*d)
|
tupmul (a,b) (c,d) = (a*c,b*d)
|
||||||
|
|
||||||
-- shrinkWhile should be exported from Decoration.hs
|
|
||||||
shrinkWhile :: Monad m => (String -> [String]) -> (String -> m Bool) -> String -> m String
|
|
||||||
shrinkWhile sh p x = sw $ sh x
|
|
||||||
where sw [n] = return n
|
|
||||||
sw [] = return ""
|
|
||||||
sw (n:ns) = do
|
|
||||||
cond <- p n
|
|
||||||
if cond
|
|
||||||
then sw ns
|
|
||||||
else return n
|
|
||||||
|
|
||||||
drawWinBox :: Display -> Window -> XMonadFont -> (String, String) -> Integer -> Integer -> String -> Integer -> Integer -> Integer -> X ()
|
drawWinBox :: Display -> Window -> XMonadFont -> (String, String) -> Integer -> Integer -> String -> Integer -> Integer -> Integer -> X ()
|
||||||
drawWinBox dpy win font (fg,bg) ch cw text x y cp = do
|
drawWinBox dpy win font (fg,bg) ch cw text x y cp = do
|
||||||
gc <- liftIO $ createGC dpy win
|
gc <- liftIO $ createGC dpy win
|
||||||
|
@@ -24,7 +24,7 @@ module XMonad.Layout.Decoration
|
|||||||
, DecorationStyle (..)
|
, DecorationStyle (..)
|
||||||
, DefaultDecoration (..)
|
, DefaultDecoration (..)
|
||||||
, Shrinker (..), DefaultShrinker
|
, Shrinker (..), DefaultShrinker
|
||||||
, shrinkText, CustomShrink ( CustomShrink )
|
, shrinkText, CustomShrink ( CustomShrink ), shrinkWhile
|
||||||
, isInStack, isVisible, isInvisible, isWithin, fi
|
, isInStack, isVisible, isInvisible, isWithin, fi
|
||||||
, module XMonad.Layout.LayoutModifier
|
, module XMonad.Layout.LayoutModifier
|
||||||
) where
|
) where
|
||||||
|
Reference in New Issue
Block a user