diff --git a/data/icons/menu/dark/about.png b/data/icons/menu/dark/about.png
new file mode 100644
index 00000000..08b64db1
Binary files /dev/null and b/data/icons/menu/dark/about.png differ
diff --git a/data/icons/menu/dark/about.svg b/data/icons/menu/dark/about.svg
new file mode 100644
index 00000000..29ed7982
--- /dev/null
+++ b/data/icons/menu/dark/about.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/dark/add.png b/data/icons/menu/dark/add.png
new file mode 100644
index 00000000..1525d461
Binary files /dev/null and b/data/icons/menu/dark/add.png differ
diff --git a/data/icons/menu/dark/add.svg b/data/icons/menu/dark/add.svg
new file mode 100644
index 00000000..bcf1c2c2
--- /dev/null
+++ b/data/icons/menu/dark/add.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/dark/chanlist.png b/data/icons/menu/dark/chanlist.png
new file mode 100644
index 00000000..9aac1a20
Binary files /dev/null and b/data/icons/menu/dark/chanlist.png differ
diff --git a/data/icons/menu/dark/chanlist.svg b/data/icons/menu/dark/chanlist.svg
new file mode 100644
index 00000000..d1875770
--- /dev/null
+++ b/data/icons/menu/dark/chanlist.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/dark/clear.png b/data/icons/menu/dark/clear.png
new file mode 100644
index 00000000..d3a1c607
Binary files /dev/null and b/data/icons/menu/dark/clear.png differ
diff --git a/data/icons/menu/dark/clear.svg b/data/icons/menu/dark/clear.svg
new file mode 100644
index 00000000..92241371
--- /dev/null
+++ b/data/icons/menu/dark/clear.svg
@@ -0,0 +1,6 @@
+
diff --git a/data/icons/menu/dark/close.png b/data/icons/menu/dark/close.png
new file mode 100644
index 00000000..6e9bb61a
Binary files /dev/null and b/data/icons/menu/dark/close.png differ
diff --git a/data/icons/menu/dark/close.svg b/data/icons/menu/dark/close.svg
new file mode 100644
index 00000000..b900bde1
--- /dev/null
+++ b/data/icons/menu/dark/close.svg
@@ -0,0 +1,4 @@
+
diff --git a/data/icons/menu/dark/connect.png b/data/icons/menu/dark/connect.png
new file mode 100644
index 00000000..d80b55aa
Binary files /dev/null and b/data/icons/menu/dark/connect.png differ
diff --git a/data/icons/menu/dark/connect.svg b/data/icons/menu/dark/connect.svg
new file mode 100644
index 00000000..23e9f7e1
--- /dev/null
+++ b/data/icons/menu/dark/connect.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/dark/copy.png b/data/icons/menu/dark/copy.png
new file mode 100644
index 00000000..f0dab355
Binary files /dev/null and b/data/icons/menu/dark/copy.png differ
diff --git a/data/icons/menu/dark/copy.svg b/data/icons/menu/dark/copy.svg
new file mode 100644
index 00000000..936b5ebd
--- /dev/null
+++ b/data/icons/menu/dark/copy.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/dark/delete.png b/data/icons/menu/dark/delete.png
new file mode 100644
index 00000000..511142cc
Binary files /dev/null and b/data/icons/menu/dark/delete.png differ
diff --git a/data/icons/menu/dark/delete.svg b/data/icons/menu/dark/delete.svg
new file mode 100644
index 00000000..df61c508
--- /dev/null
+++ b/data/icons/menu/dark/delete.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/dark/detach.png b/data/icons/menu/dark/detach.png
new file mode 100644
index 00000000..edbf3997
Binary files /dev/null and b/data/icons/menu/dark/detach.png differ
diff --git a/data/icons/menu/dark/detach.svg b/data/icons/menu/dark/detach.svg
new file mode 100644
index 00000000..5d27f27b
--- /dev/null
+++ b/data/icons/menu/dark/detach.svg
@@ -0,0 +1,4 @@
+
diff --git a/data/icons/menu/dark/disconnect.png b/data/icons/menu/dark/disconnect.png
new file mode 100644
index 00000000..f77be0ca
Binary files /dev/null and b/data/icons/menu/dark/disconnect.png differ
diff --git a/data/icons/menu/dark/disconnect.svg b/data/icons/menu/dark/disconnect.svg
new file mode 100644
index 00000000..ac33ae30
--- /dev/null
+++ b/data/icons/menu/dark/disconnect.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/dark/emoji.png b/data/icons/menu/dark/emoji.png
new file mode 100644
index 00000000..c95918dd
Binary files /dev/null and b/data/icons/menu/dark/emoji.png differ
diff --git a/data/icons/menu/dark/emoji.svg b/data/icons/menu/dark/emoji.svg
new file mode 100644
index 00000000..90200fc4
--- /dev/null
+++ b/data/icons/menu/dark/emoji.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/data/icons/menu/dark/find.png b/data/icons/menu/dark/find.png
new file mode 100644
index 00000000..43ab9876
Binary files /dev/null and b/data/icons/menu/dark/find.png differ
diff --git a/data/icons/menu/dark/find.svg b/data/icons/menu/dark/find.svg
new file mode 100644
index 00000000..da071ab0
--- /dev/null
+++ b/data/icons/menu/dark/find.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/dark/help.png b/data/icons/menu/dark/help.png
new file mode 100644
index 00000000..6bb506b4
Binary files /dev/null and b/data/icons/menu/dark/help.png differ
diff --git a/data/icons/menu/dark/help.svg b/data/icons/menu/dark/help.svg
new file mode 100644
index 00000000..372b8148
--- /dev/null
+++ b/data/icons/menu/dark/help.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/dark/join.png b/data/icons/menu/dark/join.png
new file mode 100644
index 00000000..60907671
Binary files /dev/null and b/data/icons/menu/dark/join.png differ
diff --git a/data/icons/menu/dark/join.svg b/data/icons/menu/dark/join.svg
new file mode 100644
index 00000000..b7c79c33
--- /dev/null
+++ b/data/icons/menu/dark/join.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/dark/load-plugin.png b/data/icons/menu/dark/load-plugin.png
new file mode 100644
index 00000000..cdfec9d5
Binary files /dev/null and b/data/icons/menu/dark/load-plugin.png differ
diff --git a/data/icons/menu/dark/load-plugin.svg b/data/icons/menu/dark/load-plugin.svg
new file mode 100644
index 00000000..16a7ea74
--- /dev/null
+++ b/data/icons/menu/dark/load-plugin.svg
@@ -0,0 +1,6 @@
+
diff --git a/data/icons/menu/dark/network-list.png b/data/icons/menu/dark/network-list.png
new file mode 100644
index 00000000..9aac1a20
Binary files /dev/null and b/data/icons/menu/dark/network-list.png differ
diff --git a/data/icons/menu/dark/network-list.svg b/data/icons/menu/dark/network-list.svg
new file mode 100644
index 00000000..d1875770
--- /dev/null
+++ b/data/icons/menu/dark/network-list.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/dark/new.png b/data/icons/menu/dark/new.png
new file mode 100644
index 00000000..24e226c9
Binary files /dev/null and b/data/icons/menu/dark/new.png differ
diff --git a/data/icons/menu/dark/new.svg b/data/icons/menu/dark/new.svg
new file mode 100644
index 00000000..6b5a7da2
--- /dev/null
+++ b/data/icons/menu/dark/new.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/dark/next.png b/data/icons/menu/dark/next.png
new file mode 100644
index 00000000..0ac0df17
Binary files /dev/null and b/data/icons/menu/dark/next.png differ
diff --git a/data/icons/menu/dark/next.svg b/data/icons/menu/dark/next.svg
new file mode 100644
index 00000000..9a61599d
--- /dev/null
+++ b/data/icons/menu/dark/next.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/dark/preferences.png b/data/icons/menu/dark/preferences.png
new file mode 100644
index 00000000..c33104d3
Binary files /dev/null and b/data/icons/menu/dark/preferences.png differ
diff --git a/data/icons/menu/dark/preferences.svg b/data/icons/menu/dark/preferences.svg
new file mode 100644
index 00000000..e9c6ad2b
--- /dev/null
+++ b/data/icons/menu/dark/preferences.svg
@@ -0,0 +1,4 @@
+
diff --git a/data/icons/menu/dark/previous.png b/data/icons/menu/dark/previous.png
new file mode 100644
index 00000000..fbbe0dbf
Binary files /dev/null and b/data/icons/menu/dark/previous.png differ
diff --git a/data/icons/menu/dark/previous.svg b/data/icons/menu/dark/previous.svg
new file mode 100644
index 00000000..1f6c39a0
--- /dev/null
+++ b/data/icons/menu/dark/previous.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/dark/quit.png b/data/icons/menu/dark/quit.png
new file mode 100644
index 00000000..47c2793e
Binary files /dev/null and b/data/icons/menu/dark/quit.png differ
diff --git a/data/icons/menu/dark/quit.svg b/data/icons/menu/dark/quit.svg
new file mode 100644
index 00000000..8fed449f
--- /dev/null
+++ b/data/icons/menu/dark/quit.svg
@@ -0,0 +1,4 @@
+
diff --git a/data/icons/menu/dark/refresh.png b/data/icons/menu/dark/refresh.png
new file mode 100644
index 00000000..c32d4259
Binary files /dev/null and b/data/icons/menu/dark/refresh.png differ
diff --git a/data/icons/menu/dark/refresh.svg b/data/icons/menu/dark/refresh.svg
new file mode 100644
index 00000000..a325b64e
--- /dev/null
+++ b/data/icons/menu/dark/refresh.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/dark/remove.png b/data/icons/menu/dark/remove.png
new file mode 100644
index 00000000..83e0e007
Binary files /dev/null and b/data/icons/menu/dark/remove.png differ
diff --git a/data/icons/menu/dark/remove.svg b/data/icons/menu/dark/remove.svg
new file mode 100644
index 00000000..63494850
--- /dev/null
+++ b/data/icons/menu/dark/remove.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/dark/save-as.png b/data/icons/menu/dark/save-as.png
new file mode 100644
index 00000000..21a63153
Binary files /dev/null and b/data/icons/menu/dark/save-as.png differ
diff --git a/data/icons/menu/dark/save-as.svg b/data/icons/menu/dark/save-as.svg
new file mode 100644
index 00000000..642442d0
--- /dev/null
+++ b/data/icons/menu/dark/save-as.svg
@@ -0,0 +1,6 @@
+
diff --git a/data/icons/menu/dark/save.png b/data/icons/menu/dark/save.png
new file mode 100644
index 00000000..841b26c6
Binary files /dev/null and b/data/icons/menu/dark/save.png differ
diff --git a/data/icons/menu/dark/save.svg b/data/icons/menu/dark/save.svg
new file mode 100644
index 00000000..8525797c
--- /dev/null
+++ b/data/icons/menu/dark/save.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/dark/search.png b/data/icons/menu/dark/search.png
new file mode 100644
index 00000000..0310a705
Binary files /dev/null and b/data/icons/menu/dark/search.png differ
diff --git a/data/icons/menu/dark/search.svg b/data/icons/menu/dark/search.svg
new file mode 100644
index 00000000..a90679aa
--- /dev/null
+++ b/data/icons/menu/dark/search.svg
@@ -0,0 +1,4 @@
+
diff --git a/data/icons/menu/dark/spell-check.png b/data/icons/menu/dark/spell-check.png
new file mode 100644
index 00000000..ec54916a
Binary files /dev/null and b/data/icons/menu/dark/spell-check.png differ
diff --git a/data/icons/menu/dark/spell-check.svg b/data/icons/menu/dark/spell-check.svg
new file mode 100644
index 00000000..24ebc5be
--- /dev/null
+++ b/data/icons/menu/dark/spell-check.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/dark/update.png b/data/icons/menu/dark/update.png
new file mode 100644
index 00000000..83680b92
Binary files /dev/null and b/data/icons/menu/dark/update.png differ
diff --git a/data/icons/menu/dark/update.svg b/data/icons/menu/dark/update.svg
new file mode 100644
index 00000000..61794d66
--- /dev/null
+++ b/data/icons/menu/dark/update.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/data/icons/menu/light/about.png b/data/icons/menu/light/about.png
new file mode 100644
index 00000000..e1b58432
Binary files /dev/null and b/data/icons/menu/light/about.png differ
diff --git a/data/icons/menu/light/about.svg b/data/icons/menu/light/about.svg
new file mode 100644
index 00000000..0b174910
--- /dev/null
+++ b/data/icons/menu/light/about.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/light/add.png b/data/icons/menu/light/add.png
new file mode 100644
index 00000000..c160c13f
Binary files /dev/null and b/data/icons/menu/light/add.png differ
diff --git a/data/icons/menu/light/add.svg b/data/icons/menu/light/add.svg
new file mode 100644
index 00000000..4f91008c
--- /dev/null
+++ b/data/icons/menu/light/add.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/light/chanlist.png b/data/icons/menu/light/chanlist.png
new file mode 100644
index 00000000..dd358626
Binary files /dev/null and b/data/icons/menu/light/chanlist.png differ
diff --git a/data/icons/menu/light/chanlist.svg b/data/icons/menu/light/chanlist.svg
new file mode 100644
index 00000000..d76e703e
--- /dev/null
+++ b/data/icons/menu/light/chanlist.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/light/clear.png b/data/icons/menu/light/clear.png
new file mode 100644
index 00000000..49a4ccfd
Binary files /dev/null and b/data/icons/menu/light/clear.png differ
diff --git a/data/icons/menu/light/clear.svg b/data/icons/menu/light/clear.svg
new file mode 100644
index 00000000..bd8ab3c8
--- /dev/null
+++ b/data/icons/menu/light/clear.svg
@@ -0,0 +1,6 @@
+
diff --git a/data/icons/menu/light/close.png b/data/icons/menu/light/close.png
new file mode 100644
index 00000000..6f0e8e9c
Binary files /dev/null and b/data/icons/menu/light/close.png differ
diff --git a/data/icons/menu/light/close.svg b/data/icons/menu/light/close.svg
new file mode 100644
index 00000000..b3802887
--- /dev/null
+++ b/data/icons/menu/light/close.svg
@@ -0,0 +1,4 @@
+
diff --git a/data/icons/menu/light/connect.png b/data/icons/menu/light/connect.png
new file mode 100644
index 00000000..4f73f890
Binary files /dev/null and b/data/icons/menu/light/connect.png differ
diff --git a/data/icons/menu/light/connect.svg b/data/icons/menu/light/connect.svg
new file mode 100644
index 00000000..0ae90ca0
--- /dev/null
+++ b/data/icons/menu/light/connect.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/light/copy.png b/data/icons/menu/light/copy.png
new file mode 100644
index 00000000..369e8732
Binary files /dev/null and b/data/icons/menu/light/copy.png differ
diff --git a/data/icons/menu/light/copy.svg b/data/icons/menu/light/copy.svg
new file mode 100644
index 00000000..7fb9ada5
--- /dev/null
+++ b/data/icons/menu/light/copy.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/light/delete.png b/data/icons/menu/light/delete.png
new file mode 100644
index 00000000..a7aff1e8
Binary files /dev/null and b/data/icons/menu/light/delete.png differ
diff --git a/data/icons/menu/light/delete.svg b/data/icons/menu/light/delete.svg
new file mode 100644
index 00000000..d90217ac
--- /dev/null
+++ b/data/icons/menu/light/delete.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/light/detach.png b/data/icons/menu/light/detach.png
new file mode 100644
index 00000000..3f4a2e38
Binary files /dev/null and b/data/icons/menu/light/detach.png differ
diff --git a/data/icons/menu/light/detach.svg b/data/icons/menu/light/detach.svg
new file mode 100644
index 00000000..1f24c1d5
--- /dev/null
+++ b/data/icons/menu/light/detach.svg
@@ -0,0 +1,4 @@
+
diff --git a/data/icons/menu/light/disconnect.png b/data/icons/menu/light/disconnect.png
new file mode 100644
index 00000000..275fb050
Binary files /dev/null and b/data/icons/menu/light/disconnect.png differ
diff --git a/data/icons/menu/light/disconnect.svg b/data/icons/menu/light/disconnect.svg
new file mode 100644
index 00000000..07337c2f
--- /dev/null
+++ b/data/icons/menu/light/disconnect.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/light/emoji.png b/data/icons/menu/light/emoji.png
new file mode 100644
index 00000000..d8fe5cdb
Binary files /dev/null and b/data/icons/menu/light/emoji.png differ
diff --git a/data/icons/menu/light/emoji.svg b/data/icons/menu/light/emoji.svg
new file mode 100644
index 00000000..989062b8
--- /dev/null
+++ b/data/icons/menu/light/emoji.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/data/icons/menu/light/find.png b/data/icons/menu/light/find.png
new file mode 100644
index 00000000..88cc5143
Binary files /dev/null and b/data/icons/menu/light/find.png differ
diff --git a/data/icons/menu/light/find.svg b/data/icons/menu/light/find.svg
new file mode 100644
index 00000000..534d74f2
--- /dev/null
+++ b/data/icons/menu/light/find.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/light/help.png b/data/icons/menu/light/help.png
new file mode 100644
index 00000000..55032857
Binary files /dev/null and b/data/icons/menu/light/help.png differ
diff --git a/data/icons/menu/light/help.svg b/data/icons/menu/light/help.svg
new file mode 100644
index 00000000..b629f781
--- /dev/null
+++ b/data/icons/menu/light/help.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/light/join.png b/data/icons/menu/light/join.png
new file mode 100644
index 00000000..29a7d38f
Binary files /dev/null and b/data/icons/menu/light/join.png differ
diff --git a/data/icons/menu/light/join.svg b/data/icons/menu/light/join.svg
new file mode 100644
index 00000000..7e8bce9f
--- /dev/null
+++ b/data/icons/menu/light/join.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/light/load-plugin.png b/data/icons/menu/light/load-plugin.png
new file mode 100644
index 00000000..923c33ae
Binary files /dev/null and b/data/icons/menu/light/load-plugin.png differ
diff --git a/data/icons/menu/light/load-plugin.svg b/data/icons/menu/light/load-plugin.svg
new file mode 100644
index 00000000..e74500b2
--- /dev/null
+++ b/data/icons/menu/light/load-plugin.svg
@@ -0,0 +1,6 @@
+
diff --git a/data/icons/menu/light/network-list.png b/data/icons/menu/light/network-list.png
new file mode 100644
index 00000000..dd358626
Binary files /dev/null and b/data/icons/menu/light/network-list.png differ
diff --git a/data/icons/menu/light/network-list.svg b/data/icons/menu/light/network-list.svg
new file mode 100644
index 00000000..d76e703e
--- /dev/null
+++ b/data/icons/menu/light/network-list.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/light/new.png b/data/icons/menu/light/new.png
new file mode 100644
index 00000000..01625797
Binary files /dev/null and b/data/icons/menu/light/new.png differ
diff --git a/data/icons/menu/light/new.svg b/data/icons/menu/light/new.svg
new file mode 100644
index 00000000..a63e69fb
--- /dev/null
+++ b/data/icons/menu/light/new.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/light/next.png b/data/icons/menu/light/next.png
new file mode 100644
index 00000000..47f6a11d
Binary files /dev/null and b/data/icons/menu/light/next.png differ
diff --git a/data/icons/menu/light/next.svg b/data/icons/menu/light/next.svg
new file mode 100644
index 00000000..e2427e28
--- /dev/null
+++ b/data/icons/menu/light/next.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/light/preferences.png b/data/icons/menu/light/preferences.png
new file mode 100644
index 00000000..5f600e55
Binary files /dev/null and b/data/icons/menu/light/preferences.png differ
diff --git a/data/icons/menu/light/preferences.svg b/data/icons/menu/light/preferences.svg
new file mode 100644
index 00000000..a69c4449
--- /dev/null
+++ b/data/icons/menu/light/preferences.svg
@@ -0,0 +1,4 @@
+
diff --git a/data/icons/menu/light/previous.png b/data/icons/menu/light/previous.png
new file mode 100644
index 00000000..cb6b8c58
Binary files /dev/null and b/data/icons/menu/light/previous.png differ
diff --git a/data/icons/menu/light/previous.svg b/data/icons/menu/light/previous.svg
new file mode 100644
index 00000000..bf85619d
--- /dev/null
+++ b/data/icons/menu/light/previous.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/light/quit.png b/data/icons/menu/light/quit.png
new file mode 100644
index 00000000..165393d0
Binary files /dev/null and b/data/icons/menu/light/quit.png differ
diff --git a/data/icons/menu/light/quit.svg b/data/icons/menu/light/quit.svg
new file mode 100644
index 00000000..c4141749
--- /dev/null
+++ b/data/icons/menu/light/quit.svg
@@ -0,0 +1,4 @@
+
diff --git a/data/icons/menu/light/refresh.png b/data/icons/menu/light/refresh.png
new file mode 100644
index 00000000..929edc37
Binary files /dev/null and b/data/icons/menu/light/refresh.png differ
diff --git a/data/icons/menu/light/refresh.svg b/data/icons/menu/light/refresh.svg
new file mode 100644
index 00000000..735b7a2d
--- /dev/null
+++ b/data/icons/menu/light/refresh.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/light/remove.png b/data/icons/menu/light/remove.png
new file mode 100644
index 00000000..a61b4cff
Binary files /dev/null and b/data/icons/menu/light/remove.png differ
diff --git a/data/icons/menu/light/remove.svg b/data/icons/menu/light/remove.svg
new file mode 100644
index 00000000..c5c69f7c
--- /dev/null
+++ b/data/icons/menu/light/remove.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/light/save-as.png b/data/icons/menu/light/save-as.png
new file mode 100644
index 00000000..69fe5ffa
Binary files /dev/null and b/data/icons/menu/light/save-as.png differ
diff --git a/data/icons/menu/light/save-as.svg b/data/icons/menu/light/save-as.svg
new file mode 100644
index 00000000..a0e43f07
--- /dev/null
+++ b/data/icons/menu/light/save-as.svg
@@ -0,0 +1,6 @@
+
diff --git a/data/icons/menu/light/save.png b/data/icons/menu/light/save.png
new file mode 100644
index 00000000..70d5d9da
Binary files /dev/null and b/data/icons/menu/light/save.png differ
diff --git a/data/icons/menu/light/save.svg b/data/icons/menu/light/save.svg
new file mode 100644
index 00000000..ac089f3a
--- /dev/null
+++ b/data/icons/menu/light/save.svg
@@ -0,0 +1,5 @@
+
diff --git a/data/icons/menu/light/search.png b/data/icons/menu/light/search.png
new file mode 100644
index 00000000..cb55e883
Binary files /dev/null and b/data/icons/menu/light/search.png differ
diff --git a/data/icons/menu/light/search.svg b/data/icons/menu/light/search.svg
new file mode 100644
index 00000000..f2aa57d7
--- /dev/null
+++ b/data/icons/menu/light/search.svg
@@ -0,0 +1,4 @@
+
diff --git a/data/icons/menu/light/spell-check.png b/data/icons/menu/light/spell-check.png
new file mode 100644
index 00000000..67fc779c
Binary files /dev/null and b/data/icons/menu/light/spell-check.png differ
diff --git a/data/icons/menu/light/spell-check.svg b/data/icons/menu/light/spell-check.svg
new file mode 100644
index 00000000..af7af94a
--- /dev/null
+++ b/data/icons/menu/light/spell-check.svg
@@ -0,0 +1,3 @@
+
diff --git a/data/icons/menu/light/update.png b/data/icons/menu/light/update.png
new file mode 100644
index 00000000..c06163f4
Binary files /dev/null and b/data/icons/menu/light/update.png differ
diff --git a/data/icons/menu/light/update.svg b/data/icons/menu/light/update.svg
new file mode 100644
index 00000000..b423fa58
--- /dev/null
+++ b/data/icons/menu/light/update.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/data/zoitechat.gresource.xml b/data/zoitechat.gresource.xml
index 889ef0f3..93f45143 100644
--- a/data/zoitechat.gresource.xml
+++ b/data/zoitechat.gresource.xml
@@ -20,5 +20,63 @@
icons/tree_dialog.png
icons/tree_server.png
icons/tree_util.png
+
+ icons/menu/light/new.png
+ icons/menu/light/network-list.png
+ icons/menu/light/load-plugin.png
+ icons/menu/light/detach.png
+ icons/menu/light/close.png
+ icons/menu/light/quit.png
+ icons/menu/light/disconnect.png
+ icons/menu/light/connect.png
+ icons/menu/light/join.png
+ icons/menu/light/chanlist.png
+ icons/menu/light/preferences.png
+ icons/menu/light/clear.png
+ icons/menu/light/copy.png
+ icons/menu/light/delete.png
+ icons/menu/light/add.png
+ icons/menu/light/remove.png
+ icons/menu/light/spell-check.png
+ icons/menu/light/save.png
+ icons/menu/light/save-as.png
+ icons/menu/light/refresh.png
+ icons/menu/light/search.png
+ icons/menu/light/find.png
+ icons/menu/light/previous.png
+ icons/menu/light/next.png
+ icons/menu/light/help.png
+ icons/menu/light/about.png
+ icons/menu/light/update.png
+ icons/menu/light/emoji.png
+
+ icons/menu/dark/new.png
+ icons/menu/dark/network-list.png
+ icons/menu/dark/load-plugin.png
+ icons/menu/dark/detach.png
+ icons/menu/dark/close.png
+ icons/menu/dark/quit.png
+ icons/menu/dark/disconnect.png
+ icons/menu/dark/connect.png
+ icons/menu/dark/join.png
+ icons/menu/dark/chanlist.png
+ icons/menu/dark/preferences.png
+ icons/menu/dark/clear.png
+ icons/menu/dark/copy.png
+ icons/menu/dark/delete.png
+ icons/menu/dark/add.png
+ icons/menu/dark/remove.png
+ icons/menu/dark/spell-check.png
+ icons/menu/dark/save.png
+ icons/menu/dark/save-as.png
+ icons/menu/dark/refresh.png
+ icons/menu/dark/search.png
+ icons/menu/dark/find.png
+ icons/menu/dark/previous.png
+ icons/menu/dark/next.png
+ icons/menu/dark/help.png
+ icons/menu/dark/about.png
+ icons/menu/dark/update.png
+ icons/menu/dark/emoji.png
diff --git a/src/common/zoitechat.c b/src/common/zoitechat.c
index dbb6e749..10ce8bc1 100644
--- a/src/common/zoitechat.c
+++ b/src/common/zoitechat.c
@@ -1332,11 +1332,11 @@ xchat_init (void)
"NAME ENDSUB\n" "CMD \n\n"\
"NAME ENDSUB\n" "CMD \n\n",
- _("_Open Dialog Window"), "gtk-go-up",
- _("_Send a File" ELLIPSIS), "gtk-floppy",
- _("_User Info (WhoIs)"), "gtk-info",
- _("_Add to Friends List" ELLIPSIS), "gtk-add",
- _("_Ignore"), "gtk-stop",
+ _("_Open Dialog Window"), "zc-menu-new",
+ _("_Send a File" ELLIPSIS), "zc-menu-save",
+ _("_User Info (WhoIs)"), "zc-menu-about",
+ _("_Add to Friends List" ELLIPSIS), "zc-menu-add",
+ _("_Ignore"), "zc-menu-remove",
_("O_perator Actions"),
_("Give Ops"),
diff --git a/src/fe-gtk/chanlist.c b/src/fe-gtk/chanlist.c
index 0957da7a..6453fbdf 100644
--- a/src/fe-gtk/chanlist.c
+++ b/src/fe-gtk/chanlist.c
@@ -45,20 +45,11 @@
#include "custom-list.h"
-#if HAVE_GTK3
-#define ICON_CHANLIST_JOIN "go-jump"
-#define ICON_CHANLIST_COPY "edit-copy"
-#define ICON_CHANLIST_FIND "edit-find"
-#define ICON_CHANLIST_REFRESH "view-refresh"
-#define ICON_CHANLIST_SAVE "document-save-as"
-#endif
-#if !HAVE_GTK3
-#define ICON_CHANLIST_JOIN GTK_STOCK_JUMP_TO
-#define ICON_CHANLIST_COPY GTK_STOCK_COPY
-#define ICON_CHANLIST_FIND GTK_STOCK_FIND
-#define ICON_CHANLIST_REFRESH GTK_STOCK_REFRESH
-#define ICON_CHANLIST_SAVE GTK_STOCK_SAVE_AS
-#endif
+#define ICON_CHANLIST_JOIN "zc-menu-join"
+#define ICON_CHANLIST_COPY "zc-menu-copy"
+#define ICON_CHANLIST_FIND "zc-menu-find"
+#define ICON_CHANLIST_REFRESH "zc-menu-refresh"
+#define ICON_CHANLIST_SAVE "zc-menu-save"
enum
{
@@ -131,11 +122,7 @@ chanlist_icon_button (const char *label, const char *icon_name,
GtkWidget *image;
button = gtk_button_new_with_mnemonic (label);
-#if HAVE_GTK3
- image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
-#elif !HAVE_GTK3
- image = gtk_image_new_from_stock (icon_name, GTK_ICON_SIZE_MENU);
-#endif
+ image = gtkutil_image_new_from_stock (icon_name, GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (button), image);
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
g_signal_connect (G_OBJECT (button), "clicked", callback, userdata);
@@ -153,14 +140,10 @@ chanlist_icon_menu_item (const char *label, const char *icon_name,
GtkWidget *box;
GtkWidget *image = NULL;
GtkWidget *label_widget;
- const char *icon_name_gtk3;
item = gtk_menu_item_new ();
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
- icon_name_gtk3 = gtkutil_icon_name_from_stock (icon_name);
- if (!icon_name_gtk3)
- icon_name_gtk3 = icon_name;
- image = icon_name_gtk3 ? gtk_image_new_from_icon_name (icon_name_gtk3, GTK_ICON_SIZE_MENU) : NULL;
+ image = icon_name ? gtkutil_image_new_from_stock (icon_name, GTK_ICON_SIZE_MENU) : NULL;
label_widget = gtk_label_new_with_mnemonic (label);
if (image)
gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
@@ -170,7 +153,7 @@ chanlist_icon_menu_item (const char *label, const char *icon_name,
GtkWidget *image;
item = gtk_image_menu_item_new_with_mnemonic (label);
- image = gtk_image_new_from_stock (icon_name, GTK_ICON_SIZE_MENU);
+ image = gtkutil_image_new_from_stock (icon_name, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
#endif
g_signal_connect (G_OBJECT (item), "activate", callback, userdata);
diff --git a/src/fe-gtk/chanview-tree.c b/src/fe-gtk/chanview-tree.c
index 7d3c351c..b4279de3 100644
--- a/src/fe-gtk/chanview-tree.c
+++ b/src/fe-gtk/chanview-tree.c
@@ -41,13 +41,28 @@ static void /* row selected callback */
cv_tree_sel_cb (GtkTreeSelection *sel, chanview *cv)
{
GtkTreeModel *model;
+ GtkTreeIter prev_iter;
GtkTreeIter iter;
chan *ch;
+ chan *prev_ch;
+ gboolean has_prev;
+
+ has_prev = cv->focused && gtk_tree_store_iter_is_valid (cv->store, &cv->focused->iter);
+ if (has_prev)
+ prev_iter = cv->focused->iter;
if (gtk_tree_selection_get_selected (sel, &model, &iter))
{
gtk_tree_model_get (model, &iter, COL_CHAN, &ch, -1);
+ if (has_prev)
+ {
+ gtk_tree_model_get (model, &prev_iter, COL_CHAN, &prev_ch, -1);
+ if (prev_ch != ch)
+ gtk_tree_store_set (cv->store, &prev_iter, COL_UNDERLINE, PANGO_UNDERLINE_NONE, -1);
+ }
+ gtk_tree_store_set (cv->store, &iter, COL_UNDERLINE, PANGO_UNDERLINE_SINGLE, -1);
+
cv->focused = ch;
cv->cb_focus (cv, ch, ch->tag, ch->userdata);
}
@@ -175,7 +190,11 @@ cv_tree_init (chanview *cv)
g_object_set (G_OBJECT (renderer), "ypad", 0, NULL);
gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1);
gtk_tree_view_column_pack_start(col, renderer, TRUE);
- gtk_tree_view_column_set_attributes (col, renderer, "text", COL_NAME, "attributes", COL_ATTR, NULL);
+ gtk_tree_view_column_set_attributes (col, renderer,
+ "text", COL_NAME,
+ "attributes", COL_ATTR,
+ "underline", COL_UNDERLINE,
+ NULL);
gtk_tree_view_column_set_expand (col, TRUE);
gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
diff --git a/src/fe-gtk/chanview.c b/src/fe-gtk/chanview.c
index f4055d54..90de36d7 100644
--- a/src/fe-gtk/chanview.c
+++ b/src/fe-gtk/chanview.c
@@ -35,6 +35,7 @@
#define COL_CHAN 1 /* (chan *) */
#define COL_ATTR 2 /* (PangoAttrList *) */
#define COL_PIXBUF 3 /* (GdkPixbuf *) */
+#define COL_UNDERLINE 4 /* (PangoUnderline) */
struct _chanview
{
@@ -310,8 +311,8 @@ chanview_new (int type, int trunc_len, gboolean sort, gboolean use_icons,
chanview *cv;
cv = g_new0 (chanview, 1);
- cv->store = gtk_tree_store_new (4, G_TYPE_STRING, G_TYPE_POINTER,
- PANGO_TYPE_ATTR_LIST, GDK_TYPE_PIXBUF);
+ cv->store = gtk_tree_store_new (5, G_TYPE_STRING, G_TYPE_POINTER,
+ PANGO_TYPE_ATTR_LIST, GDK_TYPE_PIXBUF, G_TYPE_INT);
#if HAVE_GTK3
cv->font_desc = font_desc;
#else
@@ -429,7 +430,9 @@ chanview_add_real (chanview *cv, char *name, void *family, void *userdata,
memcpy (&(ch->iter), &iter, sizeof (iter));
gtk_tree_store_set (cv->store, &iter, COL_NAME, name, COL_CHAN, ch,
- COL_PIXBUF, icon, -1);
+ COL_PIXBUF, icon,
+ COL_UNDERLINE, PANGO_UNDERLINE_NONE,
+ -1);
cv->size++;
if (!has_parent)
diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c
index f823fdc8..b7376750 100644
--- a/src/fe-gtk/fe-gtk.c
+++ b/src/fe-gtk/fe-gtk.c
@@ -117,26 +117,177 @@ create_msg_dialog (gchar *title, gchar *message)
gtk_widget_destroy (dialog);
}
+static char *win32_argv0_dir;
+
static void
win32_set_gsettings_schema_dir (void)
{
char *base_path;
+ char *share_path;
char *schema_path;
-
- if (g_getenv ("GSETTINGS_SCHEMA_DIR") != NULL)
- return;
+ char *xdg_data_dirs;
+ char **xdg_parts;
+ gboolean have_share_path = FALSE;
+ gint i;
base_path = g_win32_get_package_installation_directory_of_module (NULL);
if (base_path == NULL)
return;
+ share_path = g_build_filename (base_path, "share", NULL);
+
+ /* Ensure GTK can discover bundled icon themes and other shared data. */
+ xdg_data_dirs = g_strdup (g_getenv ("XDG_DATA_DIRS"));
+ if (xdg_data_dirs && *xdg_data_dirs)
+ {
+ xdg_parts = g_strsplit (xdg_data_dirs, G_SEARCHPATH_SEPARATOR_S, -1);
+ for (i = 0; xdg_parts[i] != NULL; i++)
+ {
+ if (g_ascii_strcasecmp (xdg_parts[i], share_path) == 0)
+ {
+ have_share_path = TRUE;
+ break;
+ }
+ }
+ g_strfreev (xdg_parts);
+
+ if (!have_share_path)
+ {
+ char *updated = g_strdup_printf ("%s%c%s", share_path,
+ G_SEARCHPATH_SEPARATOR,
+ xdg_data_dirs);
+ g_setenv ("XDG_DATA_DIRS", updated, TRUE);
+ g_free (updated);
+ }
+ }
+ else
+ {
+ g_setenv ("XDG_DATA_DIRS", share_path, TRUE);
+ }
+
schema_path = g_build_filename (base_path, "share", "glib-2.0", "schemas", NULL);
- if (g_file_test (schema_path, G_FILE_TEST_IS_DIR))
+ if (g_getenv ("GSETTINGS_SCHEMA_DIR") == NULL
+ && g_file_test (schema_path, G_FILE_TEST_IS_DIR))
g_setenv ("GSETTINGS_SCHEMA_DIR", schema_path, FALSE);
+ g_free (xdg_data_dirs);
+ g_free (share_path);
g_free (schema_path);
g_free (base_path);
}
+
+
+static void
+win32_configure_pixbuf_loaders (void)
+{
+ char *base_path;
+ char *pixbuf_root;
+ GDir *versions;
+ const gchar *entry;
+
+ base_path = g_win32_get_package_installation_directory_of_module (NULL);
+ if (!base_path)
+ return;
+
+ pixbuf_root = g_build_filename (base_path, "lib", "gdk-pixbuf-2.0", NULL);
+ if (!g_file_test (pixbuf_root, G_FILE_TEST_IS_DIR))
+ {
+ g_free (pixbuf_root);
+ g_free (base_path);
+ return;
+ }
+
+ versions = g_dir_open (pixbuf_root, 0, NULL);
+ if (versions)
+ {
+ while ((entry = g_dir_read_name (versions)) != NULL)
+ {
+ char *module_dir = g_build_filename (pixbuf_root, entry, "loaders", NULL);
+ char *module_file = g_build_filename (pixbuf_root, entry, "loaders.cache", NULL);
+
+ if (g_file_test (module_dir, G_FILE_TEST_IS_DIR))
+ g_setenv ("GDK_PIXBUF_MODULEDIR", module_dir, TRUE);
+ if (g_file_test (module_file, G_FILE_TEST_EXISTS))
+ g_setenv ("GDK_PIXBUF_MODULE_FILE", module_file, TRUE);
+
+ g_free (module_file);
+ g_free (module_dir);
+
+ if (g_getenv ("GDK_PIXBUF_MODULEDIR") != NULL)
+ break;
+ }
+ g_dir_close (versions);
+ }
+
+ g_free (pixbuf_root);
+ g_free (base_path);
+}
+
+static void
+win32_configure_icon_theme (void)
+{
+ GtkIconTheme *theme;
+ const char *env_icons_path;
+ char *base_path;
+ char *icons_path;
+ char *cwd_dir;
+ char *cwd_path;
+ char *argv0_icons_path;
+ const char *selected_source = NULL;
+ char *selected_path = NULL;
+
+ #define WIN32_SET_ICON_PATH(source_name, path_value) \
+ G_STMT_START { \
+ if ((path_value) != NULL && g_file_test ((path_value), G_FILE_TEST_IS_DIR)) \
+ { \
+ gtk_icon_theme_append_search_path (theme, (path_value)); \
+ if (selected_path == NULL) \
+ { \
+ selected_source = (source_name); \
+ selected_path = g_strdup (path_value); \
+ } \
+ } \
+ } G_STMT_END
+
+ theme = gtk_icon_theme_get_default ();
+ if (!theme)
+ return;
+
+ env_icons_path = g_getenv ("ZOITECHAT_ICON_PATH");
+ if (env_icons_path && *env_icons_path)
+ WIN32_SET_ICON_PATH ("ZOITECHAT_ICON_PATH", env_icons_path);
+
+ base_path = g_win32_get_package_installation_directory_of_module (NULL);
+ if (base_path)
+ {
+ icons_path = g_build_filename (base_path, "share", "icons", NULL);
+ WIN32_SET_ICON_PATH ("module base", icons_path);
+ g_free (icons_path);
+ }
+
+ cwd_dir = g_get_current_dir ();
+ cwd_path = g_build_filename (cwd_dir, "share", "icons", NULL);
+ WIN32_SET_ICON_PATH ("current working directory", cwd_path);
+ g_free (cwd_path);
+ g_free (cwd_dir);
+
+ if (win32_argv0_dir)
+ {
+ argv0_icons_path = g_build_filename (win32_argv0_dir, "share", "icons", NULL);
+ WIN32_SET_ICON_PATH ("argv[0] directory", argv0_icons_path);
+ g_free (argv0_icons_path);
+ }
+
+ if (selected_path)
+ g_message ("win32_configure_icon_theme: selected icon path (%s): %s", selected_source, selected_path);
+ else
+ g_message ("win32_configure_icon_theme: no usable icon path found (checked ZOITECHAT_ICON_PATH, module base/share/icons, cwd/share/icons, argv[0]/share/icons)");
+
+ g_free (selected_path);
+ g_free (base_path);
+
+ #undef WIN32_SET_ICON_PATH
+}
#endif
int
@@ -247,22 +398,17 @@ fe_args (int argc, char *argv[])
#ifdef WIN32
win32_set_gsettings_schema_dir ();
+ win32_configure_pixbuf_loaders ();
/* this is mainly for irc:// URL handling. When windows calls us from */
/* I.E, it doesn't give an option of "Start in" directory, like short */
/* cuts can. So we have to set the current dir manually, to the path */
/* of the exe. */
{
- char *tmp = g_strdup (argv[0]);
- char *sl;
-
- sl = strrchr (tmp, G_DIR_SEPARATOR);
- if (sl)
- {
- *sl = 0;
- chdir (tmp);
- }
- g_free (tmp);
+ g_free (win32_argv0_dir);
+ win32_argv0_dir = g_path_get_dirname (argv[0]);
+ if (win32_argv0_dir)
+ chdir (win32_argv0_dir);
}
#endif
@@ -272,6 +418,10 @@ fe_args (int argc, char *argv[])
#endif
gtk_init (&argc, &argv);
+#ifdef WIN32
+ win32_configure_icon_theme ();
+#endif
+
#ifdef HAVE_GTK_MAC
osx_app = g_object_new(GTKOSX_TYPE_APPLICATION, NULL);
#endif
diff --git a/src/fe-gtk/gtkutil.c b/src/fe-gtk/gtkutil.c
index 9aa64ec1..21e53573 100644
--- a/src/fe-gtk/gtkutil.c
+++ b/src/fe-gtk/gtkutil.c
@@ -62,6 +62,183 @@ struct file_req
int flags; /* FRF_* flags */
};
+#if HAVE_GTK3
+static const char *
+gtkutil_menu_custom_icon_from_stock (const char *stock_name)
+{
+ static const struct
+ {
+ const char *stock;
+ const char *custom_icon;
+ } icon_map[] = {
+ { "gtk-new", "zc-menu-new" },
+ { "gtk-index", "zc-menu-network-list" },
+ { "gtk-revert-to-saved", "zc-menu-load-plugin" },
+ { "gtk-redo", "zc-menu-detach" },
+ { "gtk-close", "zc-menu-close" },
+ { "gtk-quit", "zc-menu-quit" },
+ { "gtk-disconnect", "zc-menu-disconnect" },
+ { "gtk-connect", "zc-menu-connect" },
+ { "gtk-jump-to", "zc-menu-join" },
+ { "gtk-preferences", "zc-menu-preferences" },
+ { "gtk-clear", "zc-menu-clear" },
+ { "gtk-copy", "zc-menu-copy" },
+ { "gtk-delete", "zc-menu-delete" },
+ { "gtk-add", "zc-menu-add" },
+ { "gtk-remove", "zc-menu-remove" },
+ { "gtk-spell-check", "zc-menu-spell-check" },
+ { "gtk-save", "zc-menu-save" },
+ { "gtk-save-as", "zc-menu-save-as" },
+ { "gtk-refresh", "zc-menu-refresh" },
+ { "gtk-justify-left", "zc-menu-search" },
+ { "gtk-find", "zc-menu-find" },
+ { "gtk-go-back", "zc-menu-previous" },
+ { "gtk-go-forward", "zc-menu-next" },
+ { "gtk-help", "zc-menu-help" },
+ { "gtk-about", "zc-menu-about" },
+ { "gtk-convert", "zc-menu-emoji" },
+ };
+ size_t i;
+
+ if (!stock_name)
+ return NULL;
+
+ for (i = 0; i < G_N_ELEMENTS (icon_map); i++)
+ {
+ if (strcmp (stock_name, icon_map[i].stock) == 0)
+ return icon_map[i].custom_icon;
+ }
+
+ return NULL;
+}
+
+static const char *
+gtkutil_menu_custom_icon_from_icon_name (const char *icon_name)
+{
+ static const struct
+ {
+ const char *icon;
+ const char *custom_icon;
+ } icon_map[] = {
+ { "document-new", "zc-menu-new" },
+ { "view-list", "zc-menu-network-list" },
+ { "document-open", "zc-menu-load-plugin" },
+ { "edit-redo", "zc-menu-detach" },
+ { "window-close", "zc-menu-close" },
+ { "application-exit", "zc-menu-quit" },
+ { "network-disconnect", "zc-menu-disconnect" },
+ { "network-connect", "zc-menu-connect" },
+ { "go-jump", "zc-menu-join" },
+ { "preferences-system", "zc-menu-preferences" },
+ { "edit-clear", "zc-menu-clear" },
+ { "edit-copy", "zc-menu-copy" },
+ { "edit-delete", "zc-menu-delete" },
+ { "list-add", "zc-menu-add" },
+ { "list-remove", "zc-menu-remove" },
+ { "tools-check-spelling", "zc-menu-spell-check" },
+ { "document-save", "zc-menu-save" },
+ { "document-save-as", "zc-menu-save-as" },
+ { "view-refresh", "zc-menu-refresh" },
+ { "edit-find", "zc-menu-find" },
+ { "go-previous", "zc-menu-previous" },
+ { "go-next", "zc-menu-next" },
+ { "help-browser", "zc-menu-help" },
+ { "help-about", "zc-menu-about" },
+ { "face-smile", "zc-menu-emoji" },
+ { "insert-emoticon", "zc-menu-emoji" },
+ { "software-update-available", "zc-menu-update" },
+ { "network-workgroup", "zc-menu-chanlist" },
+ };
+ size_t i;
+
+ if (!icon_name)
+ return NULL;
+
+ for (i = 0; i < G_N_ELEMENTS (icon_map); i++)
+ {
+ if (strcmp (icon_name, icon_map[i].icon) == 0)
+ return icon_map[i].custom_icon;
+ }
+
+ return NULL;
+}
+#endif
+
+#if !HAVE_GTK3
+static const char *
+gtkutil_stock_from_menu_custom_icon (const char *custom_icon)
+{
+ static const struct
+ {
+ const char *custom_icon;
+ const char *stock;
+ } icon_map[] = {
+ { "zc-menu-new", GTK_STOCK_NEW },
+ { "zc-menu-network-list", GTK_STOCK_INDEX },
+ { "zc-menu-load-plugin", GTK_STOCK_REVERT_TO_SAVED },
+ { "zc-menu-detach", GTK_STOCK_REDO },
+ { "zc-menu-close", GTK_STOCK_CLOSE },
+ { "zc-menu-quit", GTK_STOCK_QUIT },
+ { "zc-menu-disconnect", GTK_STOCK_DISCONNECT },
+ { "zc-menu-connect", GTK_STOCK_CONNECT },
+ { "zc-menu-join", GTK_STOCK_JUMP_TO },
+ { "zc-menu-chanlist", GTK_STOCK_INDEX },
+ { "zc-menu-preferences", GTK_STOCK_PREFERENCES },
+ { "zc-menu-clear", GTK_STOCK_CLEAR },
+ { "zc-menu-copy", GTK_STOCK_COPY },
+ { "zc-menu-delete", GTK_STOCK_DELETE },
+ { "zc-menu-add", GTK_STOCK_ADD },
+ { "zc-menu-remove", GTK_STOCK_REMOVE },
+ { "zc-menu-spell-check", GTK_STOCK_SPELL_CHECK },
+ { "zc-menu-save", GTK_STOCK_SAVE },
+ { "zc-menu-save-as", GTK_STOCK_SAVE_AS },
+ { "zc-menu-refresh", GTK_STOCK_REFRESH },
+ { "zc-menu-search", GTK_STOCK_JUSTIFY_LEFT },
+ { "zc-menu-find", GTK_STOCK_FIND },
+ { "zc-menu-previous", GTK_STOCK_GO_BACK },
+ { "zc-menu-next", GTK_STOCK_GO_FORWARD },
+ { "zc-menu-help", GTK_STOCK_HELP },
+ { "zc-menu-about", GTK_STOCK_ABOUT },
+ { "zc-menu-emoji", GTK_STOCK_CONVERT },
+ { "zc-menu-update", GTK_STOCK_REFRESH },
+ };
+ size_t i;
+
+ if (!custom_icon)
+ return NULL;
+
+ for (i = 0; i < G_N_ELEMENTS (icon_map); i++)
+ {
+ if (strcmp (custom_icon, icon_map[i].custom_icon) == 0)
+ return icon_map[i].stock;
+ }
+
+ return custom_icon;
+}
+#endif
+
+static GdkPixbuf *
+gtkutil_menu_icon_pixbuf_new (const char *icon_name)
+{
+ GdkPixbuf *pixbuf = NULL;
+ char *resource_path;
+
+ if (!icon_name || !g_str_has_prefix (icon_name, "zc-menu-"))
+ return NULL;
+
+ resource_path = g_strdup_printf ("/icons/menu/light/%s.png", icon_name + strlen ("zc-menu-"));
+ pixbuf = gdk_pixbuf_new_from_resource (resource_path, NULL);
+ if (!pixbuf)
+ {
+ g_free (resource_path);
+ resource_path = g_strdup_printf ("/icons/menu/light/%s.svg", icon_name + strlen ("zc-menu-"));
+ pixbuf = gdk_pixbuf_new_from_resource (resource_path, NULL);
+ }
+ g_free (resource_path);
+
+ return pixbuf;
+}
+
#if HAVE_GTK3
const char *
gtkutil_icon_name_from_stock (const char *stock_name)
@@ -121,14 +298,129 @@ gtkutil_icon_name_from_stock (const char *stock_name)
}
#endif
+#if HAVE_GTK3
+static const char *
+gtkutil_menu_icon_theme_variant (void)
+{
+ GtkSettings *settings;
+ gboolean prefer_dark = FALSE;
+ char *theme_name = NULL;
+ char *theme_name_lower = NULL;
+ const char *theme_variant = "light";
+
+ settings = gtk_settings_get_default ();
+ if (settings)
+ {
+ g_object_get (G_OBJECT (settings), "gtk-application-prefer-dark-theme", &prefer_dark, NULL);
+ g_object_get (G_OBJECT (settings), "gtk-theme-name", &theme_name, NULL);
+ }
+
+ if (theme_name)
+ theme_name_lower = g_ascii_strdown (theme_name, -1);
+ if (prefer_dark || (theme_name_lower && g_strrstr (theme_name_lower, "dark")))
+ theme_variant = "dark";
+
+ g_free (theme_name_lower);
+ g_free (theme_name);
+
+ return theme_variant;
+}
+
+static GtkWidget *
+gtkutil_menu_icon_image_new (const char *icon_name, GtkIconSize size)
+{
+ GtkWidget *image = NULL;
+ GdkPixbuf *pixbuf = NULL;
+ char *resource_path;
+ const char *variant;
+
+ if (!icon_name || !g_str_has_prefix (icon_name, "zc-menu-"))
+ return NULL;
+
+ variant = gtkutil_menu_icon_theme_variant ();
+ resource_path = g_strdup_printf ("/icons/menu/%s/%s.png", variant, icon_name + strlen ("zc-menu-"));
+ if (!g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
+ {
+ g_free (resource_path);
+ resource_path = g_strdup_printf ("/icons/menu/light/%s.png", icon_name + strlen ("zc-menu-"));
+ }
+
+ pixbuf = gdk_pixbuf_new_from_resource (resource_path, NULL);
+ if (!pixbuf)
+ {
+ g_free (resource_path);
+ resource_path = g_strdup_printf ("/icons/menu/%s/%s.svg", variant, icon_name + strlen ("zc-menu-"));
+ if (!g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
+ {
+ g_free (resource_path);
+ resource_path = g_strdup_printf ("/icons/menu/light/%s.svg", icon_name + strlen ("zc-menu-"));
+ }
+ pixbuf = gdk_pixbuf_new_from_resource (resource_path, NULL);
+ }
+ if (pixbuf)
+ {
+ image = gtk_image_new_from_pixbuf (pixbuf);
+ g_object_unref (pixbuf);
+ }
+
+ g_free (resource_path);
+
+ if (image)
+ {
+ GtkIconSize tmp_size;
+ gint width;
+ gint height;
+
+ tmp_size = size;
+ if (gtk_icon_size_lookup (tmp_size, &width, &height))
+ gtk_image_set_pixel_size (GTK_IMAGE (image), MAX (width, height));
+ }
+
+ return image;
+}
+#endif
+
GtkWidget *
gtkutil_image_new_from_stock (const char *stock, GtkIconSize size)
{
#if HAVE_GTK3
- const char *icon_name = gtkutil_icon_name_from_stock (stock);
+ GtkWidget *image;
+ const char *icon_name;
+
+ icon_name = gtkutil_icon_name_from_stock (stock);
+ if (!icon_name && stock && g_str_has_prefix (stock, "zc-menu-"))
+ icon_name = stock;
+ if (size == GTK_ICON_SIZE_MENU)
+ {
+ const char *menu_icon_name = gtkutil_menu_custom_icon_from_stock (stock);
+
+ if (!menu_icon_name)
+ menu_icon_name = gtkutil_menu_custom_icon_from_icon_name (icon_name);
+
+ if (menu_icon_name)
+ icon_name = menu_icon_name;
+ }
+
+ image = gtkutil_menu_icon_image_new (icon_name, size);
+ if (image)
+ return image;
return gtk_image_new_from_icon_name (icon_name, size);
#elif !HAVE_GTK3
+ if (stock && g_str_has_prefix (stock, "zc-menu-"))
+ {
+ GdkPixbuf *pixbuf = gtkutil_menu_icon_pixbuf_new (stock);
+
+ if (pixbuf)
+ {
+ GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf);
+ g_object_unref (pixbuf);
+ return image;
+ }
+ }
+
+ if (stock && g_str_has_prefix (stock, "zc-menu-"))
+ stock = gtkutil_stock_from_menu_custom_icon (stock);
return gtk_image_new_from_stock (stock, size);
#endif
}
diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c
index ec5e6b6c..522bf769 100644
--- a/src/fe-gtk/maingui.c
+++ b/src/fe-gtk/maingui.c
@@ -61,10 +61,10 @@
#endif
#if HAVE_GTK3
-#define ICON_TAB_DETACH "edit-redo"
-#define ICON_TAB_CLOSE "window-close"
-#define ICON_TAB_PREVIOUS "go-previous"
-#define ICON_TAB_NEXT "go-next"
+#define ICON_TAB_DETACH "zc-menu-detach"
+#define ICON_TAB_CLOSE "zc-menu-close"
+#define ICON_TAB_PREVIOUS "zc-menu-previous"
+#define ICON_TAB_NEXT "zc-menu-next"
#define ICON_ENTRY_ERROR "dialog-error"
#endif
#if !HAVE_GTK3
@@ -95,10 +95,6 @@ enum
#define TAG_UTIL 1 /* dcc, notify, chanlist */
static void mg_apply_emoji_fallback_widget (GtkWidget *widget);
-static void mg_apply_emoji_primary_widget (GtkWidget *widget);
-static void mg_emoji_button_cb (GtkWidget *widget, session_gui *gui);
-static GtkWidget *mg_create_emoji_menu (session_gui *gui);
-static void mg_emoji_insert_cb (GtkMenuItem *item, session_gui *gui);
static inline void
mg_set_source_color (cairo_t *cr, const XTextColor *color)
@@ -3202,6 +3198,25 @@ static const char *mg_emoji_family_fallback =
"Noto Color Emoji, Segoe UI Emoji, Apple Color Emoji, Twemoji Mozilla, EmojiOne Color";
#endif
+static const char *
+mg_find_available_icon_name (const char *const *icon_names)
+{
+ GtkIconTheme *theme;
+ int i;
+
+ theme = gtk_icon_theme_get_default ();
+ if (!theme || !icon_names)
+ return NULL;
+
+ for (i = 0; icon_names[i] != NULL; i++)
+ {
+ if (gtk_icon_theme_has_icon (theme, icon_names[i]))
+ return icon_names[i];
+ }
+
+ return NULL;
+}
+
static gboolean
mg_family_already_has_emoji (const gchar *family)
{
@@ -3294,148 +3309,6 @@ mg_apply_emoji_fallback_widget (GtkWidget *widget)
pango_font_description_free (desc);
}
-static void
-mg_apply_emoji_primary_widget (GtkWidget *widget)
-{
- PangoFontDescription *desc;
-#if HAVE_GTK3
- GtkStyleContext *context;
- const PangoFontDescription *base_desc;
-#else
- GtkStyle *style;
-#endif
-
- if (!widget)
- return;
-
-#if HAVE_GTK3
- context = gtk_widget_get_style_context (widget);
- if (!context)
- return;
-
- base_desc = gtk_style_context_get_font (context, GTK_STATE_FLAG_NORMAL);
- if (!base_desc)
- return;
-
- desc = mg_fontdesc_with_fallback (base_desc, TRUE);
-#else
- style = gtk_widget_get_style (widget);
- if (!style || !style->font_desc)
- return;
-
- desc = mg_fontdesc_with_fallback (style->font_desc, TRUE);
-#endif
- if (!desc)
- return;
-
-#if HAVE_GTK3
- mg_apply_font_css (widget, desc, "zoitechat-emoji-font",
- "zoitechat-emoji-font-provider");
-#else
- gtk_widget_modify_font (widget, desc);
-#endif
- pango_font_description_free (desc);
-}
-
-static void
-mg_apply_emoji_primary_widget_with_child (GtkWidget *widget)
-{
- GtkWidget *child;
-
- if (!widget)
- return;
-
- mg_apply_emoji_primary_widget (widget);
- if (!GTK_IS_BIN (widget))
- return;
-
- child = gtk_bin_get_child (GTK_BIN (widget));
- if (child)
- mg_apply_emoji_primary_widget (child);
-}
-
-/* ------------------------------------------------------------------------- *
- * Emoji picker (optional UI sugar)
- * ------------------------------------------------------------------------- */
-
-static void
-mg_emoji_insert_cb (GtkMenuItem *item, session_gui *gui)
-{
- const char *emoji = g_object_get_data (G_OBJECT (item), "emoji");
- gint pos;
-
- if (!emoji || !gui || !gui->input_box)
- return;
-
- pos = SPELL_ENTRY_GET_POS (gui->input_box);
- gtk_editable_insert_text (GTK_EDITABLE (gui->input_box), emoji, -1, &pos);
- gtk_editable_set_position (GTK_EDITABLE (gui->input_box), pos);
- gtk_widget_grab_focus (gui->input_box);
-}
-
-static GtkWidget *
-mg_create_emoji_menu (session_gui *gui)
-{
- /* VS16 (emoji presentation). No, it does not need a space. */
-#define VS16 "\xEF\xB8\x8F"
- static const char *emoji_list[] = {
- "๐","๐","๐","๐","๐","๐","๐คฃ","๐","๐","๐","๐",
- "๐ฅฐ","๐","๐","๐คช","๐","๐คฉ","๐ค","๐คจ","๐","๐ถ","๐",
- "๐","๐ฃ","๐ฅ","๐ฎ","๐ฏ","๐ช","๐ด","๐","๐","๐ข",
- "๐ญ","๐ค","๐ ","๐ก","๐คฌ","๐ฅบ","๐ณ","๐ค","๐คญ","๐คซ",
- "๐ค","๐ท","๐ค","๐ค","๐คข","๐คฎ","๐ฅต","๐ฅถ","๐ฅด","๐คฏ",
- "๐"VS16,"๐"VS16,"๐"VS16,"๐"VS16,"๐"VS16,"๐ช"VS16,
- "๐"VS16,"๐ฏ"VS16,"โ
"VS16,"โ"VS16,"๐"VS16,"๐ฅ"VS16,
- "โค","๐","๐","๐","๐","๐","๐","๐งก","๐ค","๐ค",
- "โญ"VS16,"๐","โจ","โก"VS16,"โ","๐","โ"VS16,"๐",
- "๐","๐","๐ฃ","๐ฉ","๐","๐บ","๐ท","๐","๐","๐ฏ",
- "๐ต","๐ถ","๐ฎ","๐","โ","๐","๐","๐ฒ","๐ก","๐",
- NULL
- };
-#undef VS16
-
- GtkWidget *menu;
- const int columns = 8;
- int i;
-
- menu = gtk_menu_new ();
-
- for (i = 0; emoji_list[i]; i++)
- {
- GtkWidget *item = gtk_menu_item_new_with_label (emoji_list[i]);
- int row = i / columns;
- int col = i % columns;
-
- g_object_set_data_full (G_OBJECT (item), "emoji", g_strdup (emoji_list[i]), g_free);
- g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (mg_emoji_insert_cb), gui);
-
- /* Prefer emoji fonts for the label itself */
- mg_apply_emoji_primary_widget_with_child (item);
-
- gtk_menu_attach (GTK_MENU (menu), item, col, col + 1, row, row + 1);
- gtk_widget_show (item);
- }
-
- g_signal_connect (G_OBJECT (menu), "selection-done", G_CALLBACK (gtk_widget_destroy), NULL);
- return menu;
-}
-
-static void
-mg_emoji_button_cb (GtkWidget *widget, session_gui *gui)
-{
- GtkWidget *menu;
-
- menu = mg_create_emoji_menu (gui);
-#if HAVE_GTK3
- gtk_menu_popup_at_widget (GTK_MENU (menu), widget,
- GDK_GRAVITY_SOUTH_WEST,
- GDK_GRAVITY_NORTH_WEST,
- NULL);
-#else
- gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time ());
-#endif
-}
-
/* Search bar adapted from Conspire's by William Pitcock */
#define SEARCH_CHANGE 1
@@ -3591,7 +3464,7 @@ mg_create_search(session *sess, GtkWidget *box)
close = gtk_button_new ();
#if HAVE_GTK3
- gtk_button_set_image (GTK_BUTTON (close), gtk_image_new_from_icon_name (ICON_TAB_CLOSE, GTK_ICON_SIZE_MENU));
+ gtk_button_set_image (GTK_BUTTON (close), gtkutil_image_new_from_stock (ICON_TAB_CLOSE, GTK_ICON_SIZE_MENU));
#endif
#if !HAVE_GTK3
gtk_button_set_image (GTK_BUTTON (close), gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU));
@@ -3616,7 +3489,7 @@ mg_create_search(session *sess, GtkWidget *box)
previous = gtk_button_new ();
#if HAVE_GTK3
- gtk_button_set_image (GTK_BUTTON (previous), gtk_image_new_from_icon_name (ICON_TAB_PREVIOUS, GTK_ICON_SIZE_MENU));
+ gtk_button_set_image (GTK_BUTTON (previous), gtkutil_image_new_from_stock (ICON_TAB_PREVIOUS, GTK_ICON_SIZE_MENU));
#endif
#if !HAVE_GTK3
gtk_button_set_image (GTK_BUTTON (previous), gtk_image_new_from_stock (GTK_STOCK_GO_BACK, GTK_ICON_SIZE_MENU));
@@ -3628,7 +3501,7 @@ mg_create_search(session *sess, GtkWidget *box)
next = gtk_button_new ();
#if HAVE_GTK3
- gtk_button_set_image (GTK_BUTTON (next), gtk_image_new_from_icon_name (ICON_TAB_NEXT, GTK_ICON_SIZE_MENU));
+ gtk_button_set_image (GTK_BUTTON (next), gtkutil_image_new_from_stock (ICON_TAB_NEXT, GTK_ICON_SIZE_MENU));
#endif
#if !HAVE_GTK3
gtk_button_set_image (GTK_BUTTON (next), gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_MENU));
@@ -3664,8 +3537,19 @@ mg_create_search(session *sess, GtkWidget *box)
static void
mg_create_entry (session *sess, GtkWidget *box)
{
- GtkWidget *hbox, *but, *entry, *emoji_button;
+ GtkWidget *hbox, *but, *entry;
session_gui *gui = sess->gui;
+#if HAVE_GTK3
+ const char *emoji_fallback_icon_names[] = {
+ "face-smile-symbolic",
+ "face-smile",
+ "insert-emoticon-symbolic",
+ "insert-emoticon",
+ "zc-menu-emoji",
+ NULL
+ };
+ const char *emoji_fallback_icon_name;
+#endif
hbox = mg_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), hbox, 0, 0, 0);
@@ -3705,14 +3589,16 @@ mg_create_entry (session *sess, GtkWidget *box)
if (prefs.hex_gui_input_style)
mg_apply_entry_style (entry);
- /* Optional emoji button (kept since you already added it) */
- emoji_button = gtk_button_new_with_label ("๐");
- gtk_button_set_relief (GTK_BUTTON (emoji_button), GTK_RELIEF_NONE);
- gtk_widget_set_can_focus (emoji_button, FALSE);
- gtk_widget_set_tooltip_text (emoji_button, _("Insert emoji"));
- mg_apply_emoji_primary_widget_with_child (emoji_button);
- g_signal_connect (G_OBJECT (emoji_button), "clicked", G_CALLBACK (mg_emoji_button_cb), gui);
- gtk_box_pack_start (GTK_BOX (hbox), emoji_button, FALSE, FALSE, 4);
+#if HAVE_GTK3
+ g_object_set (G_OBJECT (entry), "show-emoji-icon", TRUE, NULL);
+
+ if (gtk_entry_get_icon_storage_type (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY)
+ {
+ emoji_fallback_icon_name = mg_find_available_icon_name (emoji_fallback_icon_names);
+ if (emoji_fallback_icon_name)
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY, emoji_fallback_icon_name);
+ }
+#endif
}
static void
diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c
index 4f649445..3c1275b9 100644
--- a/src/fe-gtk/menu.c
+++ b/src/fe-gtk/menu.c
@@ -65,6 +65,78 @@
static GSList *submenu_list;
+static gboolean
+menu_icon_exists_in_resource (const char *icon_name)
+{
+ char *resource_path;
+ gboolean found;
+
+ if (!icon_name || !g_str_has_prefix (icon_name, "zc-menu-"))
+ return FALSE;
+
+ resource_path = g_strdup_printf ("/icons/menu/light/%s.png", icon_name + strlen ("zc-menu-"));
+ found = g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL);
+ if (!found)
+ {
+ g_free (resource_path);
+ resource_path = g_strdup_printf ("/icons/menu/light/%s.svg", icon_name + strlen ("zc-menu-"));
+ found = g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL);
+ }
+ g_free (resource_path);
+
+ return found;
+}
+
+static GtkWidget *
+menu_icon_widget_new (const char *icon)
+{
+ GtkWidget *img = NULL;
+ char *path;
+
+ if (!icon)
+ return NULL;
+
+ if (access (icon, R_OK) == 0)
+ return gtk_image_new_from_file (icon);
+
+ path = g_build_filename (get_xdir (), icon, NULL);
+ if (access (path, R_OK) == 0)
+ {
+ img = gtk_image_new_from_file (path);
+ }
+ else if (g_str_has_prefix (icon, "zc-menu-") || g_str_has_prefix (icon, "gtk-"))
+ {
+ img = gtkutil_image_new_from_stock (icon, GTK_ICON_SIZE_MENU);
+ }
+ else
+ {
+ char *menu_icon_name = g_strdup_printf ("zc-menu-%s", icon);
+
+ if (menu_icon_exists_in_resource (menu_icon_name))
+ img = gtkutil_image_new_from_stock (menu_icon_name, GTK_ICON_SIZE_MENU);
+ else
+ img = gtkutil_image_new_from_stock (icon, GTK_ICON_SIZE_MENU);
+
+ g_free (menu_icon_name);
+ }
+
+ g_free (path);
+
+ return img;
+}
+
+static GtkWidget *
+menu_new (void)
+{
+ GtkWidget *menu = gtk_menu_new ();
+
+#if HAVE_GTK3
+ gtk_menu_set_reserve_toggle_size (GTK_MENU (menu), FALSE);
+#endif
+
+ return menu;
+}
+
enum
{
M_MENUITEM,
@@ -266,9 +338,7 @@ menu_quick_item (char *cmd, char *label, GtkWidget * menu, int flags,
gpointer userdata, char *icon)
{
GtkWidget *img, *item;
- char *path;
#if HAVE_GTK3
- const char *icon_name = NULL;
GtkWidget *box;
GtkWidget *image = NULL;
GtkWidget *label_widget;
@@ -283,35 +353,12 @@ menu_quick_item (char *cmd, char *label, GtkWidget * menu, int flags,
/*if (flags & XCMENU_MARKUP)
item = gtk_image_menu_item_new_with_markup (label);
else*/
- img = NULL;
- if (access (icon, R_OK) == 0) /* try fullpath */
- img = gtk_image_new_from_file (icon);
- else
- {
- /* try relative to */
- path = g_build_filename (get_xdir (), icon, NULL);
- if (access (path, R_OK) == 0)
- img = gtk_image_new_from_file (path);
- else
- {
-#if HAVE_GTK3
- icon_name = gtkutil_icon_name_from_stock (icon);
- if (!icon_name)
- icon_name = icon;
-#endif
-#if !HAVE_GTK3
- img = gtk_image_new_from_stock (icon, GTK_ICON_SIZE_MENU);
-#endif
- }
- g_free (path);
- }
+ img = menu_icon_widget_new (icon);
#if HAVE_GTK3
item = gtk_menu_item_new ();
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
- if (icon_name)
- image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
- else if (img)
+ if (img)
image = img;
label_widget = gtk_label_new_with_mnemonic (label);
if (image)
@@ -388,7 +435,7 @@ menu_quick_sub (char *name, GtkWidget *menu, GtkWidget **sub_item_ret, int flags
return menu;
/* Code to add a submenu */
- sub_menu = gtk_menu_new ();
+ sub_menu = menu_new ();
if (flags & XCMENU_MARKUP)
{
sub_item = gtk_menu_item_new_with_label ("");
@@ -805,7 +852,7 @@ menu_nickmenu (session *sess, GdkEventButton *event, char *nick, int num_sel)
{
char buf[512];
struct User *user;
- GtkWidget *submenu, *menu = gtk_menu_new ();
+ GtkWidget *submenu, *menu = menu_new ();
g_free (str_copy);
str_copy = g_strdup (nick);
@@ -1040,7 +1087,7 @@ menu_urlmenu (GdkEventButton *event, char *url)
g_free (str_copy);
str_copy = g_strdup (url);
- menu = gtk_menu_new ();
+ menu = menu_new ();
/* more than 51 chars? Chop it */
if (g_utf8_strlen (str_copy, -1) >= 52)
{
@@ -1132,7 +1179,7 @@ menu_chanmenu (struct session *sess, GdkEventButton * event, char *chan)
g_free (str_copy);
str_copy = g_strdup (chan);
- menu = gtk_menu_new ();
+ menu = menu_new ();
menu_quick_item (0, chan, menu, XCMENU_SHADED, str_copy, 0);
menu_quick_item (0, 0, menu, XCMENU_SHADED, str_copy, 0);
@@ -1950,46 +1997,28 @@ menu_about (GtkWidget *wid, gpointer sess)
gtk_widget_show_all (GTK_WIDGET(dialog));
}
-#if HAVE_GTK3
-#define ICON_NEW "document-new"
-#define ICON_LOAD_PLUGIN "document-open"
-#define ICON_DETACH "edit-redo"
-#define ICON_CLOSE "window-close"
-#define ICON_QUIT "application-exit"
-#define ICON_DISCONNECT "network-disconnect"
-#define ICON_CONNECT "network-connect"
-#define ICON_JOIN "go-jump"
-#define ICON_CHANLIST "view-list"
-#define ICON_PREFERENCES "preferences-system"
-#define ICON_CLEAR "edit-clear"
-#define ICON_SAVE "document-save"
-#define ICON_SEARCH "edit-find"
-#define ICON_FIND "edit-find"
-#define ICON_HELP "help-contents"
-#define ICON_ABOUT "help-about"
-#endif
-#if !HAVE_GTK3
-#define ICON_NEW GTK_STOCK_NEW
-#define ICON_LOAD_PLUGIN GTK_STOCK_REVERT_TO_SAVED
-#define ICON_DETACH GTK_STOCK_REDO
-#define ICON_CLOSE GTK_STOCK_CLOSE
-#define ICON_QUIT GTK_STOCK_QUIT
-#define ICON_DISCONNECT GTK_STOCK_DISCONNECT
-#define ICON_CONNECT GTK_STOCK_CONNECT
-#define ICON_JOIN GTK_STOCK_JUMP_TO
-#define ICON_CHANLIST GTK_STOCK_INDEX
-#define ICON_PREFERENCES GTK_STOCK_PREFERENCES
-#define ICON_CLEAR GTK_STOCK_CLEAR
-#define ICON_SAVE GTK_STOCK_SAVE
-#define ICON_SEARCH GTK_STOCK_JUSTIFY_LEFT
-#define ICON_FIND GTK_STOCK_FIND
-#define ICON_HELP GTK_STOCK_HELP
-#define ICON_ABOUT GTK_STOCK_ABOUT
-#endif
+#define ICON_NEW "zc-menu-new"
+#define ICON_NETWORK_LIST "zc-menu-network-list"
+#define ICON_LOAD_PLUGIN "zc-menu-load-plugin"
+#define ICON_DETACH "zc-menu-detach"
+#define ICON_CLOSE "zc-menu-close"
+#define ICON_QUIT "zc-menu-quit"
+#define ICON_DISCONNECT "zc-menu-disconnect"
+#define ICON_CONNECT "zc-menu-connect"
+#define ICON_JOIN "zc-menu-join"
+#define ICON_CHANLIST "zc-menu-chanlist"
+#define ICON_PREFERENCES "zc-menu-preferences"
+#define ICON_CLEAR "zc-menu-clear"
+#define ICON_SAVE "zc-menu-save"
+#define ICON_SEARCH "zc-menu-search"
+#define ICON_FIND "zc-menu-find"
+#define ICON_HELP "zc-menu-help"
+#define ICON_ABOUT "zc-menu-about"
+#define ICON_UPDATE "zc-menu-update"
static struct mymenu mymenu[] = {
{N_("_ZoiteChat"), 0, 0, M_NEWMENU, MENU_ID_ZOITECHAT, 0, 1},
- {N_("Network Li_st"), menu_open_server_list, (char *)&pix_book, M_MENUPIX, 0, 0, 1, GDK_KEY_s},
+ {N_("Network Li_st"), menu_open_server_list, ICON_NETWORK_LIST, M_MENUSTOCK, 0, 0, 1, GDK_KEY_s},
{0, 0, 0, M_SEP, 0, 0, 0},
{N_("_New"), 0, ICON_NEW, M_MENUSUB, 0, 0, 1},
@@ -2036,7 +2065,7 @@ static struct mymenu mymenu[] = {
{N_("_Disconnect"), menu_disconnect, ICON_DISCONNECT, M_MENUSTOCK, MENU_ID_DISCONNECT, 0, 1},
{N_("_Reconnect"), menu_reconnect, ICON_CONNECT, M_MENUSTOCK, MENU_ID_RECONNECT, 0, 1},
{N_("_Join a Channel" ELLIPSIS), menu_join, ICON_JOIN, M_MENUSTOCK, MENU_ID_JOIN, 0, 1},
- {N_("Channel _List"), menu_chanlist, ICON_CHANLIST, M_MENUITEM, 0, 0, 1},
+ {N_("Channel _List"), menu_chanlist, ICON_CHANLIST, M_MENUSTOCK, 0, 0, 1},
{0, 0, 0, M_SEP, 0, 0, 0},
#define AWAY_OFFSET (41)
{N_("Marked _Away"), menu_away, 0, M_MENUTOG, MENU_ID_AWAY, 0, 1, GDK_KEY_a},
@@ -2081,6 +2110,7 @@ static struct mymenu mymenu[] = {
{N_("_Help"), 0, 0, M_NEWMENU, 0, 0, 1}, /* 74 */
{N_("_Contents"), menu_docs, ICON_HELP, M_MENUSTOCK, 0, 0, 1, GDK_KEY_F1},
+ {N_("_Update"), menu_docs, ICON_UPDATE, M_MENUSTOCK, 0, 0, 1},
{N_("_About"), menu_about, ICON_ABOUT, M_MENUSTOCK, 0, 0, 1},
{0, 0, 0, M_END, 0, 0, 0},
@@ -2110,48 +2140,30 @@ GtkWidget *
create_icon_menu (char *labeltext, void *stock_name, int is_stock)
{
GtkWidget *item;
+ GtkWidget *img = NULL;
#if HAVE_GTK3
GtkWidget *box;
GtkWidget *label_widget;
- GtkWidget *image = NULL;
- const char *icon_name;
-#endif
-#if !HAVE_GTK3
- GtkWidget *img;
#endif
if (is_stock)
{
-#if HAVE_GTK3
- icon_name = gtkutil_icon_name_from_stock (stock_name);
- if (!icon_name)
- icon_name = stock_name;
- if (icon_name)
- image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
-#endif
-#if !HAVE_GTK3
- img = gtk_image_new_from_stock (stock_name, GTK_ICON_SIZE_MENU);
-#endif
+ img = gtkutil_image_new_from_stock (stock_name, GTK_ICON_SIZE_MENU);
}
else
{
-#if HAVE_GTK3
- image = gtk_image_new_from_pixbuf (*((GdkPixbuf **)stock_name));
-#endif
-#if !HAVE_GTK3
img = gtk_image_new_from_pixbuf (*((GdkPixbuf **)stock_name));
-#endif
}
#if HAVE_GTK3
item = gtk_menu_item_new ();
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
label_widget = gtk_label_new_with_mnemonic (labeltext);
- if (image)
- gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
+ if (img)
+ gtk_box_pack_start (GTK_BOX (box), img, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), label_widget, FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (item), box);
- if (image)
- gtk_widget_show (image);
+ if (img)
+ gtk_widget_show (img);
gtk_widget_show (label_widget);
gtk_widget_show (box);
#else
@@ -2623,7 +2635,7 @@ menu_create_main (void *accel_group, int bar, int away, int toplevel,
#endif
}
else
- menu_bar = gtk_menu_new ();
+ menu_bar = menu_new ();
/* /MENU needs to know this later */
g_object_set_data (G_OBJECT (menu_bar), "accel", accel_group);
@@ -2719,7 +2731,7 @@ menu_create_main (void *accel_group, int bar, int away, int toplevel,
case M_NEWMENU:
if (menu)
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), menu);
- item = menu = gtk_menu_new ();
+ item = menu = menu_new ();
if (mymenu[i].id == MENU_ID_USERMENU)
usermenu = menu;
menu_item = gtk_menu_item_new_with_mnemonic (_(mymenu[i].text));
@@ -2805,7 +2817,7 @@ togitem:
case M_MENUSUB:
group = NULL;
- submenu = gtk_menu_new ();
+ submenu = menu_new ();
item = create_icon_menu (_(mymenu[i].text), mymenu[i].image, TRUE);
/* record the English name for /menu */
g_object_set_data (G_OBJECT (item), "name", mymenu[i].text);
diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c
index 9aa7104e..ff83f0e0 100644
--- a/src/fe-gtk/plugin-tray.c
+++ b/src/fe-gtk/plugin-tray.c
@@ -43,13 +43,11 @@ typedef struct _GtkStatusIcon GtkStatusIcon;
#include
#endif
#endif
-#define ICON_TRAY_PREFERENCES "preferences-system"
-#define ICON_TRAY_QUIT "application-exit"
-#else
-#define ICON_TRAY_PREFERENCES GTK_STOCK_PREFERENCES
-#define ICON_TRAY_QUIT GTK_STOCK_QUIT
#endif
+#define ICON_TRAY_PREFERENCES "zc-menu-preferences"
+#define ICON_TRAY_QUIT "zc-menu-quit"
+
#ifndef WIN32
#include
#endif
diff --git a/src/fe-gtk/plugingui.c b/src/fe-gtk/plugingui.c
index 9d739a66..d12f9df7 100644
--- a/src/fe-gtk/plugingui.c
+++ b/src/fe-gtk/plugingui.c
@@ -64,16 +64,9 @@ plugingui_get_target_session (void)
return NULL;
}
-#if HAVE_GTK3
-#define ICON_PLUGIN_LOAD "document-open"
-#define ICON_PLUGIN_UNLOAD "edit-delete"
-#define ICON_PLUGIN_RELOAD "view-refresh"
-#endif
-#if !HAVE_GTK3
-#define ICON_PLUGIN_LOAD GTK_STOCK_REVERT_TO_SAVED
-#define ICON_PLUGIN_UNLOAD GTK_STOCK_DELETE
-#define ICON_PLUGIN_RELOAD GTK_STOCK_REFRESH
-#endif
+#define ICON_PLUGIN_LOAD "zc-menu-load-plugin"
+#define ICON_PLUGIN_UNLOAD "zc-menu-delete"
+#define ICON_PLUGIN_RELOAD "zc-menu-refresh"
#if HAVE_GTK3
static GtkWidget *
@@ -85,7 +78,7 @@ plugingui_icon_button (GtkWidget *box, const char *label,
GtkWidget *image;
button = gtk_button_new_with_mnemonic (label);
- image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
+ image = gtkutil_image_new_from_stock (icon_name, GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (button), image);
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
gtk_container_add (GTK_CONTAINER (box), button);
diff --git a/src/fe-gtk/rawlog.c b/src/fe-gtk/rawlog.c
index 89174cd2..7a3438cf 100644
--- a/src/fe-gtk/rawlog.c
+++ b/src/fe-gtk/rawlog.c
@@ -43,8 +43,8 @@
#include "fkeys.h"
#if HAVE_GTK3
-#define ICON_RAWLOG_CLEAR "edit-clear"
-#define ICON_RAWLOG_SAVE_AS "document-save-as"
+#define ICON_RAWLOG_CLEAR "zc-menu-clear"
+#define ICON_RAWLOG_SAVE_AS "zc-menu-save-as"
#endif
#if !HAVE_GTK3
#define ICON_RAWLOG_CLEAR GTK_STOCK_CLEAR
diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c
index 2a014be6..230238f7 100644
--- a/src/fe-gtk/servlistgui.c
+++ b/src/fe-gtk/servlistgui.c
@@ -40,7 +40,7 @@
#define SERVLIST_Y_PADDING 0 /* vertical padding in the network editor */
#if HAVE_GTK3
-#define ICON_SERVLIST_CONNECT "network-connect"
+#define ICON_SERVLIST_CONNECT "zc-menu-connect"
#define ICON_SERVLIST_ADD "list-add"
#define ICON_SERVLIST_REMOVE "list-remove"
#define ICON_SERVLIST_CLOSE "window-close"
diff --git a/src/fe-gtk/sexy-spell-entry.c b/src/fe-gtk/sexy-spell-entry.c
index 74a1ff8e..c94e1d13 100644
--- a/src/fe-gtk/sexy-spell-entry.c
+++ b/src/fe-gtk/sexy-spell-entry.c
@@ -59,16 +59,9 @@
#endif
#endif
-#if HAVE_GTK3
-#define ICON_ADD "list-add"
-#define ICON_REMOVE "list-remove"
-#define ICON_SPELL_CHECK "tools-check-spelling"
-#endif
-#if !HAVE_GTK3
-#define ICON_ADD GTK_STOCK_ADD
-#define ICON_REMOVE GTK_STOCK_REMOVE
-#define ICON_SPELL_CHECK GTK_STOCK_SPELL_CHECK
-#endif
+#define ICON_ADD "zc-menu-add"
+#define ICON_REMOVE "zc-menu-remove"
+#define ICON_SPELL_CHECK "zc-menu-spell-check"
/*
* Bunch of poop to make enchant into a runtime dependency rather than a
@@ -737,7 +730,7 @@ sexy_spell_entry_icon_menu_item (const char *label, const char *stock_name)
item = gtk_menu_item_new ();
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
if (icon_name)
- image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
+ image = gtkutil_image_new_from_stock (icon_name, GTK_ICON_SIZE_MENU);
label_widget = gtk_label_new_with_mnemonic (label);
if (image)
gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
@@ -747,7 +740,7 @@ sexy_spell_entry_icon_menu_item (const char *label, const char *stock_name)
GtkWidget *image;
item = gtk_image_menu_item_new_with_label (label);
- image = gtk_image_new_from_stock (stock_name, GTK_ICON_SIZE_MENU);
+ image = gtkutil_image_new_from_stock (stock_name, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
#endif
diff --git a/src/fe-gtk/urlgrab.c b/src/fe-gtk/urlgrab.c
index 6e481924..3b919ef5 100644
--- a/src/fe-gtk/urlgrab.c
+++ b/src/fe-gtk/urlgrab.c
@@ -34,9 +34,9 @@
#include "urlgrab.h"
#if HAVE_GTK3
-#define ICON_URLGRAB_CLEAR "edit-clear"
-#define ICON_URLGRAB_COPY "edit-copy"
-#define ICON_URLGRAB_SAVE_AS "document-save-as"
+#define ICON_URLGRAB_CLEAR "zc-menu-clear"
+#define ICON_URLGRAB_COPY "zc-menu-copy"
+#define ICON_URLGRAB_SAVE_AS "zc-menu-save-as"
#endif
#if !HAVE_GTK3
#define ICON_URLGRAB_CLEAR GTK_STOCK_CLEAR
diff --git a/win32/copy/copy.vcxproj b/win32/copy/copy.vcxproj
index 3053ba91..241dab13 100644
--- a/win32/copy/copy.vcxproj
+++ b/win32/copy/copy.vcxproj
@@ -67,6 +67,7 @@
+
@@ -82,10 +83,14 @@
+
+
+
+
@@ -94,8 +99,12 @@
+
+
+
+
@@ -113,6 +122,3 @@
-
-
-
diff --git a/win32/copy/share/adwaita-icons-attribution.txt b/win32/copy/share/adwaita-icons-attribution.txt
new file mode 100644
index 00000000..65e51d24
--- /dev/null
+++ b/win32/copy/share/adwaita-icons-attribution.txt
@@ -0,0 +1,7 @@
+Adwaita Icons Attribution
+=========================
+
+This package includes icons from Adwaita.
+Artwork attribution: GNOME Project.
+
+Website: http://www.gnome.org
diff --git a/win32/installer/zoitechat.iss.tt b/win32/installer/zoitechat.iss.tt
index c06df2e4..5bfc4275 100644
--- a/win32/installer/zoitechat.iss.tt
+++ b/win32/installer/zoitechat.iss.tt
@@ -113,6 +113,7 @@ Source: "readme.url"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "cert.pem"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "share\xml\*"; DestDir: "{app}\share\xml"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs
Source: "share\doc\*"; DestDir: "{app}\share\doc"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs
+Source: "share\icons\*"; DestDir: "{app}\share\icons"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs
Source: "share\themes\MS-Windows\*"; DestDir: "{app}\share\themes\MS-Windows"; Flags: ignoreversion createallsubdirs recursesubdirs skipifsourcedoesntexist; Components: libs
Source: "share\glib-2.0\schemas\*"; DestDir: "{app}\share\glib-2.0\schemas"; Flags: ignoreversion createallsubdirs recursesubdirs skipifsourcedoesntexist; Components: libs
Source: "share\locale\*"; DestDir: "{app}\share\locale"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: translations