on xenial help sign in
make the overlay visible only when it fits available space
373d219Lukáš Tinkl
qml/Components/KeyboardShortcutsOverlay.qml+4−5
@@ -21,17 +21,16 @@ import Ubuntu.Components 1.3
21
21
22Rectangle {
22Rectangle {
23 id: root
23 id: root
24− width: parent.width * 2/3
24+ width: topLayout.childrenRect.width
25− height: parent.height * 2/3
25+ height: topLayout.childrenRect.height
26 color: theme.palette.normal.background
26 color: theme.palette.normal.background
27 radius: units.gu(.5)
27 radius: units.gu(.5)
28
28
29− readonly property int maxTextSize: (root.width / 4) - padding
29+ readonly property int maxTextSize: (root.parent.width / 4) - padding
30 readonly property int padding: units.gu(4)
30 readonly property int padding: units.gu(4)
31
31
32 GridLayout {
32 GridLayout {
33− anchors.fill: parent
33+ id: topLayout
34− anchors.margins: padding
35 columns: 2
34 columns: 2
36 columnSpacing: padding
35 columnSpacing: padding
37
36
qml/Shell.qml+2−1
@@ -619,7 +619,8 @@ Item {
619
619
620 KeyboardShortcutsOverlay {
620 KeyboardShortcutsOverlay {
621 objectName: "shortcutsOverlay"
621 objectName: "shortcutsOverlay"
622− visible: launcher.shortcutHintsShown
622+ visible: launcher.shortcutHintsShown && width < parent.width - (launcher.lockedVisible ? launcher.panelWidth : 0)
623+ && height < parent.height
623 enabled: visible
624 enabled: visible
624 anchors.centerIn: parent
625 anchors.centerIn: parent
625 anchors.horizontalCenterOffset: launcher.lockedVisible ? launcher.panelWidth/2 : 0
626 anchors.horizontalCenterOffset: launcher.lockedVisible ? launcher.panelWidth/2 : 0