diff --git a/src/dlangui/core/events.d b/src/dlangui/core/events.d index 256d5d98..860adec9 100644 --- a/src/dlangui/core/events.d +++ b/src/dlangui/core/events.d @@ -47,7 +47,7 @@ struct Accelerator { /// Key flags bit set, usually one of KeyFlag enum items uint keyFlags; /// Returns accelerator text description - @property dstring label() { + @property dstring label() const { dstring buf; version (OSX) { static if (true) { @@ -474,9 +474,10 @@ class Action { } /// returns text description for first accelerator of action; null if no accelerators @property dstring acceleratorText() { - if (_accelerators.length < 1) + Accelerator[] acc = accelerators; + if (acc.length < 1) return null; - return _accelerators[0].label; + return acc[0].label; } /// returns tooltip text for action @property dstring tooltipText() { @@ -516,7 +517,7 @@ class Action { } /// returns true if accelerator matches provided key code and flags bool checkAccelerator(uint keyCode, uint keyFlags) const { - foreach(a; _accelerators) { + foreach(a; accelerators) { if (a.keyCode == keyCode && matchKeyFlags(keyFlags, a.keyFlags)) return true; } @@ -1741,8 +1742,9 @@ void setActionAccelerators(int actionId, Accelerator[] accelerators) { } /// lookup accelerators override for action by id Accelerator[] findActionAccelerators(int actionId) { - if (auto found = actionId in actionAcceleratorsMap) + if (auto found = actionId in actionAcceleratorsMap) { return *found; + } return null; } /// lookup accelerators override for action by name (e.g. "EditorActions.ToggleLineComment") diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index cbc13cde..009dad0a 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -230,7 +230,7 @@ const Action[] STD_EDITOR_ACTIONS = [ACTION_EDITOR_INSERT_NEW_LINE, ACTION_EDITO ACTION_EDITOR_APPEND_NEW_LINE, ACTION_EDITOR_DELETE_LINE, ACTION_EDITOR_TOGGLE_REPLACE_MODE, ACTION_EDITOR_SELECT_ALL, ACTION_EDITOR_TOGGLE_LINE_COMMENT, ACTION_EDITOR_TOGGLE_BLOCK_COMMENT, ACTION_EDITOR_TOGGLE_BOOKMARK, ACTION_EDITOR_GOTO_NEXT_BOOKMARK, ACTION_EDITOR_GOTO_PREVIOUS_BOOKMARK, - ACTION_EDITOR_FIND, ACTION_EDITOR_REPLACE, ACTION_EDITOR_FIND_NEXT, ACTION_EDITOR_FIND_PREV, + ACTION_EDITOR_FIND, ACTION_EDITOR_REPLACE, ACTION_EDITOR_FIND_NEXT, ACTION_EDITOR_FIND_PREV ]; diff --git a/views/DLANGUI_VERSION b/views/DLANGUI_VERSION index d9e6b023..c523cb39 100644 --- a/views/DLANGUI_VERSION +++ b/views/DLANGUI_VERSION @@ -1 +1 @@ -v0.9.146 \ No newline at end of file +v0.9.147 \ No newline at end of file