summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian.dywan@canonical.com>2015-08-16 13:27:46 -0400
committerChristian Dywan <christian.dywan@canonical.com>2015-08-16 13:27:46 -0400
commit207d5fed3f5c2765e72c2dd15a4bb4c50fb11bb4 (patch)
treea1fdabf3114b123beeb5dfa5bec6ab2962d972a7
parentf9088858d8043279588b3c196424f2cabfdbdbba (diff)
downloadmidori-207d5fed3f5c2765e72c2dd15a4bb4c50fb11bb4.tar.gz
Add fake theme for built-in icons
-rw-r--r--icons/24x24/status/adblock-blocked.svg (renamed from icons/24x24/adblock-blocked.svg)0
-rw-r--r--icons/24x24/status/adblock-disabled.svg (renamed from icons/24x24/adblock-disabled.svg)0
-rw-r--r--icons/24x24/status/adblock-enabled.svg (renamed from icons/24x24/adblock-enabled.svg)0
-rw-r--r--icons/icon-theme.cachebin0 -> 412 bytes
-rw-r--r--icons/index.theme12
-rw-r--r--katze/midori-paths.vala9
6 files changed, 20 insertions, 1 deletions
diff --git a/icons/24x24/adblock-blocked.svg b/icons/24x24/status/adblock-blocked.svg
index 5f734ecc..5f734ecc 100644
--- a/icons/24x24/adblock-blocked.svg
+++ b/icons/24x24/status/adblock-blocked.svg
diff --git a/icons/24x24/adblock-disabled.svg b/icons/24x24/status/adblock-disabled.svg
index 4228e75b..4228e75b 100644
--- a/icons/24x24/adblock-disabled.svg
+++ b/icons/24x24/status/adblock-disabled.svg
diff --git a/icons/24x24/adblock-enabled.svg b/icons/24x24/status/adblock-enabled.svg
index d626be38..d626be38 100644
--- a/icons/24x24/adblock-enabled.svg
+++ b/icons/24x24/status/adblock-enabled.svg
diff --git a/icons/icon-theme.cache b/icons/icon-theme.cache
new file mode 100644
index 00000000..47cd3923
--- /dev/null
+++ b/icons/icon-theme.cache
Binary files differ
diff --git a/icons/index.theme b/icons/index.theme
new file mode 100644
index 00000000..3d47231f
--- /dev/null
+++ b/icons/index.theme
@@ -0,0 +1,12 @@
+[Icon Theme]
+Name=Midori
+Comment=Fallback Icons shipped with Midori
+Inherits=hicolor
+Example=midori
+Directories=status/24,
+
+[status/24]
+Size=24
+Context=Status
+Type=Fixed
+
diff --git a/katze/midori-paths.vala b/katze/midori-paths.vala
index fc427e45..10a3a0bc 100644
--- a/katze/midori-paths.vala
+++ b/katze/midori-paths.vala
@@ -184,6 +184,11 @@ namespace Midori {
#endif
}
+ #if !HAVE_WIN32
+ string builtin_path = build_folder ("icons", null, "index.theme", true);
+ Gtk.IconTheme.get_default ().append_search_path (builtin_path);
+ #endif
+
if (strcmp (Environment.get_variable ("MIDORI_DEBUG"), "paths") == 0) {
stdout.printf ("config: %s\ncache: %s\nuser_data: %s\ntmp: %s\n",
config_dir, cache_dir, user_data_dir, tmp_dir);
@@ -387,7 +392,7 @@ namespace Midori {
}
#if !HAVE_WIN32
- string? build_folder (string folder, string? middle, string filename) {
+ string? build_folder (string folder, string? middle, string filename, bool folder_only=false) {
/* Fallback to build folder */
File? parent = File.new_for_path (exec_path);
while (parent != null) {
@@ -395,6 +400,8 @@ namespace Midori {
if (middle != null)
data = data.get_child (middle);
var child = data.get_child (filename);
+ if (folder_only && child.query_exists ())
+ return data.get_path ();
if (child.query_exists ())
return child.get_path ();
parent = parent.get_parent ();