diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-04-18 18:19:22 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-04-18 18:19:22 +0800 |
commit | 26d1ed1f62e1c3229729bb79673f1b424a4dd8d9 (patch) | |
tree | 9ba8e9dec6fa731d89980ae62ce615e1630cab6e /lib/ephy-state.c | |
parent | 6e4b4bb1ec37e4afb9a8b52bb81d4d82ce20b136 (diff) | |
download | gsoc2013-epiphany-26d1ed1f62e1c3229729bb79673f1b424a4dd8d9.tar gsoc2013-epiphany-26d1ed1f62e1c3229729bb79673f1b424a4dd8d9.tar.gz gsoc2013-epiphany-26d1ed1f62e1c3229729bb79673f1b424a4dd8d9.tar.bz2 gsoc2013-epiphany-26d1ed1f62e1c3229729bb79673f1b424a4dd8d9.tar.lz gsoc2013-epiphany-26d1ed1f62e1c3229729bb79673f1b424a4dd8d9.tar.xz gsoc2013-epiphany-26d1ed1f62e1c3229729bb79673f1b424a4dd8d9.tar.zst gsoc2013-epiphany-26d1ed1f62e1c3229729bb79673f1b424a4dd8d9.zip |
Do not install two copies of epiphany.png
2003-04-18 Marco Pesenti Gritti <marco@it.gnome.org>
* data/art/Makefile.am:
Do not install two copies of epiphany.png
* embed/ephy-history.c: (ephy_history_save),
(ephy_history_set_page_title):
Use host name as title for sites, not the real
title.
* lib/ephy-state.c: (ephy_state_add_window),
(paned_size_allocate_cb), (ephy_state_add_paned):
* lib/ephy-state.h:
Add a way to persist paned.
* lib/widgets/ephy-node-view.h:
* lib/widgets/ephy-node-view.c: (ephy_node_view_sort_func),
(provide_text_weight), (ephy_node_view_add_column),
(ephy_node_view_has_selection):
Improve add_column api a bit to support both auto sorting
and user sorting.
* src/bookmarks/ephy-bookmarks-editor.c:
(ephy_bookmarks_editor_construct):
Updates for changed api.
* src/ephy-history-window.c: (ephy_history_window_construct):
Set a max size for title/location. Not very good, but the
best we can do with current treeview api prolly.
Persist the paned size.
Make columns user sortable.
Diffstat (limited to 'lib/ephy-state.c')
-rw-r--r-- | lib/ephy-state.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/ephy-state.c b/lib/ephy-state.c index 5debe8cf5..e89c2db88 100644 --- a/lib/ephy-state.c +++ b/lib/ephy-state.c @@ -26,6 +26,7 @@ #include <string.h> #include <gtk/gtkwindow.h> +#include <gtk/gtkpaned.h> #define STATES_FILE "states.xml" @@ -270,6 +271,63 @@ ephy_state_add_window (GtkWidget *window, G_CALLBACK (window_state_event_cb), node, 0); } +static gboolean +paned_size_allocate_cb (GtkWidget *paned, + GtkAllocation *allocation, + EphyNode *node) +{ + int width; + GValue value = { 0, }; + + width = gtk_paned_get_position (GTK_PANED (paned)); + + g_value_init (&value, G_TYPE_INT); + g_value_set_int (&value, width); + ephy_node_set_property (node, EPHY_NODE_STATE_PROP_WIDTH, + &value); + g_value_unset (&value); + + return FALSE; +} + +void +ephy_state_add_paned (GtkWidget *paned, + const char *name, + int default_width) +{ + EphyNode *node; + int width; + + ensure_states (); + + node = find_by_name (name); + if (node == NULL) + { + GValue value = { 0, }; + + node = ephy_node_new (); + ephy_node_add_child (states, node); + + g_value_init (&value, G_TYPE_STRING); + g_value_set_string (&value, name); + ephy_node_set_property (node, EPHY_NODE_STATE_PROP_NAME, + &value); + g_value_unset (&value); + + g_value_init (&value, G_TYPE_INT); + g_value_set_int (&value, default_width); + ephy_node_set_property (node, EPHY_NODE_STATE_PROP_WIDTH, + &value); + g_value_unset (&value); + } + + width = ephy_node_get_property_int (node, EPHY_NODE_STATE_PROP_WIDTH); + gtk_paned_set_position (GTK_PANED (paned), width); + + g_signal_connect_object (paned, "size_allocate", + G_CALLBACK (paned_size_allocate_cb), node, 0); +} + void ephy_state_save (void) { |