mirror of https://github.com/buggins/dlangide.git
CTRL+F to open search tab
This commit is contained in:
parent
19271b6233
commit
057dfa66ab
|
@ -44,6 +44,7 @@ enum IDEActions : int {
|
||||||
GoToDefinition,
|
GoToDefinition,
|
||||||
GetCompletionSuggestions,
|
GetCompletionSuggestions,
|
||||||
InsertCompletion,
|
InsertCompletion,
|
||||||
|
FindText,
|
||||||
}
|
}
|
||||||
|
|
||||||
__gshared static this() {
|
__gshared static this() {
|
||||||
|
@ -101,3 +102,4 @@ const Action ACTION_ADD_TO_CURRENT_WORKSPACE = new Action(IDEActions.AddToCurren
|
||||||
|
|
||||||
const Action ACTION_GO_TO_DEFINITION = (new Action(IDEActions.GoToDefinition, "GO_TO_DEFINITION"c, ""c, KeyCode.KEY_G, KeyFlag.Control)).addAccelerator(KeyCode.F12, 0).disableByDefault();
|
const Action ACTION_GO_TO_DEFINITION = (new Action(IDEActions.GoToDefinition, "GO_TO_DEFINITION"c, ""c, KeyCode.KEY_G, KeyFlag.Control)).addAccelerator(KeyCode.F12, 0).disableByDefault();
|
||||||
const Action ACTION_GET_COMPLETIONS = (new Action(IDEActions.GetCompletionSuggestions, "SHOW_COMPLETIONS"c, ""c, KeyCode.KEY_G, KeyFlag.Control|KeyFlag.Shift)).addAccelerator(KeyCode.SPACE, KeyFlag.Control).disableByDefault();
|
const Action ACTION_GET_COMPLETIONS = (new Action(IDEActions.GetCompletionSuggestions, "SHOW_COMPLETIONS"c, ""c, KeyCode.KEY_G, KeyFlag.Control|KeyFlag.Shift)).addAccelerator(KeyCode.SPACE, KeyFlag.Control).disableByDefault();
|
||||||
|
const Action ACTION_FIND_TEXT = (new Action(IDEActions.FindText, "FIND_TEXT"c, ""c, KeyCode.KEY_F, KeyFlag.Control));
|
||||||
|
|
|
@ -367,11 +367,6 @@ class IDEFrame : AppFrame {
|
||||||
_logPanel.appendText(null, "cannot start dcd-server: code completion for D code will not work"d);
|
_logPanel.appendText(null, "cannot start dcd-server: code completion for D code will not work"d);
|
||||||
}
|
}
|
||||||
|
|
||||||
import dlangide.ui.searchPanel;
|
|
||||||
auto searchPanel = new SearchWidget("search", this);
|
|
||||||
|
|
||||||
_logPanel.getTabs.addTab( searchPanel, "Search"d, null, true);
|
|
||||||
|
|
||||||
_dockHost.addDockedWindow(_logPanel);
|
_dockHost.addDockedWindow(_logPanel);
|
||||||
|
|
||||||
return _dockHost;
|
return _dockHost;
|
||||||
|
@ -390,7 +385,7 @@ class IDEFrame : AppFrame {
|
||||||
|
|
||||||
MenuItem editItem = new MenuItem(new Action(2, "MENU_EDIT"));
|
MenuItem editItem = new MenuItem(new Action(2, "MENU_EDIT"));
|
||||||
editItem.add(ACTION_EDIT_COPY, ACTION_EDIT_PASTE,
|
editItem.add(ACTION_EDIT_COPY, ACTION_EDIT_PASTE,
|
||||||
ACTION_EDIT_CUT, ACTION_EDIT_UNDO, ACTION_EDIT_REDO);
|
ACTION_EDIT_CUT, ACTION_EDIT_UNDO, ACTION_EDIT_REDO, ACTION_FIND_TEXT);
|
||||||
MenuItem editItemAdvanced = new MenuItem(new Action(221, "MENU_EDIT_ADVANCED"));
|
MenuItem editItemAdvanced = new MenuItem(new Action(221, "MENU_EDIT_ADVANCED"));
|
||||||
editItemAdvanced.add(ACTION_EDIT_INDENT, ACTION_EDIT_UNINDENT, ACTION_EDIT_TOGGLE_LINE_COMMENT, ACTION_EDIT_TOGGLE_BLOCK_COMMENT, ACTION_GO_TO_DEFINITION, ACTION_GET_COMPLETIONS);
|
editItemAdvanced.add(ACTION_EDIT_INDENT, ACTION_EDIT_UNINDENT, ACTION_EDIT_TOGGLE_LINE_COMMENT, ACTION_EDIT_TOGGLE_BLOCK_COMMENT, ACTION_GO_TO_DEFINITION, ACTION_GET_COMPLETIONS);
|
||||||
editItem.add(editItemAdvanced);
|
editItem.add(editItemAdvanced);
|
||||||
|
@ -631,6 +626,17 @@ class IDEFrame : AppFrame {
|
||||||
case IDEActions.EditPreferences:
|
case IDEActions.EditPreferences:
|
||||||
showPreferences();
|
showPreferences();
|
||||||
return true;
|
return true;
|
||||||
|
case IDEActions.FindText:
|
||||||
|
Log.d("Opening Search Field");
|
||||||
|
import dlangide.ui.searchPanel;
|
||||||
|
int searchPanelIndex = _logPanel.getTabs.tabIndex("search");
|
||||||
|
if(searchPanelIndex == -1) {
|
||||||
|
SearchWidget searchPanel = new SearchWidget("search", this);
|
||||||
|
_logPanel.getTabs.addTab( searchPanel, "Search"d, null, true);
|
||||||
|
}
|
||||||
|
_logPanel.getTabs.selectTab("search");
|
||||||
|
//TODO: Focus search field
|
||||||
|
return true;
|
||||||
default:
|
default:
|
||||||
return super.handleAction(a);
|
return super.handleAction(a);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import dlangui.core.editable;
|
||||||
|
|
||||||
import dlangide.ui.frame;
|
import dlangide.ui.frame;
|
||||||
import dlangide.ui.wspanel;
|
import dlangide.ui.wspanel;
|
||||||
|
import dlangui.widgets.tabs; //TODO: This is required for navigating to decleration of TabWidget / BUG
|
||||||
import dlangide.workspace.workspace;
|
import dlangide.workspace.workspace;
|
||||||
import dlangide.workspace.project;
|
import dlangide.workspace.project;
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,11 @@ MENU_WINDOW_CLOSE_ALL_DOCUMENTS=Close All Documents
|
||||||
MENU_HELP=&HELP
|
MENU_HELP=&HELP
|
||||||
MENU_HELP_VIEW_HELP=&View help
|
MENU_HELP_VIEW_HELP=&View help
|
||||||
MENU_HELP_ABOUT=&About
|
MENU_HELP_ABOUT=&About
|
||||||
|
MENU_NAVIGATE=NAVIGATE
|
||||||
|
|
||||||
GO_TO_DEFINITION=Go To Definition
|
GO_TO_DEFINITION=Go To Definition
|
||||||
SHOW_COMPLETIONS=Get Autocompletions
|
SHOW_COMPLETIONS=Get Autocompletions
|
||||||
MENU_NAVIGATE=NAVIGATE
|
FIND_TEXT=Find text
|
||||||
|
|
||||||
|
|
||||||
TAB_LONG_LIST=Long list
|
TAB_LONG_LIST=Long list
|
||||||
|
|
Loading…
Reference in New Issue