Skip to content

Commit

Permalink
Hide window controls triangle decoration if needed to prevent overlaps
Browse files Browse the repository at this point in the history
The triangle shape could cause a lot of overlaps if the windows are
small, especially in focus mode where a minimum size is not enforced.
  • Loading branch information
Raphael Dumusc committed Sep 4, 2018
1 parent 6a32eee commit 76a6d44
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tide/core/resources/WindowControls.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Item {
Rectangle {
id: buttonsRectangle
width: buttons.width + 2 * Style.buttonsPadding
height: buttons.height
height: triangle.visible ? buttons.height : buttons.height + 2 * Style.buttonsPadding
color: Style.controlsDefaultColor
}
Triangle {
Expand All @@ -25,6 +25,8 @@ Item {
height: 2 * width
color: buttonsRectangle.color
anchors.top: buttonsRectangle.bottom
visible: (window.focused ? window.focusedCoordinates.height : window.height)
> (buttons.height + triangle.height)
}

WindowControlButtons {
Expand All @@ -42,9 +44,8 @@ Item {
},
State {
name: "opaque"
when: window.selected &&
window.state !== Window.RESIZING &&
!window.fullscreen
when: window.selected && window.state !== Window.RESIZING
&& !window.fullscreen
PropertyChanges {
target: windowControls
opacity: 1
Expand Down

0 comments on commit 76a6d44

Please sign in to comment.