mirror of https://github.com/buggins/dlangide.git
show editor modified state with * prefix on tab
This commit is contained in:
parent
00ef54ccf3
commit
17eaa97026
|
@ -65,6 +65,16 @@ class IDEFrame : AppFrame {
|
||||||
return openSourceFile(file.filename, file, activate);
|
return openSourceFile(file.filename, file, activate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onModifiedStateChange(Widget source, bool modified) {
|
||||||
|
//
|
||||||
|
Log.d("onModifiedStateChange ", source.id, " modified=", modified);
|
||||||
|
int index = _tabs.tabIndex(source.id);
|
||||||
|
if (index >= 0) {
|
||||||
|
dstring name = toUTF32((modified ? "* " : "") ~ baseName(source.id));
|
||||||
|
_tabs.renameTab(index, name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool openSourceFile(string filename, ProjectSourceFile file = null, bool activate = true) {
|
bool openSourceFile(string filename, ProjectSourceFile file = null, bool activate = true) {
|
||||||
if (!file)
|
if (!file)
|
||||||
file = _wsPanel.findSourceFileItem(filename);
|
file = _wsPanel.findSourceFileItem(filename);
|
||||||
|
@ -81,6 +91,7 @@ class IDEFrame : AppFrame {
|
||||||
index = _tabs.tabIndex(filename);
|
index = _tabs.tabIndex(filename);
|
||||||
TabItem tab = _tabs.tab(filename);
|
TabItem tab = _tabs.tab(filename);
|
||||||
tab.objectParam = file;
|
tab.objectParam = file;
|
||||||
|
editor.onModifiedStateChangeListener = &onModifiedStateChange;
|
||||||
_tabs.selectTab(index, true);
|
_tabs.selectTab(index, true);
|
||||||
} else {
|
} else {
|
||||||
destroy(editor);
|
destroy(editor);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue