fix RTL layout for vertical and alignments

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

@ -456,7 +456,9 @@ Item{
}, },
State { State {
name: "bottomLeft" 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 { AnchorChanges {
target: _mainLayout target: _mainLayout
@ -470,7 +472,9 @@ Item{
}, },
State { State {
name: "bottomRight" 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 { AnchorChanges {
target: _mainLayout target: _mainLayout
@ -499,7 +503,9 @@ Item{
}, },
State { State {
name: "topLeft" 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 { AnchorChanges {
target: _mainLayout target: _mainLayout
@ -513,7 +519,9 @@ Item{
}, },
State { State {
name: "topRight" 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 { AnchorChanges {
target: _mainLayout target: _mainLayout

@ -576,7 +576,9 @@ Item{
}, },
State { State {
name: "bottomLeft" 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 { AnchorChanges {
target: barLine target: barLine
@ -595,7 +597,9 @@ Item{
}, },
State { State {
name: "bottomRight" 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 { AnchorChanges {
target: barLine target: barLine
@ -650,7 +654,9 @@ Item{
}, },
State { State {
name: "topLeft" 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 { AnchorChanges {
target: barLine target: barLine
@ -668,7 +674,9 @@ Item{
}, },
State { State {
name: "topRight" 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 { AnchorChanges {
target: barLine target: barLine

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

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

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

@ -50,7 +50,7 @@ Item {
Layout.minimumHeight: (userPanelPosition !== 0)&&(!latteDock) ? clearHeight : -1 Layout.minimumHeight: (userPanelPosition !== 0)&&(!latteDock) ? clearHeight : -1
Layout.preferredWidth: (userPanelPosition !== 0)&&(!latteDock) ? tasksWidth : -1 Layout.preferredWidth: (userPanelPosition !== 0)&&(!latteDock) ? tasksWidth : -1
Layout.preferredHeight: (userPanelPosition !== 0)&&(!latteDock) ? tasksHeight : -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 LayoutMirroring.childrenInherit: true
property bool debugLocation: false property bool debugLocation: false

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

Loading…
Cancel
Save