diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-06-07 20:28:35 +0200 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-06-07 20:28:35 +0200 |
commit | 6cccec4508d6b0290e04716459db6a5790b2a072 (patch) | |
tree | 930f6545d21e96e941b2eed6fe1a0a333af0dd58 | |
parent | d1bbcb3d7e6285f48424df299f2330fdcf440f37 (diff) |
make icon setting configurable
-rw-r--r-- | examples/configs/sampleconfig | 1 | ||||
-rw-r--r-- | examples/configs/sampleconfig-dev | 2 | ||||
-rw-r--r-- | uzbl.c | 15 | ||||
-rw-r--r-- | uzbl.h | 4 |
4 files changed, 18 insertions, 4 deletions
diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig index 5daa21c..736b49f 100644 --- a/examples/configs/sampleconfig +++ b/examples/configs/sampleconfig @@ -119,6 +119,7 @@ bind fl* = script /usr/share/uzbl/examples/scripts/follow_Numbers.js %s # using strings, not polished yet: bind fL* = script /usr/share/uzbl/examples/scripts/follow_Numbers_Strings.js %s +set icon = /usr/share/uzbl/uzbl.png # "home" page if you will set uri = uzbl.org diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev index 03310b4..0aa0985 100644 --- a/examples/configs/sampleconfig-dev +++ b/examples/configs/sampleconfig-dev @@ -171,5 +171,7 @@ bind fL* = script ./examples/scripts/follow_Numbers_Strings.js %s # you can use this to disable all plugins set disable_plugins = 0 +set icon = ./uzbl.png + # "home" page if you will set uri = uzbl.org @@ -114,6 +114,7 @@ const struct { { "command_indicator", PTR(uzbl.behave.cmd_indicator, STR, 1, update_title)}, { "title_format_long", PTR(uzbl.behave.title_format_long, STR, 1, update_title)}, { "title_format_short", PTR(uzbl.behave.title_format_short, STR, 1, update_title)}, + { "icon", PTR(uzbl.gui.icon, STR, 1, set_icon)}, { "insert_mode", PTR(uzbl.behave.insert_mode, INT, 1, NULL)}, { "always_insert_mode", PTR(uzbl.behave.always_insert_mode, INT, 1, cmd_always_insert_mode)}, { "reset_command_mode", PTR(uzbl.behave.reset_command_mode, INT, 1, NULL)}, @@ -1312,6 +1313,16 @@ set_proxy_url() { } static void +set_icon() { + if(file_exists(uzbl.gui.icon)) { + gtk_window_set_icon_from_file (GTK_WINDOW (uzbl.gui.main_window), uzbl.gui.icon, NULL); + } else { + g_printerr ("Icon \"%s\" not found. ignoring.\n", uzbl.gui.icon); + } + g_free (uzbl.gui.icon); +} + +static void cmd_load_uri() { GArray *a = g_array_new (TRUE, FALSE, sizeof(gchar*)); g_array_append_val (a, uzbl.state.uri); @@ -2038,15 +2049,11 @@ create_mainbar () { static GtkWidget* create_window () { GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gchar* uzbl_icon = find_xdg_file(1, "/uzbl/uzbl.png"); gtk_window_set_default_size (GTK_WINDOW (window), 800, 600); gtk_widget_set_name (window, "Uzbl browser"); - gtk_window_set_icon_from_file (GTK_WINDOW (window), uzbl_icon, NULL); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy_cb), NULL); g_signal_connect (G_OBJECT (window), "key-press-event", G_CALLBACK (key_press_cb), NULL); - g_free (uzbl_icon); - return window; } @@ -77,6 +77,7 @@ typedef struct { GtkAdjustment* bar_h; // and scrolling position WebKitWebView* web_view; gchar* main_title; + gchar* icon; /* WebInspector */ GtkWidget *inspector_window; @@ -461,6 +462,9 @@ static void set_proxy_url(); static void +set_icon(); + +static void cmd_cookie_handler(); static void |