summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2014-03-10 23:16:41 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2014-04-27 00:11:35 +0100
commitf32c168ed75310259f1836f66fd9ea141493de68 (patch)
tree04fcfa1ae92c279c3b339f9d4fd812199e9e1e1f
parent9339706b966ad3327a347dc9574cb6aec6d5b95e (diff)
build: Add multi-size icons to the build
Install them in the standard icon theme directory, too, so they can be used more naturally by GTK+ APIs.
-rw-r--r--Bustle/UI.hs15
-rw-r--r--Bustle/UI/AboutDialog.hs5
-rw-r--r--Makefile24
-rw-r--r--bustle.cabal3
-rw-r--r--data/bustle.pngbin1282 -> 0 bytes
-rw-r--r--data/bustle.ui2
-rw-r--r--data/icons/16x16/bustle.pngbin0 -> 519 bytes
-rw-r--r--data/icons/22x22/bustle.pngbin0 -> 716 bytes
-rw-r--r--data/icons/256x256/bustle.pngbin0 -> 8774 bytes
-rw-r--r--data/icons/32x32/bustle.pngbin0 -> 1049 bytes
-rw-r--r--data/icons/48x48/bustle.pngbin0 -> 1669 bytes
-rw-r--r--data/icons/scalable/bustle.svg266
12 files changed, 298 insertions, 17 deletions
diff --git a/Bustle/UI.hs b/Bustle/UI.hs
index 75cd5a2..3a0ce7b 100644
--- a/Bustle/UI.hs
+++ b/Bustle/UI.hs
@@ -95,7 +95,6 @@ data WindowInfo =
data BConfig =
BConfig { debugEnabled :: Bool
- , bustleIcon :: Maybe Pixbuf
, methodIcon :: Maybe Pixbuf
, signalIcon :: Maybe Pixbuf
}
@@ -120,11 +119,10 @@ uiMain = failOnGError $ do
-- FIXME: get a real option parser
let debug = any isDebug args
- [bustle, method, signal] <- mapM loadPixbuf
- ["bustle.png", "dfeet-method.png", "dfeet-signal.png"]
+ [method, signal] <- mapM loadPixbuf
+ ["dfeet-method.png", "dfeet-signal.png"]
let config = BConfig { debugEnabled = debug
- , bustleIcon = bustle
, methodIcon = method
, signalIcon = signal
}
@@ -339,10 +337,8 @@ emptyWindow = do
openTwoDialog <- embedIO $ \r ->
setupOpenTwoDialog builder window $ \f1 f2 ->
makeCallback (loadInInitialWindow (TwoLogs f1 f2)) r
- withProgramIcon (windowSetIcon openTwoDialog)
-- Set up the window itself
- withProgramIcon (windowSetIcon window)
embedIO $ onDestroy window . makeCallback maybeQuit
-- File menu and related buttons
@@ -358,8 +354,8 @@ emptyWindow = do
onActivateLeaf openTwoItem $ widgetShowAll openTwoDialog
-- Help menu
- withProgramIcon $ \icon -> io $
- onActivateLeaf aboutItem $ showAboutDialog window icon
+ embedIO $ \r -> do
+ onActivateLeaf aboutItem $ showAboutDialog window
m <- asks methodIcon
s <- asks signalIcon
@@ -526,9 +522,6 @@ displayLog wi@(WindowInfo { wiWindow = window
return ()
-withProgramIcon :: (Maybe Pixbuf -> IO a) -> B a
-withProgramIcon f = asks bustleIcon >>= io . f
-
loadPixbuf :: FilePath -> IO (Maybe Pixbuf)
loadPixbuf filename = do
iconName <- getDataFileName $ "data/" ++ filename
diff --git a/Bustle/UI/AboutDialog.hs b/Bustle/UI/AboutDialog.hs
index d7c4842..7ef4ce5 100644
--- a/Bustle/UI/AboutDialog.hs
+++ b/Bustle/UI/AboutDialog.hs
@@ -36,9 +36,8 @@ import Paths_bustle
showAboutDialog :: Window
- -> Maybe Pixbuf
-> IO ()
-showAboutDialog window icon = do
+showAboutDialog window = do
dialog <- aboutDialogNew
license <- (Just `fmap` (readFile =<< getDataFileName "LICENSE"))
@@ -56,7 +55,7 @@ showAboutDialog window icon = do
when (resp == ResponseCancel) (widgetDestroy dialog)
windowSetTransientFor dialog window
windowSetModal dialog True
- aboutDialogSetLogo dialog icon
+ aboutDialogSetLogoIconName dialog (Just "bustle")
widgetShowAll dialog
diff --git a/Makefile b/Makefile
index 5dc87a2..0b228ed 100644
--- a/Makefile
+++ b/Makefile
@@ -15,8 +15,13 @@ BINARIES = \
MANPAGE = bustle-pcap.1
DESKTOP_FILE = bustle.desktop
APPDATA_FILE = bustle.appdata.xml
+ICON_SIZES = 16x16 22x22 32x32 48x48 256x256
+ICONS = \
+ data/icons/scalable/bustle.svg \
+ $(foreach size,$(ICON_SIZES),data/icons/$(size)/bustle.png) \
+ $(NULL)
-all: $(BINARIES) $(MANPAGE) $(DESKTOP_FILE) $(APPDATA_FILE)
+all: $(BINARIES) $(MANPAGE) $(DESKTOP_FILE) $(APPDATA_FILE) $(ICONS)
BUSTLE_PCAP_SOURCES = c-sources/pcap-monitor.c c-sources/bustle-pcap.c
BUSTLE_PCAP_GENERATED_HEADERS = dist/build/autogen/version.h
@@ -51,18 +56,35 @@ install: all
cp $(DESKTOP_FILE) $(DATADIR)/applications
mkdir -p $(DATADIR)/appdata
cp $(APPDATA_FILE) $(DATADIR)/appdata
+ $(foreach size,$(ICON_SIZES),mkdir -p $(DATADIR)/icons/hicolor/$(size)/apps; )
+ $(foreach size,$(ICON_SIZES),cp data/icons/$(size)/bustle.png $(DATADIR)/icons/hicolor/$(size)/apps; )
+ $(MAKE) update-icon-cache
uninstall:
rm -f $(BINDIR)/$(notdir $(BINARIES))
rm -f $(MAN1DIR)/$(MANPAGE)
rm -f $(DATADIR)/applications/$(DESKTOP_FILE)
rm -f $(DATADIR)/appdata/$(APPDATA_FILE)
+ $(foreach size,$(ICON_SIZES),rm -f $(DATADIR)/icons/hicolor/$(size)/apps/bustle.png)
+ $(MAKE) update-icon-cache
clean:
rm -f $(BINARIES) $(MANPAGE) $(BUSTLE_PCAP_GENERATED_HEADERS) $(DESKTOP_FILE) $(APPDATA_FILE)
if test -d ./$(TARBALL_DIR); then rm -r ./$(TARBALL_DIR); fi
rm -f ./$(TARBALL)
+# Icon cache stuff
+gtk_update_icon_cache = gtk-update-icon-cache -f -t $(DATADIR)/icons/hicolor
+
+update-icon-cache:
+ @-if test -z "$(DESTDIR)"; then \
+ echo "Updating GTK+ icon cache."; \
+ $(gtk_update_icon_cache); \
+ else \
+ echo "*** Icon cache not updated. After (un)install, run this:"; \
+ echo "*** $(gtk_update_icon_cache)"; \
+ fi
+
# Binary tarball stuff. Please ignore this unless you're making a release.
TOP := $(shell pwd)
TARBALL_PARENT_DIR := dist
diff --git a/bustle.cabal b/bustle.cabal
index 3d9a5af..9ff2580 100644
--- a/bustle.cabal
+++ b/bustle.cabal
@@ -8,8 +8,7 @@ License: OtherLicense
License-file: LICENSE
Author: Will Thompson <will@willthompson.co.uk>
Maintainer: Will Thompson <will@willthompson.co.uk>
-Data-files: data/bustle.png,
- data/dfeet-method.png,
+Data-files: data/dfeet-method.png,
data/dfeet-signal.png,
data/bustle.ui,
LICENSE
diff --git a/data/bustle.png b/data/bustle.png
deleted file mode 100644
index 779cefa..0000000
--- a/data/bustle.png
+++ /dev/null
Binary files differ
diff --git a/data/bustle.ui b/data/bustle.ui
index 3e2e98d..3836a8b 100644
--- a/data/bustle.ui
+++ b/data/bustle.ui
@@ -5,6 +5,7 @@
<property name="can_focus">False</property>
<property name="default_width">900</property>
<property name="default_height">700</property>
+ <property name="icon-name">bustle</property>
<child>
<object class="GtkVBox" id="box1">
<property name="visible">True</property>
@@ -496,6 +497,7 @@
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="type_hint">dialog</property>
+ <property name="icon-name">bustle</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
diff --git a/data/icons/16x16/bustle.png b/data/icons/16x16/bustle.png
new file mode 100644
index 0000000..a043a68
--- /dev/null
+++ b/data/icons/16x16/bustle.png
Binary files differ
diff --git a/data/icons/22x22/bustle.png b/data/icons/22x22/bustle.png
new file mode 100644
index 0000000..c9aab82
--- /dev/null
+++ b/data/icons/22x22/bustle.png
Binary files differ
diff --git a/data/icons/256x256/bustle.png b/data/icons/256x256/bustle.png
new file mode 100644
index 0000000..669635c
--- /dev/null
+++ b/data/icons/256x256/bustle.png
Binary files differ
diff --git a/data/icons/32x32/bustle.png b/data/icons/32x32/bustle.png
new file mode 100644
index 0000000..70610b7
--- /dev/null
+++ b/data/icons/32x32/bustle.png
Binary files differ
diff --git a/data/icons/48x48/bustle.png b/data/icons/48x48/bustle.png
new file mode 100644
index 0000000..25ae4a5
--- /dev/null
+++ b/data/icons/48x48/bustle.png
Binary files differ
diff --git a/data/icons/scalable/bustle.svg b/data/icons/scalable/bustle.svg
new file mode 100644
index 0000000..66af4b1
--- /dev/null
+++ b/data/icons/scalable/bustle.svg
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="605.06"
+ height="605.06"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="bustle.svg">
+ <defs
+ id="defs4">
+ <inkscape:path-effect
+ is_visible="true"
+ id="path-effect4126"
+ effect="spiro" />
+ <inkscape:path-effect
+ is_visible="true"
+ id="path-effect4123"
+ effect="spiro" />
+ <inkscape:path-effect
+ is_visible="true"
+ id="path-effect4120"
+ effect="spiro" />
+ <inkscape:path-effect
+ is_visible="true"
+ id="path-effect4117"
+ effect="spiro" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3770"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3763"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3759"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3770-1"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3770-3"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3759-7"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3763-2"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3770-6"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3770-3-1"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3770-6-2"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3763-2-7"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3770-3-1-2"
+ is_visible="true" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect3759-7-2"
+ is_visible="true" />
+ <filter
+ id="filter4104"
+ inkscape:label="Chalk and sponge"
+ inkscape:menu="Distort"
+ inkscape:menu-tooltip="Low turbulence gives sponge look and high turbulence chalk"
+ width="1.6"
+ height="2"
+ y="-0.5"
+ x="-0.30000001"
+ color-interpolation-filters="sRGB">
+ <feTurbulence
+ id="feTurbulence4106"
+ baseFrequency="0.4"
+ type="fractalNoise"
+ seed="0"
+ numOctaves="5"
+ result="result1" />
+ <feOffset
+ id="feOffset4108"
+ dx="-5"
+ dy="-5"
+ result="result2" />
+ <feDisplacementMap
+ id="feDisplacementMap4110"
+ in2="result1"
+ xChannelSelector="R"
+ yChannelSelector="G"
+ scale="30"
+ in="SourceGraphic" />
+ </filter>
+ <filter
+ id="filter4183"
+ inkscape:label="Chalk and sponge"
+ inkscape:menu="Distort"
+ inkscape:menu-tooltip="Low turbulence gives sponge look and high turbulence chalk"
+ width="1.6"
+ height="2"
+ y="-0.5"
+ x="-0.30000001"
+ color-interpolation-filters="sRGB">
+ <feTurbulence
+ id="feTurbulence4185"
+ baseFrequency="0.4"
+ type="fractalNoise"
+ seed="0"
+ numOctaves="5"
+ result="result1" />
+ <feOffset
+ id="feOffset4187"
+ dx="-5"
+ dy="-5"
+ result="result2" />
+ <feDisplacementMap
+ id="feDisplacementMap4189"
+ in2="result1"
+ xChannelSelector="R"
+ yChannelSelector="G"
+ scale="30"
+ in="SourceGraphic" />
+ </filter>
+ <inkscape:path-effect
+ is_visible="true"
+ id="path-effect4117-2"
+ effect="spiro" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.59"
+ inkscape:cx="351.05408"
+ inkscape:cy="216.30891"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1388"
+ inkscape:window-height="833"
+ inkscape:window-x="50"
+ inkscape:window-y="223"
+ inkscape:window-maximized="0"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3834"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true"
+ originx="-56.941089px"
+ originy="-465.18127px" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-56.941089,17.879098)">
+ <path
+ style="fill:none;stroke:#74b674;stroke-width:27.59247017;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:82.77741051, 27.59247017;stroke-dashoffset:27.59247017"
+ d="m 70.761814,288.36996 c -0.01207,-1.2669 -0.02449,-2.53589 -0.02449,-3.80671 0,-159.41492 129.271656,-288.6461129 288.736206,-288.6461129 159.46457,0 288.73621,129.2311929 288.73621,288.6461129 l 0,0 0,0 c 0,1.27082 -0.009,2.53969 -0.0245,3.80671"
+ id="path3802-8"
+ inkscape:connector-curvature="0"
+ inkscape:export-filename="/home/ziz-2/Desktop/kkkkkkkk.png"
+ inkscape:export-xdpi="8.2586517"
+ inkscape:export-ydpi="8.2586517" />
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#000000;stroke-width:34.42315674;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path2985-7"
+ sodipodi:cx="381.42856"
+ sodipodi:cy="433.79074"
+ sodipodi:rx="130"
+ sodipodi:ry="118.57143"
+ d="m 511.42856,433.79074 a 130,118.57143 0 1 1 -260,0 130,118.57143 0 1 1 260,0 z"
+ transform="matrix(0.50880116,0,0,0.55776489,164.13818,45.848517)"
+ inkscape:export-filename="/home/ziz-2/Desktop/kkkkkkkk.png"
+ inkscape:export-xdpi="8.2586517"
+ inkscape:export-ydpi="8.2586517" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:18.45480156;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 417.41556,287.80173 211.44171,0"
+ id="path3757-7"
+ inkscape:path-effect="#path-effect3759-7"
+ inkscape:original-d="m 417.41556,287.80173 211.44171,0"
+ inkscape:connector-curvature="0"
+ inkscape:export-filename="/home/ziz-2/Desktop/kkkkkkkk.png"
+ inkscape:export-xdpi="8.2586517"
+ inkscape:export-ydpi="8.2586517" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:18.17925262;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 294.08479,287.66116 -211.718251,0.2812"
+ id="path3761-7"
+ inkscape:path-effect="#path-effect3763-2"
+ inkscape:original-d="m 294.08479,287.66116 -211.718251,0.2812"
+ inkscape:connector-curvature="0"
+ inkscape:export-filename="/home/ziz-2/Desktop/kkkkkkkk.png"
+ inkscape:export-xdpi="8.2586517"
+ inkscape:export-ydpi="8.2586517" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:18.33793068;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 200.97285,226.67532 77.897224,289.6408 200.97285,348.92819"
+ id="path3768-2"
+ inkscape:path-effect="#path-effect3770-6"
+ inkscape:original-d="M 200.97285,226.67532 77.897224,289.6408 200.97285,348.92819"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/ziz-2/Desktop/kkkkkkkk.png"
+ inkscape:export-xdpi="8.2586517"
+ inkscape:export-ydpi="8.2586517" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:18.33793068;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 520.66838,225.39683 643.74401,288.36232 520.66838,347.6497"
+ id="path3768-9-7"
+ inkscape:path-effect="#path-effect3770-3-1"
+ inkscape:original-d="M 520.66838,225.39683 643.74401,288.36232 520.66838,347.6497"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/ziz-2/Desktop/kkkkkkkk.png"
+ inkscape:export-xdpi="8.2586517"
+ inkscape:export-ydpi="8.2586517" />
+ </g>
+</svg>