diff options
author | Srinivasa Ragavan <sragavan@novell.com> | 2009-08-07 11:32:17 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-08-12 03:48:04 +0800 |
commit | 46cc80aa8c6579a8badb79e719bd9aec29220e9f (patch) | |
tree | 702642f7b2dff8845bd9013d5a50b5ccca0d9c54 /calendar/gui/dialogs/comp-editor.c | |
parent | 50302d03b3ce145b165db2ddef4e92ad190cbef9 (diff) | |
download | gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar.gz gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar.bz2 gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar.lz gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar.xz gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.tar.zst gsoc2013-evolution-46cc80aa8c6579a8badb79e719bd9aec29220e9f.zip |
Changes for having a light version of calendar.
Diffstat (limited to 'calendar/gui/dialogs/comp-editor.c')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 75 |
1 files changed, 69 insertions, 6 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 100a1615fb..0b9dfba93c 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -75,6 +75,8 @@ #define d(x) +static gboolean comp_lite = FALSE; + /* Private part of the CompEditor structure */ struct _CompEditorPrivate { @@ -1606,6 +1608,7 @@ comp_editor_init (CompEditor *editor) GtkAction *action; GtkWidget *container; GtkWidget *widget; + GtkWidget *scroll; EShell *shell; gint n_targets; GError *error = NULL; @@ -1628,7 +1631,9 @@ comp_editor_init (CompEditor *editor) priv->is_group_item = FALSE; priv->ui_manager = gtk_ui_manager_new (); - + + if (comp_lite) + gtk_window_set_default_size ((GtkWindow *) editor, 800, 450); gtk_window_add_accel_group ( GTK_WINDOW (editor), gtk_ui_manager_get_accel_group (priv->ui_manager)); @@ -1702,9 +1707,11 @@ comp_editor_init (CompEditor *editor) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - widget = comp_editor_get_managed_widget (editor, "/main-toolbar"); - gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); - gtk_widget_show (widget); + if (!comp_lite) { + widget = comp_editor_get_managed_widget (editor, "/main-toolbar"); + gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); + gtk_widget_show (widget); + } widget = e_attachment_paned_new (); gtk_container_set_border_width (GTK_CONTAINER (widget), 6); @@ -1712,15 +1719,60 @@ comp_editor_init (CompEditor *editor) priv->attachment_view = g_object_ref (widget); gtk_widget_show (widget); + if (comp_lite) { + GtkWidget *tmp, *tmp1, *tmp_box, *cont; + GtkWidget *combo; + + e_attachment_paned_set_expanded (E_ATTACHMENT_PANED (widget), TRUE); + e_attachment_paned_set_expanded (E_ATTACHMENT_PANED (widget), FALSE); + + combo = e_attachment_paned_get_view_combo ( + E_ATTACHMENT_PANED (widget)); + gtk_widget_hide (combo); + cont = e_attachment_paned_get_controls_container ( + E_ATTACHMENT_PANED (widget)); + + tmp_box = gtk_hbox_new (FALSE, 0); + tmp = gtk_hbox_new (FALSE, 0); + tmp1 = gtk_image_new_from_stock (GTK_STOCK_SAVE, GTK_ICON_SIZE_BUTTON); + gtk_box_pack_start ((GtkBox *)tmp, tmp1, FALSE, FALSE, 0); + tmp1 = gtk_label_new_with_mnemonic (_("Save")); + gtk_box_pack_start ((GtkBox *)tmp, tmp1, FALSE, FALSE, 3); + gtk_widget_show_all(tmp); + + combo = gtk_ui_manager_get_widget (priv->ui_manager, "/main-toolbar/save"); + gtk_widget_reparent (combo, tmp_box); + gtk_box_set_child_packing ((GtkBox *)tmp_box, combo, FALSE, FALSE, 6, GTK_PACK_END); + gtk_tool_item_set_is_important (GTK_TOOL_ITEM (combo), TRUE); + combo = gtk_bin_get_child ((GtkBin *)combo); + gtk_container_remove((GtkContainer *)combo, gtk_bin_get_child ((GtkBin *)combo)); + gtk_container_add((GtkContainer *)combo, tmp); + gtk_button_set_relief ((GtkButton *)combo, GTK_RELIEF_NORMAL); + + gtk_widget_show(tmp_box); + gtk_box_pack_end (GTK_BOX (cont), tmp_box, FALSE, FALSE, 4); + + } container = e_attachment_paned_get_content_area ( E_ATTACHMENT_PANED (priv->attachment_view)); + if (comp_lite) { + scroll = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ((GtkScrolledWindow *)scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_widget_show(scroll); + gtk_box_pack_start (GTK_BOX (container), scroll, TRUE, TRUE, 0); + } + widget = gtk_notebook_new (); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE); - gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + if (!comp_lite) + gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + else + gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *) scroll, widget); priv->notebook = GTK_NOTEBOOK (widget); gtk_widget_show (widget); - + if (comp_lite) + gtk_widget_set_size_request (scroll, 300, -1); comp_editor_setup_recent_menu (editor); /* Drag-and-Drop Support */ @@ -2944,3 +2996,14 @@ obj_removed_cb (ECal *client, close_dialog (editor); } +gboolean +comp_editor_get_lite () +{ + return comp_lite; +} + +void +comp_editor_set_lite (gboolean status) +{ + comp_lite = status; +} |