Skip to content
FloatButton.qml 2.84 KiB
Newer Older
/*
    This file is part of Gabriel's Qt/QML CardBoard Sample (or short GQQCS)

    GQQCS is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    GQQCS is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar.  If not, see <http://www.gnu.org/licenses/>.

    Updated: 07/08/2015 by: Gabriel F.
*/

import QtQuick 2.4

Rectangle {
    id: b1T
    width: parent.width*0.063
    height: width
    x: parent.width*0.129
    y: parent.height*0.202
    color: "#00000000"
    border.width: 0
    border.color: "#ffffff"
    radius: width*0.5

    property string titulo: "Elasticidade"
    property string descricao: "Elasticidade"
    property string imageFile: "qrc:/images/Icon_Elastica.svg"
    property string video: "videoteste.mp4"
    property string nome: "Logo"
    property double loading: 0
    property bool showImage: true
    property int  videoCountdown: 60
    property bool useTop: false
    onLoadingChanged: { logoLoadingBar.width = 1.0*loading*width }
    property bool pressed: false

    function zero() { loading = 0; border.width = 0 }

    Image {
        fillMode: Image.PreserveAspectFit
        anchors.fill: parent
        source: imageFile
        sourceSize.width: width
        sourceSize.height: height
        anchors.centerIn: parent
        scale: 0.6
        visible: showImage
    }

    Rectangle {
        id: logoLoadingBar
        width: 0
        height: parent.width*0.05
        color: "white"
        anchors.top: parent.bottom
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.topMargin: height*0.5
    }

    Text {
        id: explicacao_Bottom
        text: descricao
        width: parent.width*1.5
        wrapMode: Text.WordWrap
        font.bold: true
        horizontalAlignment: Text.AlignHCenter
        font.pixelSize: parent.height*0.15
        color: "white"
        anchors.top: logoLoadingBar.bottom
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.topMargin: height*0.2
        visible: !useTop
    }

    Text {
        id: explicacao_Top
        text: descricao
        width: parent.width*1.5
        wrapMode: Text.WordWrap
        font.bold: true
        horizontalAlignment: Text.AlignHCenter
        font.pixelSize: parent.height*0.15
        color: "white"
        anchors.bottom: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.bottomMargin: logoLoadingBar.height
        visible: useTop
    }
}