overte/interface/resources/qml/windows/ToolFrameDecoration.qml
Alexander Ivash 27bb8a0de7 rename stylues-uit => stylesUit & controls-uit => controlsUit
note:
the idea is to make imports like 'import controlsUit 1.0' to work
with 'styles-uit'/'controls-uit' it is not possible because of two reasons:

1. import controls-uit 1.0 is invalid syntax
2. qmldir inside controls-uit is 'module controlsUit'
2018-11-06 14:21:14 +05:30

96 lines
2.5 KiB
QML

//
// DefaultFrame.qml
//
// Created by Bradley Austin Davis on 12 Jan 2016
// Copyright 2016 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
import QtQuick 2.5
import QtGraphicalEffects 1.0
import "."
import stylesUit 1.0
Decoration {
id: root
HifiConstants { id: hifi }
property bool horizontalSpacers: false
property bool verticalSpacers: false
// Dialog frame
property int spacerWidth: 8
property int spacerRadius: 4
property int spacerMargin: 12
frameMargin: 6
frameMarginLeft: frameMargin + (horizontalSpacers ? spacerMargin : 0)
frameMarginRight: frameMargin + (horizontalSpacers ? spacerMargin : 0)
frameMarginTop: frameMargin + (verticalSpacers ? spacerMargin : 0)
frameMarginBottom: frameMargin + (verticalSpacers ? spacerMargin : 0)
radius: hifi.dimensions.borderRadius / 2
onInflateDecorations: {
if (!HMD.active) {
return;
}
root.frameMargin = 18
root.spacerWidth = 16
root.spacerRadius = 8
root.spacerMargin = 8
}
onDeflateDecorations: {
root.frameMargin = 6
root.spacerWidth = 8
root.spacerRadius = 4
root.spacerMargin = 12
}
Rectangle {
visible: horizontalSpacers
anchors.left: parent.left
anchors.leftMargin: 6
anchors.verticalCenter: parent.verticalCenter
width: root.spacerWidth
height: decoration.height - 12
color: "gray";
radius: root.spacerRadius
}
Rectangle {
visible: horizontalSpacers
anchors.right: parent.right
anchors.rightMargin: 6
anchors.verticalCenter: parent.verticalCenter
width: root.spacerWidth
height: decoration.height - 12
color: "gray";
radius: root.spacerRadius
}
Rectangle {
visible: verticalSpacers
anchors.top: parent.top
anchors.topMargin: 6
anchors.horizontalCenter: parent.horizontalCenter
height: root.spacerWidth
width: decoration.width - 12
color: "gray";
radius: root.spacerRadius
}
Rectangle {
visible: verticalSpacers
anchors.bottom: parent.bottom
anchors.bottomMargin: 6
anchors.horizontalCenter: parent.horizontalCenter
height: root.spacerWidth
width: decoration.width - 12
color: "gray";
radius: root.spacerRadius
}
}