mirror of https://github.com/buggins/dlangui.git
editors find / replace enhancements
This commit is contained in:
parent
b65fa61272
commit
ddf9b82a18
|
@ -1254,6 +1254,18 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// returns current selection range
|
||||||
|
@property TextRange selectionRange() {
|
||||||
|
return _selectionRange;
|
||||||
|
}
|
||||||
|
/// sets current selection range
|
||||||
|
@property void selectionRange(TextRange range) {
|
||||||
|
if (range.empty)
|
||||||
|
return;
|
||||||
|
_selectionRange = range;
|
||||||
|
_caretPos = range.end;
|
||||||
|
}
|
||||||
|
|
||||||
/// override to handle specific actions state (e.g. change enabled state for supported actions)
|
/// override to handle specific actions state (e.g. change enabled state for supported actions)
|
||||||
override bool handleActionStateRequest(const Action a) {
|
override bool handleActionStateRequest(const Action a) {
|
||||||
switch (a.id) with(EditorActions)
|
switch (a.id) with(EditorActions)
|
||||||
|
@ -3462,7 +3474,9 @@ class FindPanel : HorizontalLayout {
|
||||||
TextPosition pos = _editor.caretPos;
|
TextPosition pos = _editor.caretPos;
|
||||||
bool res = _editor.findNextPattern(pos, currentText, _cbCaseSensitive.checked, back ? -1 : 1);
|
bool res = _editor.findNextPattern(pos, currentText, _cbCaseSensitive.checked, back ? -1 : 1);
|
||||||
if (res) {
|
if (res) {
|
||||||
_editor.setCaretPos(pos.line, pos.pos, true);
|
_editor.selectionRange = TextRange(pos, TextPosition(pos.line, pos.pos + cast(int)currentText.length));
|
||||||
|
_editor.ensureCaretVisible();
|
||||||
|
//_editor.setCaretPos(pos.line, pos.pos, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<color id="editor_matching_bracket_highlight" value="#60FFE0B0"/>
|
<color id="editor_matching_bracket_highlight" value="#60FFE0B0"/>
|
||||||
<color id="editor_selection_focused" value="#B060A0FF"/>
|
<color id="editor_selection_focused" value="#B060A0FF"/>
|
||||||
<color id="editor_selection_normal" value="#D060A0FF"/>
|
<color id="editor_selection_normal" value="#D060A0FF"/>
|
||||||
<color id="editor_search_highlight_current" value="#60FFC040"/>
|
<color id="editor_search_highlight_current" value="#60A0C0FF"/>
|
||||||
<color id="editor_search_highlight_other" value="#90F0D080"/>
|
<color id="editor_search_highlight_other" value="#90F0D080"/>
|
||||||
<color id="editor_left_pane_background" value="#F4F4F4"/>
|
<color id="editor_left_pane_background" value="#F4F4F4"/>
|
||||||
<color id="editor_left_pane_background2" value="#FFFFFF"/>
|
<color id="editor_left_pane_background2" value="#FFFFFF"/>
|
||||||
|
|
Loading…
Reference in New Issue