Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rotation: fix rectangle size and rotation for 90 and 270 degrees #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions application/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Kirigami.ApplicationWindow {
y: deviceHeight ? Screen.desktopAvailableHeight - height : undefined

color: "black"

property var rot_origin_x: globalScreenRotation == 90 || globalScreenRotation == 270 ? height/2 : width/2
property var rot_origin_y: globalScreenRotation == 90 || globalScreenRotation == 270 ? width/2 : height/2

//HACK!! needs proper api in kirigami
Component.onCompleted: {
globalDrawer.handle.handleAnchor = handleAnchor;
Expand Down Expand Up @@ -199,9 +203,12 @@ Kirigami.ApplicationWindow {
}
}
Rectangle {
height: globalScreenRotation == 90 || globalScreenRotation == 270 ? root.width : root.height
width: globalScreenRotation == 90 || globalScreenRotation == 270 ? root.height : root.width
color: nightSwitch.checked ? "black" : Kirigami.Theme.backgroundColor
rotation: globalScreenRotation || 0
anchors.fill: parent
transform: Rotation { origin.x: root.rot_origin_x; origin.y: root.rot_origin_y; angle: globalScreenRotation }
anchors.centerIn: parent

Image {
visible: singleSkill.length === 0
source: "background.png"
Expand Down