ukui-menu/qml/AppUI/NormalUI.qml

63 lines
1.6 KiB
QML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import QtQuick 2.12
import org.ukui.menu.core 1.0
import org.ukui.quick.items 1.0 as UkuiItems
FocusScope {
id: normalUI
anchors.fill: parent
function focusToFalse() {
focus = false;
}
function keyPressed(event) {
// 任意字符键焦点切换到搜索0-9 a-z
if ((0x2f < event.key && event.key < 0x3a)||(0x40 < event.key && event.key < 0x5b)) {
focus = true;
appPage.search.changeToSearch(event.text);
// 任意方向键切换至应用列表
} else if ((0x01000011 < event.key)&&(event.key < 0x01000016)) {
focus = true;
appPage.content.focus = true;
appPage.content.resetFocus();
}
}
Component.onCompleted: mainWindow.visibleChanged.connect(focusToFalse)
Component.onDestruction: mainWindow.visibleChanged.disconnect(focusToFalse)
Row {
anchors.fill: parent;
AppPage {
id: appPage
width: 312
height: parent.height;
}
UkuiItems.StyleBackground {
width: 1
height: parent.height
paletteRole: UkuiItems.Theme.ButtonText
useStyleTransparency: false
alpha: 0.05
}
WidgetPage {
width: parent.width - 374;
height: parent.height;
}
UkuiItems.StyleBackground {
width: 1
height: parent.height
paletteRole: UkuiItems.Theme.ButtonText
useStyleTransparency: false
alpha: 0.05
}
Sidebar {
width: 60;
height: parent.height;
}
}
}