diff options
author | Hans Petter Jansson <hpj@ximian.com> | 2004-01-16 11:15:20 +0800 |
---|---|---|
committer | Hans Petter <hansp@src.gnome.org> | 2004-01-16 11:15:20 +0800 |
commit | 05bd304f77b0199f35ba8e1a8845f87dc6305418 (patch) | |
tree | 85ea5fab3d97a49ffb43a5019a9fc0de942fa329 | |
parent | d01b25aa98ec2b5c2820e640694bfd7f13577eab (diff) | |
download | gsoc2013-evolution-05bd304f77b0199f35ba8e1a8845f87dc6305418.tar gsoc2013-evolution-05bd304f77b0199f35ba8e1a8845f87dc6305418.tar.gz gsoc2013-evolution-05bd304f77b0199f35ba8e1a8845f87dc6305418.tar.bz2 gsoc2013-evolution-05bd304f77b0199f35ba8e1a8845f87dc6305418.tar.lz gsoc2013-evolution-05bd304f77b0199f35ba8e1a8845f87dc6305418.tar.xz gsoc2013-evolution-05bd304f77b0199f35ba8e1a8845f87dc6305418.tar.zst gsoc2013-evolution-05bd304f77b0199f35ba8e1a8845f87dc6305418.zip |
Implement. (get_paned_position): Implement. (eab_view_new): Connect signal
2004-01-15 Hans Petter Jansson <hpj@ximian.com>
* gui/widgets/e-addressbook-view.c (set_paned_position): Implement.
(get_paned_position): Implement.
(eab_view_new): Connect signal to get paned position changes.
Remove old hack.
(display_view): Set paned position properly.
svn path=/trunk/; revision=24264
-rw-r--r-- | addressbook/ChangeLog | 8 | ||||
-rw-r--r-- | addressbook/gui/component/apps_evolution_addressbook.schemas.in.in | 15 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 39 |
3 files changed, 58 insertions, 4 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index c192eb56c8..0ff8e4dec2 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,11 @@ +2004-01-15 Hans Petter Jansson <hpj@ximian.com> + + * gui/widgets/e-addressbook-view.c (set_paned_position): Implement. + (get_paned_position): Implement. + (eab_view_new): Connect signal to get paned position changes. + Remove old hack. + (display_view): Set paned position properly. + 2004-01-12 JP Rosevear <jpr@ximian.com> * gui/component/addressbook-component.c (impl_upgradeFromVersion): diff --git a/addressbook/gui/component/apps_evolution_addressbook.schemas.in.in b/addressbook/gui/component/apps_evolution_addressbook.schemas.in.in index 82af9d0843..6008c11ff3 100644 --- a/addressbook/gui/component/apps_evolution_addressbook.schemas.in.in +++ b/addressbook/gui/component/apps_evolution_addressbook.schemas.in.in @@ -38,5 +38,18 @@ </locale> </schema> + <!-- View state --> + + <schema> + <key>/schemas/apps/evolution/addressbook/display/vpane_position</key> + <applyto>/apps/evolution/addressbook/display/vpane_position</applyto> + <owner>evolution-addressbook</owner> + <type>int</type> + <default></default> + <locale name="C"> + <short>Position of the vertical pane in main view</short> + </locale> + </schema> + </schemalist> -</gconfschemafile>
\ No newline at end of file +</gconfschemafile> diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 14179c15af..3e58c2651c 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -357,6 +357,38 @@ eab_view_dispose (GObject *object) G_OBJECT_CLASS(parent_class)->dispose(object); } +static void +set_paned_position (EABView *eav) +{ + GConfClient *gconf_client; + gint pos; + + g_print (G_STRLOC "\n"); + + gconf_client = gconf_client_get_default (); + pos = gconf_client_get_int (gconf_client, "/apps/evolution/addressbook/display/vpane_position", NULL); + if (pos < 1) + pos = 144; + + gtk_paned_set_position (GTK_PANED (eav->paned), pos); +} + +static gboolean +get_paned_position (EABView *eav) +{ + GConfClient *gconf_client; + gint pos; + + g_print (G_STRLOC "\n"); + + gconf_client = gconf_client_get_default (); + + pos = gtk_paned_get_position (GTK_PANED (eav->paned)); + gconf_client_set_int (gconf_client, "/apps/evolution/addressbook/display/vpane_position", pos, NULL); + + return FALSE; +} + GtkWidget* eab_view_new (void) { @@ -397,6 +429,8 @@ eab_view_new (void) /* create the paned window and contact display */ eav->paned = gtk_vpaned_new (); gtk_box_pack_start (GTK_BOX (eav), eav->paned, TRUE, TRUE, 0); + g_signal_connect_swapped (eav->paned, "button_release_event", + G_CALLBACK (get_paned_position), eav); eav->widget = gtk_label_new ("empty label here"); gtk_container_add (GTK_CONTAINER (eav->paned), eav->widget); @@ -414,9 +448,6 @@ eab_view_new (void) gtk_widget_show (eav->scrolled); gtk_widget_show (eav->paned); - /* XXX hack */ - gtk_paned_set_position (GTK_PANED (eav->paned), 144); - /* gtk selection crap */ eav->invisible = gtk_invisible_new (); @@ -508,6 +539,8 @@ display_view(GalViewInstance *instance, } #endif address_view->current_view = view; + + set_paned_position (address_view); } static void |