ukui-menu/qml/AppUI/FullScreenHeader.qml

75 lines
2.2 KiB
QML
Raw Normal View History

import QtQuick 2.12
2023-03-17 17:25:50 +08:00
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.12
import AppControls2 1.0 as AppControls2
import org.ukui.menu.core 1.0
import org.ukui.menu.utils 1.0
2023-03-17 17:25:50 +08:00
Item {
clip: true
property alias searchOpacity: searchInputBar.opacity
SearchInputBar {
id: searchInputBar
width: 372; height: 36
anchors.centerIn: parent
radius: height / 2
visible: opacity
onTextChanged: {
if (text === "") {
pluginSelectMenu.model.reactivateProvider();
} else {
appPageHeaderUtils.model(PluginGroup.Button).reactivateProvider();
appPageHeaderUtils.startSearch(text);
}
}
Behavior on opacity {
NumberAnimation { duration: 300; easing.type: Easing.InOutCubic }
}
}
2023-03-17 17:25:50 +08:00
PluginSelectMenu {
id: pluginSelectMenu
2023-03-17 17:25:50 +08:00
anchors.right: parent.right
anchors.rightMargin: 72 // 48+24
anchors.verticalCenter: parent.verticalCenter
height: 48; width: 72 // 48+16+8
2023-03-17 17:25:50 +08:00
spacing: 8
}
AppControls2.StyleBackground {
width: 48; height: width
radius: 4
useStyleTransparent: false
paletteRole: Palette.Light
alpha: buttonMouseArea.containsPress ? 0.30 : buttonMouseArea.containsMouse ? 0.20 : 0.00
2023-03-17 17:25:50 +08:00
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
borderColor: Palette.Highlight
border.width: buttonMouseArea.activeFocus ? 2 : 0
ThemeIcon {
anchors.centerIn: parent
width: parent.width / 2; height: width
source: "image://appicon/view-restore-symbolic"
highLight: true
autoHighLight: false
}
MouseArea {
id: buttonMouseArea
hoverEnabled: true
anchors.fill: parent
2023-06-02 15:44:16 +08:00
ToolTip.text: qsTr("Contract")
ToolTip.visible: containsMouse
onClicked: mainWindow.exitFullScreen()
activeFocusOnTab: true
Keys.onPressed: {
if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) {
mainWindow.exitFullScreen();
}
}
}
2023-03-17 17:25:50 +08:00
}
}