From 6f096754a43d01141efc1f9faf672dc698b1b174 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Wed, 9 Oct 2002 02:01:19 +0000 Subject: [PATCH] Added gl_ui_update_zoom_verbs () function and added updates to zoom verbs in the gl_ui_update_all () function. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@153 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/src/ui.c | 35 ++++++++++++++++++++++++++++++----- glabels2/src/ui.h | 3 +++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/glabels2/src/ui.c b/glabels2/src/ui.c index fe29ad71..86537db7 100644 --- a/glabels2/src/ui.c +++ b/glabels2/src/ui.c @@ -293,16 +293,20 @@ gl_ui_update_all (BonoboUIComponent *ui_component, label = view->label; g_return_if_fail (label != NULL); - set_verb_sensitive (ui_component, - "/commands/EditUndo", gl_label_can_undo (label)); - - set_verb_sensitive (ui_component, - "/commands/EditRedo", gl_label_can_redo (label)); + set_verb_sensitive (ui_component, "/commands/EditUndo", + gl_label_can_undo (label)); + set_verb_sensitive (ui_component, "/commands/EditRedo", + gl_label_can_redo (label)); set_verb_list_sensitive (ui_component, doc_modified_verbs, gl_label_is_modified (label)); + set_verb_sensitive (ui_component, "/commands/ToolsZoomIn", + !gl_view_is_zoom_max (view)); + set_verb_sensitive (ui_component, "/commands/ToolsZoomOut", + !gl_view_is_zoom_min (view)); + set_verb_list_sensitive (ui_component, selection_verbs, !gl_view_is_selection_empty (view)); @@ -377,6 +381,27 @@ gl_ui_update_selection_verbs (BonoboUIComponent *ui_component, gl_debug (DEBUG_UI, "END"); } +/*****************************************************************************/ +/* Update verbs associated with zoom level of given UI component. */ +/*****************************************************************************/ +void +gl_ui_update_zoom_verbs (BonoboUIComponent *ui_component, + glView *view) +{ + gl_debug (DEBUG_UI, "START"); + + bonobo_ui_component_freeze (ui_component, NULL); + + set_verb_sensitive (ui_component, "/commands/ToolsZoomIn", + !gl_view_is_zoom_max (view)); + set_verb_sensitive (ui_component, "/commands/ToolsZoomOut", + !gl_view_is_zoom_min (view)); + + bonobo_ui_component_thaw (ui_component, NULL); + + gl_debug (DEBUG_UI, "END"); +} + /*****************************************************************************/ /* Update undo/redo verbs of given UI component. */ /*****************************************************************************/ diff --git a/glabels2/src/ui.h b/glabels2/src/ui.h index 83fdd6c2..51d0f452 100644 --- a/glabels2/src/ui.h +++ b/glabels2/src/ui.h @@ -46,6 +46,9 @@ void gl_ui_update_modified_verbs (BonoboUIComponent *ui_component, void gl_ui_update_selection_verbs (BonoboUIComponent *ui_component, glView *view); +void gl_ui_update_zoom_verbs (BonoboUIComponent *ui_component, + glView *view); + void gl_ui_update_undo_redo_verbs (BonoboUIComponent *ui_component, glLabel *label); -- 2.39.5