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 {
|
} else {
|
||||||
SourceEdit editor = new SourceEdit(filename);
|
SourceEdit editor = new SourceEdit(filename);
|
||||||
if (editor.load(filename)) {
|
if (editor.load(filename)) {
|
||||||
tabs.addTab(editor, toUTF32(baseName(filename)));
|
tabs.addTab(editor, toUTF32(baseName(filename)), null, true);
|
||||||
tabs.selectTab(filename);
|
tabs.selectTab(filename);
|
||||||
} else {
|
} else {
|
||||||
destroy(editor);
|
destroy(editor);
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ class TabItemWidget : HorizontalLayout {
|
||||||
_closeButton.drawableId = "close";
|
_closeButton.drawableId = "close";
|
||||||
_closeButton.trackHover = true;
|
_closeButton.trackHover = true;
|
||||||
_closeButton.onClickListener = &onClick;
|
_closeButton.onClickListener = &onClick;
|
||||||
if (_enableCloseButton) {
|
if (!_enableCloseButton) {
|
||||||
_closeButton.visibility = Visibility.Gone;
|
_closeButton.visibility = Visibility.Gone;
|
||||||
} else {
|
} else {
|
||||||
_closeButton.visibility = Visibility.Visible;
|
_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
|
/// returns tab count
|
||||||
@property int tabCount() const {
|
@property int tabCount() const {
|
||||||
return _items.length;
|
return _items.length;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue