Commit dadd06f6 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Cleanup monitor overlay toolbars and switch to QtQuick2 only

parent cb9cba9d
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls 2.4
import QtQuick 2.11
Rectangle {
id: effecttoolbar
objectName: "effecttoolbar"
width: fullscreenButton.width
MouseArea {
id: barZone
hoverEnabled: true
property bool rightSide: true
property bool barContainsMouse
property bool showAutoKeyframe: false
height: childrenRect.height
color: Qt.rgba(activePalette.window.r, activePalette.window.g, activePalette.window.b, 0.7)
radius: 4
border.color : Qt.rgba(0, 0, 0, 0.3)
border.width: 1
Timer {
id: fadeTimer
interval: 2500; running: false;
onTriggered: {
effecttoolbar.visible = false
effecttoolbar.opacity = 1
}
property bool showAutoKeyframe: true
acceptedButtons: Qt.NoButton
width: fullscreenButton.width + root.baseUnit
height: parent.height
onEntered: {
animator.stop()
effecttoolbar.opacity = 1
}
OpacityAnimator {
id: animator
target: effecttoolbar;
from: 1;
to: 0;
duration: 2500
running: false
onExited: {
effecttoolbar.opacity = 0
}
function fadeBar()
{
effecttoolbar.visible = true
animator.start()
fadeTimer.start()
}
Rectangle {
id: effecttoolbar
objectName: "effecttoolbar"
width: fullscreenButton.width
anchors.right: barZone.right
height: childrenRect.height
color: Qt.rgba(activePalette.window.r, activePalette.window.g, activePalette.window.b, 0.7)
opacity: 0
radius: 4
border.color : Qt.rgba(0, 0, 0, 0.3)
border.width: 1
OpacityAnimator {
id: animator
target: effecttoolbar;
from: 1;
to: 0;
duration: 2500
running: false
}
Column {
ToolButton {
id: fullscreenButton
objectName: "fullScreen"
iconName: "view-fullscreen"
tooltip: i18n("Switch Full Screen")
onClicked: controller.triggerAction('monitor_fullscreen')
function fadeBar()
{
animator.start()
}
ToolButton {
objectName: "switchOverlay"
iconName: "view-grid"
tooltip: i18n("Change Overlay")
onClicked: {
if (controller.overlayType >= 5) {
controller.overlayType = 0
} else {
controller.overlayType = controller.overlayType + 1;
Column {
ToolButton {
id: fullscreenButton
objectName: "fullScreen"
icon.name: "view-fullscreen"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Switch Full Screen")
ToolTip.timeout: 3000
onClicked: controller.triggerAction('monitor_fullscreen')
}
ToolButton {
objectName: "switchOverlay"
icon.name: "view-grid"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Change Overlay")
ToolTip.timeout: 3000
onClicked: {
if (controller.overlayType >= 5) {
controller.overlayType = 0
} else {
controller.overlayType = controller.overlayType + 1;
}
root.overlayType = controller.overlayType
}
root.overlayType = controller.overlayType
}
}
ToolButton {
objectName: "nextKeyframe"
iconName: "go-next"
tooltip: "Go to Next Keyframe"
onClicked: controller.seekNextKeyframe()
}
ToolButton {
objectName: "prevKeyframe"
iconName: "go-previous"
tooltip: i18n("Go to Previous Keyframe")
onClicked: controller.seekPreviousKeyframe()
}
ToolButton {
objectName: "addKeyframe"
iconName: "list-add"
tooltip: i18n("Add/Remove Keyframe")
onClicked: controller.addRemoveKeyframe()
}
ToolButton {
iconName: "zoom-in"
tooltip: i18n("Zoom in")
onClicked: controller.triggerAction('monitor_zoomin')
}
ToolButton {
iconName: "zoom-out"
tooltip: i18n("Zoom out")
onClicked: controller.triggerAction('monitor_zoomout')
}
ToolButton {
iconName: "media-record"
tooltip: i18n("Automatic Keyframes")
onClicked: controller.switchAutoKeyframe()
checkable: true
checked: controller.autoKeyframe
visible: showAutoKeyframe
}
ToolButton {
objectName: "moveBar"
iconName: "transform-move-horizontal"
tooltip: i18n("Move Toolbar")
onClicked: {
if (effecttoolbar.rightSide) {
effecttoolbar.anchors.right = undefined
effecttoolbar.anchors.left = effecttoolbar.parent.left
effecttoolbar.rightSide = false
fadeBar()
} else {
effecttoolbar.anchors.left = undefined
effecttoolbar.anchors.right = effecttoolbar.parent.right
effecttoolbar.rightSide = true
fadeBar()
ToolButton {
objectName: "nextKeyframe"
icon.name: "go-next"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Go to Next Keyframe")
ToolTip.timeout: 3000
onClicked: controller.seekNextKeyframe()
}
ToolButton {
objectName: "prevKeyframe"
icon.name: "go-previous"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Go to Previous Keyframe")
ToolTip.timeout: 3000
onClicked: controller.seekPreviousKeyframe()
}
ToolButton {
objectName: "addKeyframe"
icon.name: "list-add"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Add/Remove Keyframe")
ToolTip.timeout: 3000
onClicked: controller.addRemoveKeyframe()
}
ToolButton {
icon.name: "zoom-in"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Zoom in")
ToolTip.timeout: 3000
onClicked: controller.triggerAction('monitor_zoomin')
}
ToolButton {
icon.name: "zoom-out"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Zoom out")
ToolTip.timeout: 3000
onClicked: controller.triggerAction('monitor_zoomout')
}
ToolButton {
icon.name: "media-record"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Automatic Keyframes")
ToolTip.timeout: 3000
onClicked: controller.switchAutoKeyframe()
checkable: true
checked: controller.autoKeyframe
visible: barZone.showAutoKeyframe
}
ToolButton {
objectName: "moveBar"
icon.name: "transform-move-horizontal"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Move Toolbar")
ToolTip.timeout: 3000
onClicked: {
if (barZone.rightSide) {
barZone.anchors.right = undefined
barZone.anchors.left = barZone.parent.left
barZone.rightSide = false
effecttoolbar.anchors.right = undefined
effecttoolbar.anchors.left = barZone.left
effecttoolbar.fadeBar()
} else {
barZone.anchors.left = undefined
barZone.anchors.right = barZone.parent.right
barZone.rightSide = true
effecttoolbar.anchors.left = undefined
effecttoolbar.anchors.right = barZone.right
effecttoolbar.fadeBar()
}
}
}
}
......
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.11
import QtQuick.Controls 2.4
import QtQuick 2.11
Rectangle {
id: scenetoolbar
MouseArea {
id: barZone
hoverEnabled: true
property bool rightSide: true
objectName: "scenetoolbar"
width: fullscreenButton.width
height: barZone.childrenRect.height
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
color: Qt.rgba(myPalette.window.r, myPalette.window.g, myPalette.window.b, 0.7)
radius: 4
border.color : Qt.rgba(0, 0, 0, 0.3)
border.width: 1
OpacityAnimator {
id: animator
target: scenetoolbar;
from: 1;
to: 0;
duration: 2500
running: false
acceptedButtons: Qt.NoButton
width: fullscreenButton.width + root.baseUnit
height: parent.height
onEntered: {
animator.stop()
scenetoolbar.opacity = 1
}
function fadeBar()
{
animator.start()
onExited: {
scenetoolbar.opacity = 0
}
MouseArea {
id: barZone
hoverEnabled: true
acceptedButtons: Qt.NoButton
x: scenetoolbar.rightSide ? -root.baseUnit : 0
width: fullscreenButton.width + root.baseUnit
height: scenetoolbar.parent.height
onEntered: {
scenetoolbar.opacity = 1
Rectangle {
id: scenetoolbar
objectName: "scenetoolbar"
width: fullscreenButton.width
height: childrenRect.height
anchors.right: barZone.right
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
color: Qt.rgba(myPalette.window.r, myPalette.window.g, myPalette.window.b, 0.7)
opacity: 0
radius: 4
border.color : Qt.rgba(0, 0, 0, 0.3)
border.width: 1
OpacityAnimator {
id: animator
target: scenetoolbar;
from: 1;
to: 0;
duration: 2500
running: false
}
onExited: {
scenetoolbar.opacity = 0
function fadeBar()
{
animator.start()
}
Column {
x: scenetoolbar.rightSide ? root.baseUnit : 0
ToolButton {
id: fullscreenButton
objectName: "fullScreen"
iconName: "view-fullscreen"
tooltip: i18n("Switch Full Screen")
onClicked: {
controller.activateClipMonitor(root.isClipMonitor)
controller.triggerAction('monitor_fullscreen')
Column {
ToolButton {
id: fullscreenButton
objectName: "fullScreen"
icon.name: "view-fullscreen"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Switch Full Screen")
ToolTip.timeout: 3000
onClicked: {
controller.activateClipMonitor(root.isClipMonitor)
controller.triggerAction('monitor_fullscreen')
}
}
}
ToolButton {
objectName: "switchOverlay"
iconName: "view-grid"
tooltip: i18n("Change Overlay")
onClicked: {
if (controller.overlayType >= 5) {
controller.overlayType = 0
} else {
controller.overlayType = controller.overlayType + 1;
ToolButton {
objectName: "switchOverlay"
icon.name: "view-grid"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Change Overlay")
ToolTip.timeout: 3000
onClicked: {
if (controller.overlayType >= 5) {
controller.overlayType = 0
} else {
controller.overlayType = controller.overlayType + 1;
}
root.overlayType = controller.overlayType
}
root.overlayType = controller.overlayType
}
}
ToolButton {
iconName: "zoom-in"
tooltip: i18n("Zoom in")
onClicked: {
controller.activateClipMonitor(root.isClipMonitor)
controller.triggerAction('monitor_zoomin')
ToolButton {
icon.name: "zoom-in"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Zoom in")
ToolTip.timeout: 3000
onClicked: {
controller.activateClipMonitor(root.isClipMonitor)
controller.triggerAction('monitor_zoomin')
}
}
}
ToolButton {
iconName: "zoom-out"
tooltip: i18n("Zoom out")
onClicked: {
controller.activateClipMonitor(root.isClipMonitor)
controller.triggerAction('monitor_zoomout')
ToolButton {
icon.name: "zoom-out"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Zoom out")
ToolTip.timeout: 3000
onClicked: {
controller.activateClipMonitor(root.isClipMonitor)
controller.triggerAction('monitor_zoomout')
}
}
}
ToolButton {
objectName: "addMarker"
iconName: "list-add"
tooltip: root.isClipMonitor ? i18n("Add Marker") : i18n("Add Guide")
onClicked: {
controller.activateClipMonitor(root.isClipMonitor)
controller.triggerAction('add_marker_guide_quickly')
ToolButton {
objectName: "addMarker"
icon.name: "list-add"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: root.isClipMonitor ? i18n("Add Marker") : i18n("Add Guide")
ToolTip.timeout: 3000
onClicked: {
controller.activateClipMonitor(root.isClipMonitor)
controller.triggerAction('add_marker_guide_quickly')
}
}
}
ToolButton {
objectName: "removeMarker"
iconName: "list-remove"
tooltip: root.isClipMonitor ? i18n("Remove Marker") : i18n("Remove Guide")
onClicked: {
controller.activateClipMonitor(root.isClipMonitor)
root.isClipMonitor ? controller.triggerAction('delete_clip_marker') : controller.triggerAction('delete_guide')
ToolButton {
objectName: "removeMarker"
icon.name: "list-remove"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: root.isClipMonitor ? i18n("Remove Marker") : i18n("Remove Guide")
ToolTip.timeout: 3000
onClicked: {
controller.activateClipMonitor(root.isClipMonitor)
root.isClipMonitor ? controller.triggerAction('delete_clip_marker') : controller.triggerAction('delete_guide')
}
}
}
ToolButton {
objectName: "moveBar"
iconName: "transform-move-horizontal"
tooltip: i18n("Move Toolbar")
onClicked: {
if (scenetoolbar.rightSide) {
scenetoolbar.anchors.right = undefined
scenetoolbar.anchors.left = scenetoolbar.parent.left
scenetoolbar.rightSide = false
fadeBar()
} else {
scenetoolbar.anchors.left = undefined
scenetoolbar.anchors.right = scenetoolbar.parent.right
scenetoolbar.rightSide = true
fadeBar()
ToolButton {
objectName: "moveBar"
icon.name: "transform-move-horizontal"
ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: i18n("Move Toolbar")
ToolTip.timeout: 3000
onClicked: {
if (barZone.rightSide) {
barZone.anchors.right = undefined
barZone.anchors.left = barZone.parent.left
barZone.rightSide = false
scenetoolbar.anchors.right = undefined
scenetoolbar.anchors.left = barZone.left
scenetoolbar.fadeBar()
} else {
barZone.anchors.left = undefined
barZone.anchors.right = barZone.parent.right
barZone.rightSide = true
scenetoolbar.anchors.left = undefined
scenetoolbar.anchors.right = barZone.right
scenetoolbar.fadeBar()
}
}
}
}
}
}
Component.onCompleted: {
scenetoolbar.fadeBar()
}
}
......@@ -227,11 +227,6 @@ Item {
}
EffectToolBar {
id: effectToolBar
barContainsMouse: effectToolBar.rightSide ? global.mouseX >= x - 10 : global.mouseX < x + width + 10
onBarContainsMouseChanged: {
effectToolBar.opacity = 1
effectToolBar.visible = effectToolBar.barContainsMouse
}
anchors {
right: parent.right
top: parent.top
......
......@@ -601,12 +601,6 @@ Item {
}
EffectToolBar {
id: effectToolBar
barContainsMouse: effectToolBar.rightSide ? global.mouseX >= x - 10 : global.mouseX < x + width + 10
showAutoKeyframe: true
onBarContainsMouseChanged: {
effectToolBar.opacity = 1
effectToolBar.visible = effectToolBar.barContainsMouse
}
anchors {
right: parent.right
top: parent.top
......
......@@ -691,12 +691,6 @@ Item {
}
EffectToolBar {
id: effectToolBar
barContainsMouse: effectToolBar.rightSide ? global.mouseX >= x - 10 : global.mouseX < x + width + 10
showAutoKeyframe: true
onBarContainsMouseChanged: {
effectToolBar.opacity = 1
effectToolBar.visible = effectToolBar.barContainsMouse
}
anchors {
right: parent.right
top: parent.top
......
......@@ -98,11 +98,6 @@ Item {
}
SceneToolBar {
id: sceneToolBar
barContainsMouse: sceneToolBar.rightSide ? barOverArea.mouseX >= x - 10 : barOverArea.mouseX < x + width + 10
onBarContainsMouseChanged: {
sceneToolBar.opacity = 1
sceneToolBar.visible = sceneToolBar.barContainsMouse
}
anchors {
right: parent.right
top: parent.top
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment