2020-09-24 09:57:54 +10:00
|
|
|
// Copyright Mirage authors & contributors <https://github.com/mirukana/mirage>
|
2020-03-12 01:45:47 +11:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
2020-06-26 17:16:36 +10:00
|
|
|
import QtQuick.Controls 2.12
|
2020-03-28 22:18:00 +11:00
|
|
|
import "../ShortcutBundles"
|
2020-03-12 01:45:47 +11:00
|
|
|
|
|
|
|
HPage {
|
2020-06-05 19:42:12 +10:00
|
|
|
id: page
|
|
|
|
|
2020-03-12 01:45:47 +11:00
|
|
|
default property alias columnData: column.data
|
2020-07-12 14:25:57 +10:00
|
|
|
|
2020-06-05 19:42:12 +10:00
|
|
|
property alias column: column
|
|
|
|
property alias flickable: flickable
|
|
|
|
property alias flickShortcuts: flickShortcuts
|
|
|
|
|
2020-06-26 17:16:36 +10:00
|
|
|
property bool enableFlickShortcuts:
|
|
|
|
SwipeView ? SwipeView.isCurrentItem : true
|
|
|
|
|
2020-07-12 14:25:57 +10:00
|
|
|
implicitWidth: theme.controls.box.defaultWidth
|
2020-07-24 15:30:35 +10:00
|
|
|
implicitHeight: contentHeight + implicitHeaderHeight + implicitFooterHeight
|
2020-07-12 14:25:57 +10:00
|
|
|
contentHeight:
|
|
|
|
flickable.contentHeight + flickable.topMargin + flickable.bottomMargin
|
2020-03-12 01:45:47 +11:00
|
|
|
|
2020-07-12 14:25:57 +10:00
|
|
|
padding: 0
|
2020-03-12 01:45:47 +11:00
|
|
|
|
|
|
|
HFlickable {
|
|
|
|
id: flickable
|
|
|
|
anchors.fill: parent
|
|
|
|
contentWidth: parent.width
|
2020-06-25 22:32:08 +10:00
|
|
|
contentHeight: column.implicitHeight
|
2021-01-26 07:28:57 +11:00
|
|
|
flickableDirection: Flickable.VerticalFlick
|
2020-06-25 22:32:08 +10:00
|
|
|
clip: true
|
|
|
|
|
|
|
|
topMargin: theme.spacing
|
|
|
|
bottomMargin: topMargin
|
|
|
|
leftMargin: topMargin
|
|
|
|
rightMargin: topMargin
|
2020-03-12 01:45:47 +11:00
|
|
|
|
2020-03-28 22:18:00 +11:00
|
|
|
FlickShortcuts {
|
2020-06-05 19:42:12 +10:00
|
|
|
id: flickShortcuts
|
2020-06-26 17:16:36 +10:00
|
|
|
active: ! mainUI.debugConsole.visible && enableFlickShortcuts
|
2020-03-28 22:18:00 +11:00
|
|
|
flickable: flickable
|
|
|
|
}
|
|
|
|
|
2020-03-12 01:45:47 +11:00
|
|
|
HColumnLayout {
|
|
|
|
id: column
|
2020-06-25 22:32:08 +10:00
|
|
|
width:
|
|
|
|
flickable.width - flickable.leftMargin - flickable.rightMargin
|
|
|
|
spacing: theme.spacing * 1.5
|
2020-03-12 01:45:47 +11:00
|
|
|
}
|
|
|
|
}
|
2020-05-19 00:53:26 +10:00
|
|
|
|
2020-05-21 12:03:36 +10:00
|
|
|
HKineticScrollingDisabler {
|
2020-05-19 00:53:26 +10:00
|
|
|
flickable: flickable
|
2020-06-05 15:54:42 +10:00
|
|
|
width: enabled ? flickable.width : 0
|
|
|
|
height: enabled ? flickable.height : 0
|
2020-05-19 00:53:26 +10:00
|
|
|
}
|
2020-03-12 01:45:47 +11:00
|
|
|
}
|