on xenial help sign in
make the overlay visible only when it fits available space
commit373d21999f38749b4d3462aa34d1510dd66e37c3 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateTue 10 May 2016, 13:28 (10 years ago) parent394aa6a
2 files changed+6−6
qml/Components/KeyboardShortcutsOverlay.qml+4−5 qml/Shell.qml+2−1
qml/Components/KeyboardShortcutsOverlay.qml+4−5
@@ -21,17 +21,16 @@ import Ubuntu.Components 1.3
2121
2222Rectangle {
2323 id: root
24− width: parent.width * 2/3
25− height: parent.height * 2/3
24+ width: topLayout.childrenRect.width
25+ height: topLayout.childrenRect.height
2626 color: theme.palette.normal.background
2727 radius: units.gu(.5)
2828
29− readonly property int maxTextSize: (root.width / 4) - padding
29+ readonly property int maxTextSize: (root.parent.width / 4) - padding
3030 readonly property int padding: units.gu(4)
3131
3232 GridLayout {
33− anchors.fill: parent
34− anchors.margins: padding
33+ id: topLayout
3534 columns: 2
3635 columnSpacing: padding
3736
qml/Shell.qml+2−1
@@ -619,7 +619,8 @@ Item {
619619
620620 KeyboardShortcutsOverlay {
621621 objectName: "shortcutsOverlay"
622− visible: launcher.shortcutHintsShown
622+ visible: launcher.shortcutHintsShown && width < parent.width - (launcher.lockedVisible ? launcher.panelWidth : 0)
623+ && height < parent.height
623624 enabled: visible
624625 anchors.centerIn: parent
625626 anchors.horizontalCenterOffset: launcher.lockedVisible ? launcher.panelWidth/2 : 0