From: Felipe Erias Morandeira Date: Tue, 18 Dec 2007 10:02:50 +0000 (+0000) Subject: * modest-msg-edit-window.c: X-Git-Tag: git_migration_finished~1906 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=4a5c28b5fb85146316d725c76a5ee1d08f9973b6 * modest-msg-edit-window.c: (modest_msg_edit_window_set_format_state) : the menus are updated after we change the state of the editor (text_buffer_refresh_attributes) : the state of alignment menu items is updated when the cursor moves pmo-trunk-r3933 --- diff --git a/src/maemo/modest-msg-edit-window.c b/src/maemo/modest-msg-edit-window.c index 6edffce..3de0e3a 100644 --- a/src/maemo/modest-msg-edit-window.c +++ b/src/maemo/modest-msg-edit-window.c @@ -1664,6 +1664,8 @@ modest_msg_edit_window_set_format_state (ModestMsgEditWindow *self, } /* wp_text_buffer_set_format (WP_TEXT_BUFFER (priv->text_buffer), buffer_format); */ + text_buffer_refresh_attributes (WP_TEXT_BUFFER (priv->text_buffer), self); + g_free (current_format); } @@ -1702,6 +1704,28 @@ text_buffer_refresh_attributes (WPTextBuffer *buffer, ModestMsgEditWindow *windo /* action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/FormatMenu/BulletedListMenu"); */ /* modest_utils_toggle_action_set_active_block_notify (GTK_TOGGLE_ACTION (action), buffer_format->bullet); */ + action = NULL; + switch (buffer_format->justification) + { + case GTK_JUSTIFY_LEFT: + action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/FormatMenu/AlignmentLeftMenu"); + g_warning ("GTK_JUSTIFY_LEFT"); + break; + case GTK_JUSTIFY_CENTER: + action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/FormatMenu/AlignmentCenterMenu"); + g_warning ("GTK_JUSTIFY_CENTER"); + break; + case GTK_JUSTIFY_RIGHT: + action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/FormatMenu/AlignmentRightMenu"); + g_warning ("GTK_JUSTIFY_RIGHT"); + break; + default: + break; + } + + if (action != NULL) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE); + g_signal_handlers_block_by_func (G_OBJECT (priv->font_color_button), G_CALLBACK (modest_msg_edit_window_color_button_change), window);