ukui-menu/qml/AppUI/FullScreenHeader.qml

65 lines
1.8 KiB
QML
Raw Normal View History

2023-03-17 17:25:50 +08:00
import QtQuick 2.0
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
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
onClicked: mainWindow.exitFullScreen()
}
2023-03-17 17:25:50 +08:00
}
}