formatting tabs
This commit is contained in:
parent
338e81d3ad
commit
5e82fd906d
3 changed files with 69 additions and 75 deletions
|
|
@ -5,21 +5,15 @@ TabBar {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
property alias orientation: view.orientation
|
property alias orientation: view.orientation
|
||||||
spacing: 12
|
|
||||||
|
|
||||||
contentItem: Item {
|
contentItem: ListView {
|
||||||
ListView {
|
|
||||||
id: view
|
id: view
|
||||||
anchors.centerIn: parent
|
|
||||||
implicitWidth: parent.width - 20
|
|
||||||
implicitHeight: parent.height - 20
|
|
||||||
model: control.contentModel
|
model: control.contentModel
|
||||||
currentIndex: control.currentIndex
|
currentIndex: control.currentIndex
|
||||||
spacing: control.spacing
|
spacing: control.spacing
|
||||||
orientation: ListView.Horizontal
|
orientation: ListView.Horizontal
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
background: Item {}
|
background: Item {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ TabButton {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
property alias radius: rectangle.radius
|
property alias radius: rectangle.radius
|
||||||
padding: 10
|
padding: 8
|
||||||
radius: Styling.theme.radiusField
|
radius: Styling.theme.radiusField
|
||||||
|
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
|
|
@ -15,7 +15,6 @@ TabButton {
|
||||||
text: control.text
|
text: control.text
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
padding: 6
|
|
||||||
color: control.hovered ? Styling.theme.primarycontent : Styling.theme.basecontent
|
color: control.hovered ? Styling.theme.primarycontent : Styling.theme.basecontent
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import qs.services
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
StyledPanelWindow {
|
StyledPanelWindow {
|
||||||
id: window
|
id: window
|
||||||
|
|
@ -13,21 +14,25 @@ StyledPanelWindow {
|
||||||
visible: Visibility.configuration
|
visible: Visibility.configuration
|
||||||
implicitWidth: 800
|
implicitWidth: 800
|
||||||
implicitHeight: 400
|
implicitHeight: 400
|
||||||
|
padding: 8
|
||||||
background.color: Styling.theme.base200
|
background.color: Styling.theme.base200
|
||||||
|
|
||||||
onFocusedChanged: {
|
onFocusedChanged: {
|
||||||
Visibility.configuration = focused;
|
Visibility.configuration = focused;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GridLayout {
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
StyledTabBar {
|
StyledTabBar {
|
||||||
id: tabs
|
id: tabs
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.right: view.left
|
|
||||||
|
|
||||||
implicitWidth: 150
|
Layout.preferredWidth: 150
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.margins: 2
|
||||||
orientation: ListView.Vertical
|
orientation: ListView.Vertical
|
||||||
|
spacing: 12
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: views.data
|
model: views.data
|
||||||
|
|
@ -65,13 +70,8 @@ StyledPanelWindow {
|
||||||
SwipeView {
|
SwipeView {
|
||||||
id: view
|
id: view
|
||||||
|
|
||||||
anchors.top: parent.top
|
Layout.fillWidth: true
|
||||||
anchors.right: parent.right
|
Layout.fillHeight: true
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: tabs.right
|
|
||||||
anchors.topMargin: 4
|
|
||||||
anchors.rightMargin: 4
|
|
||||||
anchors.bottomMargin: 4
|
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
orientation: Qt.Vertical
|
orientation: Qt.Vertical
|
||||||
|
|
@ -97,6 +97,7 @@ StyledPanelWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: views
|
id: views
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue