subsurface/mobile-widgets/qml/TemplateSection.qml
jan Iversen 3ff65dd7cf mobile-widgets: update design of TemplateSection
Update size and colors.

Changing the TemplateSection, automatically changes all sections
in the system, converted to the new layout.

The styling would be better in a style/theme class, but
subsurfaceTheme is in main.qml and not in a C++ class, so for now
use primitive styling.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-25 17:25:54 -08:00

36 lines
764 B
QML

// SPDX-License-Identifier: GPL-2.0
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.11
Column {
width: parent.width
property string title: "no title"
property bool isExpanded: false
Button {
width: parent.width
background: Rectangle {
id: buttonBackground
antialiasing: true
height: buttonText.height + 2
width: parent.width
border.color: "black"
border.width: 1
color: subsurfaceTheme.backgroundColor
opacity: 0.5
}
contentItem: Text {
id: buttonText
font.pointSize: subsurfaceTheme.regularPointSize
anchors.centerIn: buttonBackground
color: subsurfaceTheme.textColor
text: (isExpanded ? "- " : "+ ") + title
font.bold: true
}
onClicked: {
isExpanded = !isExpanded
}
}
}