mirror of https://github.com/buggins/dlangui.git
fix issue #52 - showCloseButton flag
This commit is contained in:
parent
1f26e95467
commit
e91114994e
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue