Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 08e8497d authored by Willian Pessoa's avatar Willian Pessoa Committed by Jean-Baptiste Mardelle

Add three "safe zone" overlays

Differential Revision: https://phabricator.kde.org/D14019
parent 8df9449e
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtQuick 2.0
Item {
id: overlay
Rectangle {
color: root.overlayColor
width: parent.width
height: 1
anchors.centerIn: parent
}
Rectangle {
color: root.overlayColor
height: parent.height
width: 1
anchors.centerIn: parent
}
}
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtQuick 2.0
Item {
id: overlay
property double diagonalLenght: Math.sqrt(Math.pow(parent.height, 2) + Math.pow(parent.width, 2))
function degreesRotation(width, height) {
var a = height/width;
var b = Math.sqrt(1 + Math.pow(a, 2));
var angle = Math.acos(Math.pow(a,2) / (a * b));
return angle * (180 / Math.PI);
}
Rectangle {
color: root.overlayColor
width: overlay.diagonalLenght
height: 1
rotation: degreesRotation(parent.height, parent.width)
anchors.centerIn: parent
antialiasing: true
}
Rectangle {
color: root.overlayColor
height: overlay.diagonalLenght
width: 1
rotation: degreesRotation(parent.width, parent.height)
anchors.centerIn: parent
antialiasing: true
}
}
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtQuick 2.0
Item {
id: overlay
// Vertical segments
Rectangle {
color: root.overlayColor
height: parent.height
width: 1
x: parent.width / 3
}
Rectangle {
color: root.overlayColor
height: parent.height
width: 1
x: (parent.width / 3 ) * 2
}
// Horizontal segments
Rectangle {
color: root.overlayColor
width: parent.width
height: 1
y: parent.height / 3
}
Rectangle {
color: root.overlayColor
width: parent.width
height: 1
y: (parent.height / 3) * 2
}
}
......@@ -51,7 +51,7 @@ Item {
}
function switchOverlay() {
if (controller.overlayType >= 2) {
if (controller.overlayType >= 5) {
controller.overlayType = 0
} else {
controller.overlayType = controller.overlayType + 1;
......@@ -99,6 +99,15 @@ Item {
case 2:{
return "OverlayMinimal.qml";
}
case 3:{
return "OverlayCenter.qml";
}
case 4:{
return "OverlayCenterDiagonal.qml";
}
case 5:{
return "OverlayThirds.qml";
}
}
}
}
......
......@@ -51,7 +51,7 @@ Item {
}
function switchOverlay() {
if (controller.overlayType >= 2) {
if (controller.overlayType >= 5) {
controller.overlayType = 0
} else {
controller.overlayType = controller.overlayType + 1;
......@@ -99,6 +99,15 @@ Item {
case 2:{
return "OverlayMinimal.qml";
}
case 3:{
return "OverlayCenter.qml";
}
case 4:{
return "OverlayCenterDiagonal.qml";
}
case 5:{
return "OverlayThirds.qml";
}
}
}
}
......
......@@ -15,6 +15,9 @@
<file alias="MonitorRuler.qml">monitor/view/MonitorRuler.qml</file>
<file alias="OverlayStandard.qml">monitor/view/OverlayStandard.qml</file>
<file alias="OverlayMinimal.qml">monitor/view/OverlayMinimal.qml</file>
<file alias="OverlayCenter.qml">monitor/view/OverlayCenter.qml</file>
<file alias="OverlayCenterDiagonal.qml">monitor/view/OverlayCenterDiagonal.qml</file>
<file alias="OverlayThirds.qml">monitor/view/OverlayThirds.qml</file>
<file alias="timeline.qml">timeline2/view/qml/timeline.qml</file>
<file alias="TrackHead.qml">timeline2/view/qml/TrackHead.qml</file>
<file alias="Track.qml">timeline2/view/qml/Track.qml</file>
......
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