2020-09-24 09:57:54 +10:00
|
|
|
// 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
|
|
|
|
|
2019-07-17 02:37:11 +10:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
|
2019-12-09 05:43:41 +11:00
|
|
|
Page {
|
2020-06-05 19:42:12 +10:00
|
|
|
property bool useVariableSpacing: true
|
|
|
|
|
2019-07-17 02:37:11 +10:00
|
|
|
property int currentSpacing:
|
2020-06-05 19:42:12 +10:00
|
|
|
useVariableSpacing ?
|
2020-06-25 22:32:08 +10:00
|
|
|
Math.min(
|
|
|
|
theme.spacing * width / 400,
|
|
|
|
theme.spacing * height / 400,
|
|
|
|
theme.spacing,
|
|
|
|
) :
|
2020-06-05 19:42:12 +10:00
|
|
|
theme.spacing
|
2019-07-17 02:37:11 +10:00
|
|
|
|
2020-06-26 00:27:24 +10:00
|
|
|
signal keyboardAccept()
|
|
|
|
signal keyboardCancel()
|
|
|
|
|
2020-07-12 14:25:57 +10:00
|
|
|
padding: currentSpacing < theme.spacing ? 0 : currentSpacing
|
|
|
|
background: null
|
|
|
|
|
|
|
|
Keys.onReturnPressed: keyboardAccept()
|
|
|
|
Keys.onEnterPressed: keyboardAccept()
|
|
|
|
Keys.onEscapePressed: keyboardCancel()
|
|
|
|
|
2020-06-05 19:42:12 +10:00
|
|
|
Behavior on padding { HNumberAnimation {} }
|
2019-07-17 02:37:11 +10:00
|
|
|
}
|