Transport.qml: Worked a bit on the style and layout of the Public Transportation module, added logo images
This commit is contained in:
parent
646ea482e5
commit
07a904dd75
3 changed files with 76 additions and 48 deletions
BIN
Transport.png
Normal file
BIN
Transport.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
124
Transport.qml
124
Transport.qml
|
@ -43,66 +43,94 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TableView {
|
RowLayout {
|
||||||
id: tableView
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
model: lineModel
|
|
||||||
frameVisible: false
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Rectangle {
|
||||||
console.log(root.width)
|
id: logo
|
||||||
console.log(tableView.width)
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
height: 100
|
||||||
|
color: "black"
|
||||||
|
Image {
|
||||||
|
source: "Transport.png"
|
||||||
|
anchors.fill: parent
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
style: TableViewStyle {
|
|
||||||
backgroundColor: "black"
|
|
||||||
alternateBackgroundColor: "black"
|
|
||||||
|
|
||||||
headerDelegate: Rectangle {
|
Rectangle {
|
||||||
height: textItem.implicitHeight
|
anchors.left: parent.left
|
||||||
width: textItem.implicitWidth
|
anchors.right: parent.right
|
||||||
color: "black"
|
anchors.top: logo.bottom
|
||||||
Text {
|
anchors.bottom: parent.bottom
|
||||||
id: textItem
|
|
||||||
horizontalAlignment: Text.AlignLeft
|
TableView {
|
||||||
text: styleData.value
|
id: tableView
|
||||||
font.bold: true
|
anchors.fill: parent
|
||||||
color: "white"
|
model: lineModel
|
||||||
}
|
frameVisible: false
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
console.log(root.width)
|
||||||
|
console.log(tableView.width)
|
||||||
}
|
}
|
||||||
|
|
||||||
itemDelegate: Rectangle {
|
style: TableViewStyle {
|
||||||
color: "black"
|
backgroundColor: "black"
|
||||||
|
alternateBackgroundColor: "black"
|
||||||
|
|
||||||
Text {
|
headerDelegate: Rectangle {
|
||||||
id: itemText
|
height: textItem.implicitHeight
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
width: textItem.implicitWidth
|
||||||
color: "white"
|
color: "black"
|
||||||
text: styleData.value
|
Text {
|
||||||
|
id: textItem
|
||||||
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
text: styleData.value
|
||||||
|
font.bold: true
|
||||||
|
color: "white"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemDelegate: Rectangle {
|
||||||
|
color: "black"
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: itemText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
color: "white"
|
||||||
|
text: styleData.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TableViewColumn {
|
||||||
|
role: "number"
|
||||||
|
title: "No"
|
||||||
|
width: tableView.width / 6
|
||||||
|
}
|
||||||
|
TableViewColumn {
|
||||||
|
role: "destination"
|
||||||
|
title: "Destination"
|
||||||
|
width: (tableView.width / 6) * 3
|
||||||
|
}
|
||||||
|
TableViewColumn {
|
||||||
|
role: "arriving"
|
||||||
|
title: "Arriving"
|
||||||
|
width: tableView.width / 6
|
||||||
|
}
|
||||||
|
TableViewColumn {
|
||||||
|
role: "next"
|
||||||
|
title: "Next"
|
||||||
|
width: (tableView.width / 6)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TableViewColumn {
|
|
||||||
role: "number"
|
|
||||||
title: "No"
|
|
||||||
width: tableView.width / 6
|
|
||||||
}
|
|
||||||
TableViewColumn {
|
|
||||||
role: "destination"
|
|
||||||
title: "Destination"
|
|
||||||
width: (tableView.width / 6) * 3
|
|
||||||
}
|
|
||||||
TableViewColumn {
|
|
||||||
role: "arriving"
|
|
||||||
title: "Arriving"
|
|
||||||
width: tableView.width / 6
|
|
||||||
}
|
|
||||||
TableViewColumn {
|
|
||||||
role: "next"
|
|
||||||
title: "Next"
|
|
||||||
width: (tableView.width / 6)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
Transport.xcf
Normal file
BIN
Transport.xcf
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue