Improve transitions and eliminate conflicting anchor warnings

This commit is contained in:
Cameron Gutman 2019-03-27 01:28:46 -07:00
parent 89c8725766
commit a079ecd20b
6 changed files with 17 additions and 17 deletions

View file

@ -8,15 +8,15 @@ import ComputerManager 1.0
GridView { GridView {
property int computerIndex property int computerIndex
property AppModel appModel : createModel() property AppModel appModel : createModel()
property bool activated
id: appGrid id: appGrid
focus: true focus: true
activeFocusOnTab: true activeFocusOnTab: true
anchors.fill: parent leftMargin: (parent.width % (cellWidth + rightMargin)) / 2
anchors.leftMargin: (parent.width % (cellWidth + anchors.rightMargin)) / 2 topMargin: 20
anchors.topMargin: 20 rightMargin: 5
anchors.rightMargin: 5 bottomMargin: 5
anchors.bottomMargin: 5
cellWidth: 225; cellHeight: 385; cellWidth: 225; cellHeight: 385;
function computerLost() function computerLost()
@ -34,10 +34,12 @@ GridView {
StackView.onActivated: { StackView.onActivated: {
appModel.computerLost.connect(computerLost) appModel.computerLost.connect(computerLost)
activated = true
} }
StackView.onDeactivating: { StackView.onDeactivating: {
appModel.computerLost.disconnect(computerLost) appModel.computerLost.disconnect(computerLost)
activated = false
} }
function createModel() function createModel()
@ -237,6 +239,12 @@ GridView {
} }
ScrollBar.vertical: ScrollBar { ScrollBar.vertical: ScrollBar {
// Manually hide the scrollbar to prevent it from being drawn on top
// of the StreamSegue during the transition. It can sometimes get stuck
// there since we're not consistently pumping the event loop while
// starting the stream.
visible: activated
parent: appGrid.parent parent: appGrid.parent
anchors { anchors {
top: appGrid.top top: appGrid.top

View file

@ -6,8 +6,6 @@ import ComputerManager 1.0
import Session 1.0 import Session 1.0
Item { Item {
anchors.fill: parent
function onSearchingComputer() { function onSearchingComputer() {
stageLabel.text = "Establishing connection to PC..." stageLabel.text = "Establishing connection to PC..."
} }

View file

@ -14,11 +14,10 @@ GridView {
id: pcGrid id: pcGrid
focus: true focus: true
activeFocusOnTab: true activeFocusOnTab: true
anchors.fill: parent leftMargin: (parent.width % (cellWidth + rightMargin)) / 2
anchors.leftMargin: (parent.width % (cellWidth + anchors.rightMargin)) / 2 topMargin: 20
anchors.topMargin: 20 rightMargin: 5
anchors.rightMargin: 5 bottomMargin: 5
anchors.bottomMargin: 5
cellWidth: 350; cellHeight: 350; cellWidth: 350; cellHeight: 350;
objectName: "Computers" objectName: "Computers"

View file

@ -12,8 +12,6 @@ Item {
property string stageText : "Quitting " + appName + "..." property string stageText : "Quitting " + appName + "..."
anchors.fill: parent
function quitAppCompleted(error) function quitAppCompleted(error)
{ {
// Display a failed dialog if we got an error // Display a failed dialog if we got an error

View file

@ -9,7 +9,6 @@ import SystemProperties 1.0
Flickable { Flickable {
id: settingsPage id: settingsPage
objectName: "Settings" objectName: "Settings"
anchors.fill: parent
contentWidth: settingsColumn1.width > settingsColumn2.width ? settingsColumn1.width : settingsColumn2.width contentWidth: settingsColumn1.width > settingsColumn2.width ? settingsColumn1.width : settingsColumn2.width
contentHeight: settingsColumn1.height > settingsColumn2.height ? settingsColumn1.height : settingsColumn2.height contentHeight: settingsColumn1.height > settingsColumn2.height ? settingsColumn1.height : settingsColumn2.height

View file

@ -13,8 +13,6 @@ Item {
property string stageText : "Starting " + appName + "..." property string stageText : "Starting " + appName + "..."
property bool quitAfter : false property bool quitAfter : false
anchors.fill: parent
function stageStarting(stage) function stageStarting(stage)
{ {
// Update the spinner text // Update the spinner text