fix: adapt new tabbar interface

pull/4/head
kateleet 5 years ago
parent 7967442827
commit 60e189561b

@ -25,38 +25,35 @@ FishUI.Window {
anchors.margins: FishUI.Units.smallSpacing / 2 anchors.margins: FishUI.Units.smallSpacing / 2
anchors.rightMargin: FishUI.Units.largeSpacing * 2 anchors.rightMargin: FishUI.Units.largeSpacing * 2
model: _tabView.count
currentIndex : _tabView.currentIndex currentIndex : _tabView.currentIndex
onNewTabClicked: { onNewTabClicked: {
addTab() addTab()
} }
Repeater { delegate: FishUI.TabButton {
id: _repeater id: _tabBtn
model: _tabView.count text: _tabView.contentModel.get(index).fileName
implicitHeight: _tabbar.height
implicitWidth: Math.min(_tabbar.width / _tabbar.count,
_tabBtn.contentWidth)
FishUI.TabButton { ToolTip.delay: 1000
text: _tabView.contentModel.get(index).fileName ToolTip.timeout: 5000
implicitHeight: parent.height
implicitWidth: _repeater.count === 1 ? 150
: parent.width / _repeater.count
ToolTip.delay: 1000 checked: _tabView.currentIndex === index
ToolTip.timeout: 5000
checked: _tabView.currentIndex === index ToolTip.visible: hovered
ToolTip.text: _tabView.contentModel.get(index).fileUrl
ToolTip.visible: hovered onClicked: {
ToolTip.text: _tabView.contentModel.get(index).fileUrl _tabView.currentIndex = index
_tabView.currentItem.forceActiveFocus()
onClicked: { }
_tabView.currentIndex = index
_tabView.currentItem.forceActiveFocus()
}
onCloseClicked: { onCloseClicked: {
_tabView.closeTab(index) _tabView.closeTab(index)
}
} }
} }
} }
@ -104,7 +101,7 @@ FishUI.Window {
id: textEditorCompeont id: textEditorCompeont
TextEditor { TextEditor {
fileUrl: "" fileUrl: "file:///home/cutefish/桌面/winepath"
} }
} }

Loading…
Cancel
Save