moment/src/gui/Base/HPage.qml

31 lines
776 B
QML
Raw Normal View History

// Copyright Mirage authors & contributors <https://github.com/mirukana/mirage>
2019-12-19 22:46:16 +11:00
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import QtQuick.Controls 2.12
Page {
property bool useVariableSpacing: true
property int currentSpacing:
useVariableSpacing ?
Math.min(
theme.spacing * width / 400,
theme.spacing * height / 400,
theme.spacing,
) :
theme.spacing
signal keyboardAccept()
signal keyboardCancel()
padding: currentSpacing < theme.spacing ? 0 : currentSpacing
background: null
Keys.onReturnPressed: keyboardAccept()
Keys.onEnterPressed: keyboardAccept()
Keys.onEscapePressed: keyboardCancel()
Behavior on padding { HNumberAnimation {} }
}