summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreyevanmalicesun <>2019-01-11 03:40:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-01-11 03:40:00 (GMT)
commitcc10a4030e86a3c3cccdaea2ec448d705e5216c5 (patch)
tree4bf3f47cdf4dd09f355d75395be4e56c24401d40
parent27365e8f5f4ff24ef1febb1a33a38da6a44faa24 (diff)
version 0.1.6.0HEAD0.1.6.0master
-rwxr-xr-x[-rw-r--r--]ChangeLog.md0
-rwxr-xr-x[-rw-r--r--]README.md0
-rw-r--r--gtk-sni-tray.cabal16
-rw-r--r--src/StatusNotifier/TransparentWindow.hs17
-rw-r--r--src/StatusNotifier/Tray.hs9
5 files changed, 19 insertions, 23 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
index c209179..c209179 100644..100755
--- a/ChangeLog.md
+++ b/ChangeLog.md
diff --git a/README.md b/README.md
index 96b4f4e..96b4f4e 100644..100755
--- a/README.md
+++ b/README.md
diff --git a/gtk-sni-tray.cabal b/gtk-sni-tray.cabal
index 9e65e1a..ab4002e 100644
--- a/gtk-sni-tray.cabal
+++ b/gtk-sni-tray.cabal
@@ -1,11 +1,13 @@
--- This file has been generated from package.yaml by hpack version 0.28.2.
+cabal-version: 1.12
+
+-- This file has been generated from package.yaml by hpack version 0.31.1.
--
-- see: https://github.com/sol/hpack
--
--- hash: 067fc5601dbe657896605cceec402ebd1bd4bc70ddaf12463634b8149c9487a7
+-- hash: 9ae75bcf04140e891f7319a5d4f55a83c2a0aa11aee489abb939acfb3853eb0d
name: gtk-sni-tray
-version: 0.1.5.0
+version: 0.1.6.0
synopsis: A standalone StatusNotifierItem/AppIndicator tray
description: Please see the README on Github at <https://github.com/IvanMalison/gtk-sni-tray#readme>
category: System
@@ -17,10 +19,9 @@ copyright: 2018 Ivan Malison
license: BSD3
license-file: LICENSE
build-type: Simple
-cabal-version: >= 1.10
extra-source-files:
- ChangeLog.md
README.md
+ ChangeLog.md
source-repository head
type: git
@@ -37,13 +38,14 @@ library
build-depends:
base >=4.7 && <5
, bytestring
- , cairo
, containers
, dbus >=1.0.0 && <2.0.0
, directory
, enclosed-exceptions >=1.0.0.1
, filepath
, gi-cairo
+ , gi-cairo-connector
+ , gi-cairo-render
, gi-dbusmenugtk3
, gi-gdk
, gi-gdkpixbuf >=2.0.16
@@ -53,7 +55,7 @@ library
, haskell-gi >=0.21.2
, haskell-gi-base >=0.21.1
, hslogger
- , status-notifier-item >=0.3.0.0 && <0.4.0.0
+ , status-notifier-item >=0.3.0.1 && <0.4.0.0
, text
, transformers
, transformers-base >=0.4
diff --git a/src/StatusNotifier/TransparentWindow.hs b/src/StatusNotifier/TransparentWindow.hs
index a4ff4a5..89b8623 100644
--- a/src/StatusNotifier/TransparentWindow.hs
+++ b/src/StatusNotifier/TransparentWindow.hs
@@ -20,20 +20,11 @@ import Control.Monad.IO.Class
import Control.Monad.Trans.Reader
import Data.GI.Base
import Foreign.Ptr (castPtr)
-import qualified GI.Cairo
+import GI.Cairo hiding (OperatorOver, OperatorSource)
+import GI.Cairo.Render
+import GI.Cairo.Render.Connector
import qualified GI.Gdk as Gdk
import qualified GI.Gtk as Gtk
-import Graphics.Rendering.Cairo
-import Graphics.Rendering.Cairo.Internal (Render(runRender))
-import Graphics.Rendering.Cairo.Types (Cairo(Cairo))
-
--- | This function bridges gi-cairo with the hand-written cairo package. It
--- takes a `GI.Cairo.Context` (as it appears in gi-cairo), and a `Render` action
--- (as in the cairo lib), and renders the `Render` action into the given
--- context.
-renderWithContext :: GI.Cairo.Context -> Render () -> IO ()
-renderWithContext ct r =
- withManagedPtr ct $ \p -> runReaderT (runRender r) (Cairo (castPtr p))
makeWindowTransparent :: MonadIO m => Gtk.Window -> m ()
makeWindowTransparent window = do
@@ -52,7 +43,7 @@ transparentDraw context = do
Gdk.setRGBARed rGBA 1.0
Gdk.setRGBAGreen rGBA 1.0
Gdk.cairoSetSourceRgba context rGBA
- renderWithContext context $ do
+ flip renderWithContext context $ do
setOperator OperatorSource
paint
setOperator OperatorOver
diff --git a/src/StatusNotifier/Tray.hs b/src/StatusNotifier/Tray.hs
index 46e25c2..f6f79f0 100644
--- a/src/StatusNotifier/Tray.hs
+++ b/src/StatusNotifier/Tray.hs
@@ -99,7 +99,9 @@ getThemeWithDefaultFallbacks themePath = do
getIconPixbufByName :: Int32 -> T.Text -> Maybe String -> IO (Maybe Pixbuf)
getIconPixbufByName size name themePath = do
trayLogger DEBUG $ printf "Getting Pixbuf from name for %s" name
- themeForIcon <- maybe iconThemeGetDefault getThemeWithDefaultFallbacks themePath
+ let nonEmptyThemePath = themePath >>= (\x -> if x == "" then Nothing else Just x)
+ themeForIcon <-
+ maybe iconThemeGetDefault getThemeWithDefaultFallbacks nonEmptyThemePath
let panelName = T.pack $ printf "%s-panel" name
hasPanelIcon <- iconThemeHasIcon themeForIcon panelName
@@ -338,8 +340,9 @@ buildTray TrayParams { trayHost = Host
maybeAddOverlayToPixbuf size info pixbuf = do
runMaybeT $ do
let overlayHeight = floor (fromIntegral size * overlayScale)
- overlayPixbuf <- MaybeT $ getOverlayPixBufFromInfo overlayHeight info >>=
- traverse (scalePixbufToSize overlayHeight Gtk.OrientationHorizontal)
+ overlayPixbuf <-
+ MaybeT $ getOverlayPixBufFromInfo overlayHeight info >>=
+ traverse (scalePixbufToSize overlayHeight Gtk.OrientationHorizontal)
lift $ do
actualOHeight <- getPixbufHeight overlayPixbuf
actualOWidth <- getPixbufWidth overlayPixbuf