Fix tabbar path

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

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

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

Loading…
Cancel
Save