Use a SplitView in GridView, so the user can resize the comic info view.

This commit is contained in:
Luis Ángel San Martín 2016-04-18 13:28:08 +02:00
parent 1285b46a4c
commit 771597e4f4

View File

@ -1,13 +1,21 @@
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 1.2 import QtQuick.Controls 1.4
import QtQuick.Layouts 1.2
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import com.yacreader.ComicModel 1.0 import com.yacreader.ComicModel 1.0
Rectangle { SplitView {
anchors.fill: parent anchors.fill: parent
orientation: Qt.Horizontal
handleDelegate:Rectangle {
width: 1
height: 1
color: "#202020"
}
Rectangle { Rectangle {
id: main id: main
@ -36,6 +44,7 @@ Rectangle {
color: backgroundColor color: backgroundColor
width: parent.width - (info_container.visible ? info_container.width : 0) width: parent.width - (info_container.visible ? info_container.width : 0)
Layout.fillWidth: true
height: parent.height height: parent.height
anchors.margins: 0 anchors.margins: 0
@ -581,9 +590,9 @@ Rectangle {
} }
Rectangle { Rectangle {
id: info_container id: info_container
width: 350 Layout.preferredWidth: 350
y: 0 Layout.minimumWidth: 350
x: main.width Layout.maximumWidth: 960
height: parent.height height: parent.height
color: "#2e2e2e" color: "#2e2e2e"
@ -620,7 +629,6 @@ Rectangle {
ComicInfo { ComicInfo {
width: info_container.width width: info_container.width
height: 2048
} }
} }
} }