Commit bf497319 authored by Simon Schmeißer's avatar Simon Schmeißer Committed by Jonah Brüchert
Browse files

Add ability to close all those new tabs

parent b46ba7fd
...@@ -63,6 +63,12 @@ ListView { ...@@ -63,6 +63,12 @@ ListView {
tabs.currentIndex = tabs.count - 1 tabs.currentIndex = tabs.count - 1
} }
function closeTab(index) {
tabsModel.remove(index)
if (tabs.count === 0)
createEmptyTab()
}
Component.onCompleted: { Component.onCompleted: {
if (initialUrl !== "") { if (initialUrl !== "") {
load(initialUrl) load(initialUrl)
......
...@@ -121,6 +121,17 @@ Kirigami.ScrollablePage { ...@@ -121,6 +121,17 @@ Kirigami.ScrollablePage {
} }
} }
Controls.ToolButton {
icon.name: "window-close"
height: 24
width: 24
anchors.right: parent.right
anchors.rightMargin: 8
anchors.top: parent.top
anchors.topMargin: 8
onClicked: tabs.closeTab(index)
}
} }
footer: Rectangle { footer: Rectangle {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment