Refactor some tablet dialog headers

This commit is contained in:
David Rowe 2017-03-11 16:55:22 +13:00
parent 74839b24a3
commit 6a8d0b1064
4 changed files with 56 additions and 76 deletions

View file

@ -0,0 +1,45 @@
//
// TabletHeader.qml
//
// Created by David Rowe on 11 Mar 2017.
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
//
import QtQuick 2.5
import QtQuick.Controls 1.4
import "../styles-uit"
Rectangle {
property string title: ""
HifiConstants { id: hifi }
height: hifi.dimensions.tabletMenuHeader
z: 100
gradient: Gradient {
GradientStop {
position: 0
color: "#2b2b2b"
}
GradientStop {
position: 1
color: "#1e1e1e"
}
}
RalewayBold {
text: title
size: 26
color: "#34a2c7"
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: hifi.dimensions.contentMargin.x
}
}

View file

@ -38,39 +38,17 @@ Item {
Tablet.getTablet("com.highfidelity.interface.tablet.system").gotoHomeScreen();
}
anchors.topMargin: 90 // Space for header.
anchors.topMargin: hifi.dimensions.tabletMenuHeader // Space for header.
// FIXME: Refactor with other tablet headers.
Rectangle {
HifiControls.TabletHeader {
id: header
height: 90
title: root.title
anchors {
left: parent.left
right: parent.right
bottom: parent.top
}
z: 100
gradient: Gradient {
GradientStop {
position: 0
color: "#2b2b2b"
}
GradientStop {
position: 1
color: "#1e1e1e"
}
}
RalewayBold {
text: title
size: 26
color: "#34a2c7"
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: hifi.dimensions.contentMargin.x
}
}
AttachmentsContent {

View file

@ -37,39 +37,17 @@ Item {
anchors.fill: parent
}
anchors.topMargin: 90 // Space for header.
anchors.topMargin: hifi.dimensions.tabletMenuHeader // Space for header.
// FIXME: Refactor with other tablet headers.
Rectangle {
HifiControls.TabletHeader {
id: header
height: 90
title: parent.title
anchors {
left: parent.left
right: parent.right
bottom: parent.top
}
z: 100
gradient: Gradient {
GradientStop {
position: 0
color: "#2b2b2b"
}
GradientStop {
position: 1
color: "#1e1e1e"
}
}
RalewayBold {
text: title
size: 26
color: "#34a2c7"
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: hifi.dimensions.contentMargin.x
}
}
ModelBrowserContent {

View file

@ -58,36 +58,15 @@ Item {
Tablet.getTablet("com.highfidelity.interface.tablet.system").gotoHomeScreen();
}
Rectangle {
HifiControls.TabletHeader {
id: header
height: 90
title: parent.title
anchors {
top: parent.top
left: parent.left
right: parent.right
}
z: 100
gradient: Gradient {
GradientStop {
position: 0
color: "#2b2b2b"
}
GradientStop {
position: 1
color: "#1e1e1e"
}
}
RalewayBold {
text: title
size: 26
color: "#34a2c7"
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: hifi.dimensions.contentMargin.x
}
}
Rectangle {