Files
DankMaterialShell/quickshell/Modals/KeybindsModalWindow.qml
T
bbedward ccbf1d38ad widgets: bump qml-common, rename Dank* prefixed widgets to D, add
deprecation notice to plugin compatibility shims

- When qml-common became a thing, we left qs.Widgets shims in place for
  plugin compatibility
- It's annoying to need to maintain them when qml-common has any change,
  add a warning so we can safely deprecate them in the future
- One shot rename the common stuff to D to make it shorter and nicer to
  write
2026-10-05 16:47:19 -04:00

84 lines
2.0 KiB
QML

import QtQuick
import qs.Common
import qs.Modals
import qs.Services
import qs.DCommon.Widgets
import qs.Widgets
DankFloatingWindow {
id: win
property alias shouldBeVisible: win.visible
signal floatingToggleRequested
function show() {
visible = true;
}
function hide() {
visible = false;
}
function toggle() {
visible = !visible;
}
objectName: "keybindsModalWindow"
title: I18n.tr("Keybinds")
minimumSize: Qt.size(Math.min(560, Screen.width), Math.min(400, Screen.height))
implicitWidth: 1000
implicitHeight: screen ? Math.min(820, screen.height - 100) : 820
visible: false
onVisibleChanged: {
if (!visible)
return;
if (!Object.keys(KeybindsService.cheatsheet).length && KeybindsService.cheatsheetAvailable)
KeybindsService.loadCheatsheet();
Qt.callLater(() => {
keybindsContent.forceActiveFocus();
keybindsContent.searchField.forceActiveFocus();
});
}
onClosed: win.visible = false
Column {
anchors.fill: parent
spacing: 0
DWindowHeader {
id: titleBar
width: parent.width
z: 10
controls: windowControls
title: KeybindsService.cheatsheet.title || I18n.tr("Keybinds")
onCloseRequested: win.hide()
DActionButton {
iconName: "close_fullscreen"
buttonSize: Theme.buttonHeightXXS
iconSize: Theme.iconSizeSmall
iconColor: Theme.surfaceText
tooltipText: I18n.tr("Dock window")
onClicked: win.floatingToggleRequested()
}
}
KeybindsContent {
id: keybindsContent
width: parent.width
height: parent.height - titleBar.height
showFloatingToggle: false
floating: true
onCloseRequested: win.hide()
}
}
FloatingWindowControls {
id: windowControls
targetWindow: win
}
}