Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 39c9c8f9 authored by Camilo Higuita's avatar Camilo Higuita

structure

parent 16c8d60c
import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 2.2
import org.kde.kirigami 2.0 as Kirigami
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Kirigami.ApplicationWindow
{
id: root
property int defaultColumnWidth: Kirigami.Units.gridUnit * 13
property int columnWidth: defaultColumnWidth
pageStack.defaultColumnWidth: columnWidth
pageStack.initialPage: [firstPageComponent, secondPageComponent]
MouseArea
{
id: dragHandle
visible: pageStack.wideMode
anchors.top: parent.top
anchors.bottom: parent.bottom
x: columnWidth - (width / 2)
width: Kirigami.Units.devicePixelRatio * 2
property int dragRange: (Kirigami.Units.gridUnit * 5)
property int _lastX: -1
cursorShape: Qt.SplitHCursor
onPressed: _lastX = mouseX
onPositionChanged:
{
if (mouse.x > _lastX)
{
columnWidth = Math.min((defaultColumnWidth + dragRange),
columnWidth + (mouse.x - _lastX));
} else if (mouse.x < _lastX)
{
columnWidth = Math.max((defaultColumnWidth - dragRange),
columnWidth - (_lastX - mouse.x));
}
}
Rectangle
{
anchors.fill: parent
color: "blue"
}
}
Component
{
id: firstPageComponent
Kirigami.Page
{
id: firstPage
background: Rectangle { color: "red" }
}
}
Component
{
id: secondPageComponent
SwipeView
{
id: secondPage
clip: true
background: Rectangle { color: "green" }
currentIndex: 1
anchors.fill: parent
Item {
id: firstPage
Label
{
text: "hahaha"
}
}
Item {
id: thirdPage
Label
{
text: "jajaja"
}
}
}
}
}
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>view_models/PixViewer.qml</file>
<file>view_models/PixGrid.qml</file>
<file>widgets/Viewer.qml</file>
<file>widgets/TagsView.qml</file>
<file>widgets/GalleryView.qml</file>
<file>widgets/EditTools.qml</file>
<file>widgets/AlbumsView.qml</file>
</qresource>
</RCC>
import QtQuick 2.3
Text
{
id: text
property string iconColor
property int iconSize
font.family: "Material Design Icons"
font.pixelSize: iconSize || 24
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
This diff is collapsed.
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