ability to hide workspace explorer and log window - fix #280, ability to hide log window - fix #283, fix #247; partial change for #282

This commit is contained in:
Vadim Lopatin 2017-09-14 17:29:25 +03:00
parent 46b5a3efb3
commit 9bcec11903
7 changed files with 37 additions and 6 deletions

View File

@ -12,7 +12,7 @@
"stringImportPaths": ["views"],
"dependencies": {
"dlangui": "==0.9.134",
"dlangui": "==0.9.135",
"dsymbol": "~>0.2.9",
"dcd": "~>0.9.1"
},

View File

@ -51,6 +51,8 @@ enum IDEActions : int {
WindowCloseAllDocuments,
WindowShowHomeScreen,
WindowShowWorkspaceExplorer,
WindowShowLogWindow,
CreateNewWorkspace,
AddToCurrentWorkspace,
//ProjectFolderAddItem,
@ -134,10 +136,12 @@ const Action ACTION_EDIT_PREFERENCES = (new Action(IDEActions.EditPreferences, "
const Action ACTION_HELP_ABOUT = new Action(IDEActions.HelpAbout, "MENU_HELP_ABOUT"c);
const Action ACTION_HELP_VIEW_HELP = new Action(IDEActions.HelpViewHelp, "MENU_HELP_VIEW_HELP"c);
const Action ACTION_HELP_DONATE = new Action(IDEActions.HelpDonate, "MENU_HELP_DONATE"c);
const Action ACTION_WINDOW_CLOSE_DOCUMENT = new Action(IDEActions.WindowCloseDocument, "MENU_WINDOW_CLOSE_DOCUMENT"c, null, KeyCode.KEY_W, KeyFlag.Control).disableByDefault();
const Action ACTION_WINDOW_CLOSE_ALL_DOCUMENTS = new Action(IDEActions.WindowCloseAllDocuments, "MENU_WINDOW_CLOSE_ALL_DOCUMENTS"c).disableByDefault();
const Action ACTION_WINDOW_SHOW_HOME_SCREEN = new Action(IDEActions.WindowShowHomeScreen, "MENU_WINDOW_SHOW_HOME_SCREEN"c);
const Action ACTION_WINDOW_SHOW_WORKSPACE_EXPLORER = new Action(IDEActions.WindowShowWorkspaceExplorer, "MENU_WINDOW_SHOW_WORKSPACE_EXPLORER"c).disableByDefault();;
const Action ACTION_WINDOW_SHOW_WORKSPACE_EXPLORER = new Action(IDEActions.WindowShowWorkspaceExplorer, "MENU_WINDOW_SHOW_WORKSPACE_EXPLORER"c).disableByDefault();
const Action ACTION_WINDOW_SHOW_LOG_WINDOW = new Action(IDEActions.WindowShowLogWindow, "MENU_WINDOW_SHOW_LOG_WINDOW"c);
const Action ACTION_CREATE_NEW_WORKSPACE = new Action(IDEActions.CreateNewWorkspace, "OPTION_CREATE_NEW_WORKSPACE"c);
const Action ACTION_ADD_TO_CURRENT_WORKSPACE = new Action(IDEActions.AddToCurrentWorkspace, "OPTION_ADD_TO_CURRENT_WORKSPACE"c);

View File

@ -738,7 +738,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
MenuItem windowItem = new MenuItem(new Action(3, "MENU_WINDOW"c));
//windowItem.add(new Action(30, "MENU_WINDOW_PREFERENCES"));
windowItem.add(ACTION_WINDOW_CLOSE_DOCUMENT, ACTION_WINDOW_CLOSE_ALL_DOCUMENTS, ACTION_WINDOW_SHOW_HOME_SCREEN, ACTION_WINDOW_SHOW_WORKSPACE_EXPLORER);
windowItem.add(ACTION_WINDOW_CLOSE_DOCUMENT, ACTION_WINDOW_CLOSE_ALL_DOCUMENTS, ACTION_WINDOW_SHOW_HOME_SCREEN, ACTION_WINDOW_SHOW_WORKSPACE_EXPLORER, ACTION_WINDOW_SHOW_LOG_WINDOW);
MenuItem helpItem = new MenuItem(new Action(4, "MENU_HELP"c));
helpItem.add(ACTION_HELP_VIEW_HELP, ACTION_HELP_ABOUT, ACTION_HELP_DONATE);
mainMenuItems.add(fileItem);
@ -1065,6 +1065,9 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
case IDEActions.WindowShowWorkspaceExplorer:
showWorkspaceExplorer();
return true;
case IDEActions.WindowShowLogWindow:
_logPanel.activateLogTab();
return true;
case IDEActions.FileOpenWorkspace:
// Already specified workspace
if (!a.stringParam.empty) {
@ -1152,6 +1155,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
return true;
}
import dlangide.ui.searchPanel;
_logPanel.ensureLogVisible();
int searchPanelIndex = _logPanel.getTabs.tabIndex("search");
SearchWidget searchPanel = null;
if(searchPanelIndex == -1) {

View File

@ -238,6 +238,7 @@ class OutputPanel : DockWindow {
@property TabWidget getTabs() { return _tabs;}
void activateLogTab() {
ensureLogVisible();
_tabs.selectTab("logwidget");
}
@ -272,6 +273,14 @@ class OutputPanel : DockWindow {
void onTabClose(string tabId) {
Log.d("OutputPanel onTabClose ", tabId);
if (tabId == "search") {
_tabs.removeTab(tabId);
}
}
bool onCloseButton(Widget source) {
visibility = Visibility.Gone;
return true;
}
override protected Widget createBodyWidget() {
@ -282,6 +291,10 @@ class OutputPanel : DockWindow {
_tabs.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT);
_tabs.tabHost.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT);
_tabs.tabClose = &onTabClose;
_tabs.tabControl.moreButtonIcon = "close";
_tabs.tabControl.enableMoreButton = true;
_tabs.tabControl.autoMoreButtonMenu = false;
_tabs.tabControl.moreButtonClick = &onCloseButton;
_logWidget = new CompilerLogWidget("logwidget");
_logWidget.readOnly = true;
@ -290,7 +303,7 @@ class OutputPanel : DockWindow {
_logWidget.styleId = "EDIT_BOX_NO_FRAME";
//_tabs.tabHost.styleId = STYLE_DOCK_WINDOW_BODY;
_tabs.addTab(_logWidget, "Compiler Log"d, null, true);
_tabs.addTab(_logWidget, "Compiler Log"d, null, false);
_tabs.selectTab("logwidget");
static if (ENABLE_INTERNAL_TERMINAL) {
@ -343,7 +356,15 @@ class OutputPanel : DockWindow {
//TODO: Refactor OutputPanel to expose CompilerLogWidget
void ensureLogVisible() {
if (visibility == Visibility.Gone) {
visibility = Visibility.Visible;
parent.layout(parent.pos);
}
}
void appendText(string category, dstring msg) {
ensureLogVisible();
_logWidget.appendText(msg);
}

View File

@ -1 +1 @@
v0.7.80
v0.7.81

View File

@ -99,7 +99,8 @@ MENU_WINDOW_PREFERENCES=&Preferences
MENU_WINDOW_CLOSE_DOCUMENT=Close document
MENU_WINDOW_CLOSE_ALL_DOCUMENTS=Close all documents
MENU_WINDOW_SHOW_HOME_SCREEN=Show home screen
MENU_WINDOW_SHOW_WORKSPACE_EXPLORER=Show workspace explorer
MENU_WINDOW_SHOW_WORKSPACE_EXPLORER=Workspace explorer
MENU_WINDOW_SHOW_LOG_WINDOW=Log window
MENU_HELP=&Help
MENU_HELP_VIEW_HELP=Online help

View File

@ -100,6 +100,7 @@ MENU_WINDOW_CLOSE_DOCUMENT=Закрыть документ
MENU_WINDOW_CLOSE_ALL_DOCUMENTS=Закрыть все документы
MENU_WINDOW_SHOW_HOME_SCREEN=Домашняя страница
MENU_WINDOW_SHOW_WORKSPACE_EXPLORER=Менеджер рабочего пространства
MENU_WINDOW_SHOW_LOG_WINDOW=Окно сообщений
MENU_HELP=&Справка
MENU_HELP_VIEW_HELP=Онлайн справка