manatee-core 0.0.1 → 0.0.2
raw patch · 7 files changed
+21/−14 lines, 7 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Manatee.Toolkit.General.Basic: integralToDouble :: (Integral a) => a -> Double
+ Manatee.Toolkit.General.Basic: i2d :: (Integral a) => a -> Double
+ Manatee.Toolkit.Widget.Interactivebar: interactivebarInit :: Interactivebar -> VBox -> String -> String -> IO ()
Files
- Manatee/Toolkit/General/Basic.hs +2/−2
- Manatee/Toolkit/General/Misc.hs +1/−1
- Manatee/Toolkit/Gtk/Gtk.hs +1/−1
- Manatee/Toolkit/Gtk/ModelView.hs +4/−4
- Manatee/Toolkit/Gtk/Multiline.hs +5/−5
- Manatee/Toolkit/Widget/Interactivebar.hs +7/−0
- manatee-core.cabal +1/−1
Manatee/Toolkit/General/Basic.hs view
@@ -36,8 +36,8 @@ dup a = (a,a) -- | Transform Int to Double-integralToDouble :: Integral a => a -> Double-integralToDouble v = +i2d :: Integral a => a -> Double+i2d v = fromIntegral v :: Double -- | Integer to Int.
Manatee/Toolkit/General/Misc.hs view
@@ -47,7 +47,7 @@ | size < 2 ^ 90 = humanSize (2 ^ 80) ++ " YB" | size < 2 ^ 100 = humanSize (2 ^ 90) ++ " NB" | size < 2 ^ 110 = humanSize (2 ^ 100) ++ " DB"- where humanSize base = printf "%.1f" (integralToDouble size / base) :: String+ where humanSize base = printf "%.1f" (i2d size / base) :: String -- | Format float with specify precision. formatFloatN :: Double -> Int -> Double
Manatee/Toolkit/Gtk/Gtk.hs view
@@ -158,4 +158,4 @@ -- | Convert Color to RGB value. colorToRGB :: Color -> (Double, Double, Double) colorToRGB (Color r g b) = - (integralToDouble r / 65535, integralToDouble g / 65535, integralToDouble b / 65535)+ (i2d r / 65535, i2d g / 65535, i2d b / 65535)
Manatee/Toolkit/Gtk/ModelView.hs view
@@ -226,12 +226,12 @@ cellY <- do cy <- treeViewGetSelectedCellY view -- Transform to tree coordinate for compare with adjustment value.- (integralToDouble . snd) <$> treeViewConvertBinWindowToTreeCoords view (0, cy)+ (i2d . snd) <$> treeViewConvertBinWindowToTreeCoords view (0, cy) ch <- treeViewGetSelectedCellHeight view- let cellH = integralToDouble ch+ let cellH = i2d ch -- Update adjustment value.- let inc = integralToDouble $ floorToMultiple (truncate increment) ch+ let inc = i2d $ floorToMultiple (truncate increment) ch iv = vl + inc top = if inc >= 0 then min iv $ ur - cellH -- don't bigger than upper value when scroll up@@ -243,7 +243,7 @@ | bottom <= cellY + cellH = Just bottomY | otherwise = Nothing where topY = top + 1- bottomY = integralToDouble $ floorToMultiple (truncate bottom) ch - 1+ bottomY = i2d $ floorToMultiple (truncate bottom) ch - 1 -- Selected new cell when got new y coordinate. adjustY ?>= \ y -> do
Manatee/Toolkit/Gtk/Multiline.hs view
@@ -392,7 +392,7 @@ -- Scroll view to mark of iter. aj <- scrolledWindowGetVAdjustment sw vl <- adjustmentGetValue aj- y <- (<<<=) (integralToDouble . fst) (textViewGetLineYrange tv) + y <- (<<<=) (i2d . fst) (textViewGetLineYrange tv) =<< textViewGetTextIter tv if y <= vl -- When mark below or equal current top y coordinate.@@ -799,7 +799,7 @@ let iv = vl + inc av = if inc >= 0 -- Don't bigger than upper value when scroll up.- then min iv (ur - integralToDouble lnH)+ then min iv (ur - i2d lnH) -- Don't less than lower value when scroll down. else max iv lr adjustmentSetValue aj av@@ -807,7 +807,7 @@ -- Adjust iter position. top <- adjustmentGetValue aj let bottom = top + ps- if top >= integralToDouble y+ if top >= i2d y -- Adjust iter to first line in view visual port -- when iter is up out view visual port. then do@@ -815,9 +815,9 @@ textBufferPlaceCursor tb nti -- Adjust iter to last line in view visual port -- when iter is down out view virtual port.- else when (bottom <= integralToDouble (y + lnH)) $+ else when (bottom <= i2d (y + lnH)) $ do- (nti, _) <- textViewGetLineAtY tv (truncate (bottom - integralToDouble lnH))+ (nti, _) <- textViewGetLineAtY tv (truncate (bottom - i2d lnH)) textBufferPlaceCursor tb nti -- | Toggle selection.
Manatee/Toolkit/Widget/Interactivebar.hs view
@@ -68,6 +68,13 @@ return newBar +-- | Init.+interactivebarInit :: Interactivebar -> VBox -> String -> String -> IO ()+interactivebarInit interactivebar box title content = do+ interactivebarSetTitle interactivebar title+ interactivebarSetContent interactivebar content+ interactivebarShow box interactivebar+ -- | Set title. interactivebarSetTitle :: Interactivebar -> String -> IO () interactivebarSetTitle bar =
manatee-core.cabal view
@@ -1,5 +1,5 @@ name: manatee-core-version: 0.0.1+version: 0.0.2 Cabal-Version: >= 1.6 license: GPL-3 license-file: LICENSE