fix issue #52 - showCloseButton flag

This commit is contained in:
Vadim Lopatin 2015-02-08 19:51:41 +03:00
parent 1f26e95467
commit e91114994e
2 changed files with 10 additions and 2 deletions

View File

@ -376,7 +376,7 @@ extern (C) int UIAppMain(string[] args) {
} else {
SourceEdit editor = new SourceEdit(filename);
if (editor.load(filename)) {
tabs.addTab(editor, toUTF32(baseName(filename)));
tabs.addTab(editor, toUTF32(baseName(filename)), null, true);
tabs.selectTab(filename);
} else {
destroy(editor);

View File

@ -109,7 +109,7 @@ class TabItemWidget : HorizontalLayout {
_closeButton.drawableId = "close";
_closeButton.trackHover = true;
_closeButton.onClickListener = &onClick;
if (_enableCloseButton) {
if (!_enableCloseButton) {
_closeButton.visibility = Visibility.Gone;
} else {
_closeButton.visibility = Visibility.Visible;
@ -260,6 +260,14 @@ class TabControl : WidgetGroupDefaultDrawing {
}
}
}
/// when true, shows close buttons in tabs
@property bool enableCloseButton() { return _enableCloseButton; }
/// ditto
@property void enableCloseButton(bool enabled) {
_enableCloseButton = enabled;
}
/// returns tab count
@property int tabCount() const {
return _items.length;