Put keyboard at bottom of scrolling dialogs rather than under controls

This commit is contained in:
David Rowe 2016-09-24 11:40:38 +12:00
parent e1164edfde
commit 52137cb3c1
7 changed files with 65 additions and 203 deletions

View file

@ -6,7 +6,6 @@ import "controls-uit"
import "styles" as HifiStyles
import "styles-uit"
import "windows"
import "controls" as Controls
ScrollingWindow {
id: root
@ -53,9 +52,6 @@ ScrollingWindow {
width: pane.contentWidth
implicitHeight: pane.scrollHeight
property bool keyboardRaised: false
property bool punctuationMode: false
Row {
id: buttons
spacing: 4
@ -206,7 +202,7 @@ ScrollingWindow {
url: "https://highfidelity.com"
anchors.top: buttons.bottom
anchors.topMargin: 8
anchors.bottom: keyboard1.top
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
onFeaturePermissionRequested: {
@ -238,37 +234,6 @@ ScrollingWindow {
profile: desktop.browserProfile
}
// virtual keyboard, letters
Controls.Keyboard {
id: keyboard1
// y: parent.keyboardRaised ? parent.height : 0
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && !parent.punctuationMode
enabled: parent.keyboardRaised && !parent.punctuationMode
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
// anchors.bottomMargin: 2 * hifi.dimensions.contentSpacing.y
}
Controls.KeyboardPunctuation {
id: keyboard2
// y: parent.keyboardRaised ? parent.height : 0
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && parent.punctuationMode
enabled: parent.keyboardRaised && parent.punctuationMode
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
// anchors.bottomMargin: 2 * hifi.dimensions.contentSpacing.y
}
} // item

View file

@ -97,9 +97,9 @@ ScrollingWindow {
footer: Row {
anchors {
right: parent.right;
top: parent.top
right: parent.right
rightMargin: hifi.dimensions.contentMargin.x
verticalCenter: parent.verticalCenter
}
spacing: hifi.dimensions.contentSpacing.x

View file

@ -12,7 +12,6 @@ import QtQuick 2.5
import "../../dialogs"
import "../../controls-uit"
import "../../controls" as Controls
Preference {
id: root
@ -54,16 +53,12 @@ Preference {
Item {
id: control
property bool keyboardRaised: false
property bool punctuationMode: false
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
height: Math.max(dataTextField.controlHeight, button.height) + (keyboardRaised ? 200 : 0)
height: Math.max(dataTextField.controlHeight, button.height)
TextField {
id: dataTextField
@ -74,7 +69,7 @@ Preference {
left: parent.left
right: button.left
rightMargin: hifi.dimensions.contentSpacing.x
bottom: keyboard1.top
bottom: parent.bottom
}
colorScheme: hifi.colorSchemes.dark
}
@ -99,35 +94,5 @@ Preference {
}
}
// virtual keyboard, letters
Controls.Keyboard {
id: keyboard1
// y: parent.keyboardRaised ? parent.height : 0
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && !parent.punctuationMode
enabled: parent.keyboardRaised && !parent.punctuationMode
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
// anchors.bottomMargin: 2 * hifi.dimensions.contentSpacing.y
}
Controls.KeyboardPunctuation {
id: keyboard2
// y: parent.keyboardRaised ? parent.height : 0
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && parent.punctuationMode
enabled: parent.keyboardRaised && parent.punctuationMode
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
// anchors.bottomMargin: 2 * hifi.dimensions.contentSpacing.y
}
}
}

View file

@ -12,8 +12,6 @@ import QtQuick 2.5
import "../../dialogs"
import "../../controls-uit"
import "../../controls" as Controls
Preference {
id: root
@ -32,16 +30,12 @@ Preference {
Item {
id: control
property bool keyboardRaised: false
property bool punctuationMode: false
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
height: Math.max(dataTextField.controlHeight, button.height) + (keyboardRaised ? 200 : 0)
height: Math.max(dataTextField.controlHeight, button.height)
TextField {
id: dataTextField
@ -50,7 +44,7 @@ Preference {
left: parent.left
right: button.left
rightMargin: hifi.dimensions.contentSpacing.x
bottom: keyboard1.top
bottom: parent.bottom
}
label: root.label
@ -81,36 +75,5 @@ Preference {
});
}
}
// virtual keyboard, letters
Controls.Keyboard {
id: keyboard1
// y: parent.keyboardRaised ? parent.height : 0
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && !parent.punctuationMode
enabled: parent.keyboardRaised && !parent.punctuationMode
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
// anchors.bottomMargin: 2 * hifi.dimensions.contentSpacing.y
}
Controls.KeyboardPunctuation {
id: keyboard2
// y: parent.keyboardRaised ? parent.height : 0
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && parent.punctuationMode
enabled: parent.keyboardRaised && parent.punctuationMode
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
// anchors.bottomMargin: 2 * hifi.dimensions.contentSpacing.y
}
}
}

View file

@ -12,11 +12,10 @@ import QtQuick 2.5
import "../../dialogs"
import "../../controls-uit"
import "../../controls" as Controls
Preference {
id: root
height: dataTextField.controlHeight + hifi.dimensions.controlInterlineHeight + (editablePreferenceColumn.keyboardRaised ? 200 : 0)
height: dataTextField.controlHeight + hifi.dimensions.controlInterlineHeight
Component.onCompleted: {
dataTextField.text = preference.value;
@ -27,61 +26,16 @@ Preference {
preference.save();
}
Column {
id: editablePreferenceColumn
height: dataTextField.height + (keyboardRaised ? 200 : 0)
property bool keyboardRaised: false
property bool punctuationMode: false
TextField {
id: dataTextField
placeholderText: preference.placeholderText
label: root.label
colorScheme: hifi.colorSchemes.dark
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
TextField {
id: dataTextField
placeholderText: preference.placeholderText
label: root.label
colorScheme: hifi.colorSchemes.dark
anchors {
left: parent.left
right: parent.right
// bottom: keyboard1.bottom
}
}
// virtual keyboard, letters
Controls.Keyboard {
id: keyboard1
// y: parent.keyboardRaised ? parent.height : 0
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && !parent.punctuationMode
enabled: parent.keyboardRaised && !parent.punctuationMode
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
// anchors.bottom: parent.bottom
// anchors.bottomMargin: 0
// anchors.bottomMargin: 2 * hifi.dimensions.contentSpacing.y
}
Controls.KeyboardPunctuation {
id: keyboard2
// y: parent.keyboardRaised ? parent.height : 0
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && parent.punctuationMode
enabled: parent.keyboardRaised && parent.punctuationMode
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
// anchors.bottom: parent.bottom
// anchors.bottomMargin: 0
// anchors.bottomMargin: 2 * hifi.dimensions.contentSpacing.y
}
}
}

View file

@ -16,7 +16,6 @@ import Qt.labs.settings 1.0
import "../../styles-uit"
import "../../controls-uit" as HifiControls
import "../../windows"
import "../../controls"
ScrollingWindow {
id: root
@ -24,8 +23,8 @@ ScrollingWindow {
title: "Running Scripts"
resizable: true
destroyOnHidden: true
implicitWidth: 480
implicitHeight: (isHMD ? 695 : 728) + (runningScriptsColumn.keyboardRaised ? 200 + (2 * hifi.dimensions.contentSpacing.y) : 0)
implicitWidth: 424
implicitHeight: isHMD ? 695 : 728
minSize: Qt.vector2d(424, 300)
HifiConstants { id: hifi }
@ -93,11 +92,6 @@ ScrollingWindow {
}
Column {
id: runningScriptsColumn
property bool keyboardRaised: false
property bool punctuationMode: false
width: pane.contentWidth
HifiControls.ContentSection {
@ -359,28 +353,6 @@ ScrollingWindow {
visible: !isHMD
}
}
// virtual keyboard, letters
Keyboard {
id: keyboard1
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && !parent.punctuationMode
enabled: parent.keyboardRaised && !parent.punctuationMode
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
}
KeyboardPunctuation {
id: keyboard2
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && parent.punctuationMode
enabled: parent.keyboardRaised && parent.punctuationMode
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
}
}
}

View file

@ -15,6 +15,7 @@ import QtGraphicalEffects 1.0
import "."
import "../styles-uit"
import "../controls" as HiFiControls
// FIXME how do I set the initial position of a window without
// overriding places where the a individual client of the window
@ -23,6 +24,7 @@ import "../styles-uit"
// FIXME how to I enable dragging without allowing the window to lay outside
// of the desktop? How do I ensure when the desktop resizes all the windows
// are still at least partially visible?
Window {
id: window
HifiConstants { id: hifi }
@ -30,6 +32,9 @@ Window {
property var footer: Item { } // Optional static footer at the bottom of the dialog.
property bool keyboardRaised: false
property bool punctuationMode: false
// Scrollable window content.
// FIXME this should not define any visual content in this type. The base window
// type should only consist of logic sized areas, with nothing drawn (although the
@ -73,7 +78,7 @@ Window {
verticalScrollBarPolicy: Qt.ScrollBarAsNeeded
anchors.fill: parent
anchors.rightMargin: parent.isScrolling ? 1 : 0
anchors.bottomMargin: footer.height > 0 ? footerPane.height : 0
anchors.bottomMargin: footerPane.height
style: ScrollViewStyle {
@ -119,18 +124,28 @@ Window {
Rectangle {
// Optional non-scrolling footer.
id: footerPane
property alias keyboardRaised: window.keyboardRaised
property alias punctuationMode: window.punctuationMode
anchors {
left: parent.left
bottom: parent.bottom
}
width: parent.contentWidth
height: footer.height + 2 * hifi.dimensions.contentSpacing.y + 3
height: (footer.height > 0 ? footer.height + 2 * hifi.dimensions.contentSpacing.y + 3 : 0) + (keyboardRaised ? 200 : 0)
color: hifi.colors.baseGray
visible: footer.height > 0
visible: footer.height > 0 || keyboardRaised
Item {
// Horizontal rule.
anchors.fill: parent
anchors {
top: parent.top
left: parent.left
right: parent.right
}
visible: footer.height > 0
Rectangle {
width: parent.width
@ -148,10 +163,38 @@ Window {
}
Item {
anchors.fill: parent
anchors.topMargin: 3 // Horizontal rule.
anchors {
left: parent.left
right: parent.right
top: parent.top
topMargin: hifi.dimensions.contentSpacing.y + 3
}
children: [ footer ]
}
HiFiControls.Keyboard {
id: keyboard1
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && !parent.punctuationMode
enabled: parent.keyboardRaised && !parent.punctuationMode
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
}
HiFiControls.KeyboardPunctuation {
id: keyboard2
height: parent.keyboardRaised ? 200 : 0
visible: parent.keyboardRaised && parent.punctuationMode
enabled: parent.keyboardRaised && parent.punctuationMode
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
}
}
}
}