From 1cf381e4b9f66ca74f5d4796b57669eec7735e79 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Sun, 8 Feb 2015 21:23:15 +0300 Subject: [PATCH] update editor actions --- src/dlangui/widgets/editors.d | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index fbeeee3b..f5a4b08b 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -410,11 +410,11 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction override bool isActionEnabled(const Action action) { switch (action.id) { case EditorActions.ToggleBlockComment: - return !_selectionRange.empty; + return enabled && !_selectionRange.empty; case EditorActions.ToggleLineComment: case EditorActions.Tab: case EditorActions.BackTab: - return true; + return enabled; case EditorActions.Copy: return !_selectionRange.empty; case EditorActions.Cut: @@ -906,6 +906,10 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction case EditorActions.Paste: case EditorActions.Undo: case EditorActions.Redo: + case EditorActions.ToggleBlockComment: + case EditorActions.ToggleLineComment: + case EditorActions.Tab: + case EditorActions.BackTab: if (isActionEnabled(a)) a.state = ACTION_STATE_ENABLED; else