]> git.sur5r.net Git - glabels/commitdiff
Added gl_ui_update_zoom_verbs () function and added updates to zoom verbs in the...
authorJim Evins <evins@snaught.com>
Wed, 9 Oct 2002 02:01:19 +0000 (02:01 +0000)
committerJim Evins <evins@snaught.com>
Wed, 9 Oct 2002 02:01:19 +0000 (02:01 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@153 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/src/ui.c
glabels2/src/ui.h

index fe29ad7172fde9250e7c5971d3a40651f495c112..86537db711c30fe4ab1ea474463852e6371d954f 100644 (file)
@@ -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.                             */
 /*****************************************************************************/
index 83fdd6c2490f96852227fdfc6d1c82101c07a097..51d0f452d6b08aeb18bb86c151c4c1c39b9eea2e 100644 (file)
@@ -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);