fix RTL layout for vertical and alignments

v0.7
Michail Vourlakos 7 years ago
parent a0c9194046
commit fc3c8e9fdb

@ -456,7 +456,9 @@ Item{
},
State {
name: "bottomLeft"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === Latte.Dock.Left)
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)
&&(((root.panelAlignment === Latte.Dock.Left)&&(Qt.application.layoutDirection !== Qt.RightToLeft))
|| ((root.panelAlignment === Latte.Dock.Right)&&(Qt.application.layoutDirection === Qt.RightToLeft)))
AnchorChanges {
target: _mainLayout
@ -470,7 +472,9 @@ Item{
},
State {
name: "bottomRight"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === Latte.Dock.Right)
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)
&&(((root.panelAlignment === Latte.Dock.Right)&&(Qt.application.layoutDirection !== Qt.RightToLeft))
||((root.panelAlignment === Latte.Dock.Left)&&(Qt.application.layoutDirection === Qt.RightToLeft)))
AnchorChanges {
target: _mainLayout
@ -499,7 +503,9 @@ Item{
},
State {
name: "topLeft"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === Latte.Dock.Left)
when: (plasmoid.location === PlasmaCore.Types.TopEdge)
&&(((root.panelAlignment === Latte.Dock.Left)&&(Qt.application.layoutDirection !== Qt.RightToLeft))
|| ((root.panelAlignment === Latte.Dock.Right)&&(Qt.application.layoutDirection === Qt.RightToLeft)))
AnchorChanges {
target: _mainLayout
@ -513,7 +519,9 @@ Item{
},
State {
name: "topRight"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === Latte.Dock.Right)
when: (plasmoid.location === PlasmaCore.Types.TopEdge)
&&(((root.panelAlignment === Latte.Dock.Right)&&(Qt.application.layoutDirection !== Qt.RightToLeft))
||((root.panelAlignment === Latte.Dock.Left)&&(Qt.application.layoutDirection === Qt.RightToLeft)))
AnchorChanges {
target: _mainLayout

@ -576,7 +576,9 @@ Item{
},
State {
name: "bottomLeft"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === Latte.Dock.Left)
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)
&&(((root.panelAlignment === Latte.Dock.Left)&&(Qt.application.layoutDirection !== Qt.RightToLeft))
|| ((root.panelAlignment === Latte.Dock.Right)&&(Qt.application.layoutDirection === Qt.RightToLeft)))
AnchorChanges {
target: barLine
@ -595,7 +597,9 @@ Item{
},
State {
name: "bottomRight"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === Latte.Dock.Right)
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)
&&(((root.panelAlignment === Latte.Dock.Right)&&(Qt.application.layoutDirection !== Qt.RightToLeft))
||((root.panelAlignment === Latte.Dock.Left)&&(Qt.application.layoutDirection === Qt.RightToLeft)))
AnchorChanges {
target: barLine
@ -650,7 +654,9 @@ Item{
},
State {
name: "topLeft"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === Latte.Dock.Left)
when: (plasmoid.location === PlasmaCore.Types.TopEdge)
&&(((root.panelAlignment === Latte.Dock.Left)&&(Qt.application.layoutDirection !== Qt.RightToLeft))
|| ((root.panelAlignment === Latte.Dock.Right)&&(Qt.application.layoutDirection === Qt.RightToLeft)))
AnchorChanges {
target: barLine
@ -668,7 +674,9 @@ Item{
},
State {
name: "topRight"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === Latte.Dock.Right)
when: (plasmoid.location === PlasmaCore.Types.TopEdge)
&&(((root.panelAlignment === Latte.Dock.Right)&&(Qt.application.layoutDirection !== Qt.RightToLeft))
||((root.panelAlignment === Latte.Dock.Left)&&(Qt.application.layoutDirection === Qt.RightToLeft)))
AnchorChanges {
target: barLine

@ -81,7 +81,7 @@ Item {
//check if the mouse goes right or down according to the center
var positiveDirection = ((currentMousePosition - center) >= 0 );
if (Qt.application.layoutDirection === Qt.RightToLeft) {
if (Qt.application.layoutDirection === Qt.RightToLeft && !root.isVertical) {
positiveDirection = !positiveDirection;
}

@ -38,7 +38,7 @@ DragDrop.DropArea {
id: root
objectName: "dockLayoutView"
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft && !root.isVertical
LayoutMirroring.childrenInherit: true
//// BEGIN SIGNALS

@ -70,7 +70,7 @@ Item {
//check if the mouse goes right or down according to the center
var positiveDirection = ((currentMousePosition - center) >= 0 );
if (Qt.application.layoutDirection === Qt.RightToLeft) {
if (Qt.application.layoutDirection === Qt.RightToLeft && !root.vertical) {
positiveDirection = !positiveDirection;
}

@ -50,7 +50,7 @@ Item {
Layout.minimumHeight: (userPanelPosition !== 0)&&(!latteDock) ? clearHeight : -1
Layout.preferredWidth: (userPanelPosition !== 0)&&(!latteDock) ? tasksWidth : -1
Layout.preferredHeight: (userPanelPosition !== 0)&&(!latteDock) ? tasksHeight : -1
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft && !root.vertical
LayoutMirroring.childrenInherit: true
property bool debugLocation: false

@ -303,7 +303,7 @@ Item{
}
property var mask: ShaderEffectSource {
sourceItem: Item{
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft && !root.vertical
LayoutMirroring.childrenInherit: true
width: iconImageBuffer.width

Loading…
Cancel
Save