Fix tabbar path

pull/6/head
reionwong 4 years ago
parent 3ce786fd12
commit 6c386cd8e6

@ -33,10 +33,6 @@ Page {
width: _tabView.width
focus: true
// Drop effect
// opacity: _dropArea.containsDrag ? 0.8 : 1
// opacity: 0.5
background: Rectangle {
color: "transparent"
}

@ -132,10 +132,14 @@ FishUI.Window {
}
}
FishUI.TabView {
id: _tabView
ColumnLayout {
anchors.fill: parent
FishUI.TabView {
id: _tabView
Layout.fillWidth: true
Layout.fillHeight: true
}
}
Component.onCompleted: {
@ -143,8 +147,8 @@ FishUI.Window {
}
function openNewTab() {
if (currentTerminal) {
openTab(currentTerminal.session.currentDir)
if (_tabView.currentItem) {
openTab(_tabView.currentItem.session.currentDir)
} else {
openTab("$HOME")
}
@ -157,7 +161,7 @@ FishUI.Window {
const component = Qt.createComponent("Terminal.qml");
if (component.status === Component.Ready) {
const index = _tabView.contentModel.count
const object = _tabView.addTab(component, {})
const object = _tabView.addTab(component, {path: path})
object.terminalClosed.connect(() => closeTab(index))
}
}

Loading…
Cancel
Save