ukui-menu/qml/AppUI/FullScreenHeader.qml

77 lines
2.4 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 org.ukui.quick.platform 1.0 as Platform
import org.ukui.quick.items 1.0 as UkuiItems
2023-03-17 17:25:50 +08:00
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
property alias searchText: searchInputBar.text
PluginSelectButton {
id: pluginSelectButton
anchors.left: parent.left
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
height: 32; width: 64
}
SearchInputBar {
id: searchInputBar
width: 372; height: 36
anchors.centerIn: parent
radius: Platform.Theme.minRadius
visible: opacity
onTextChanged: {
if (text === "") {
appPageHeaderUtils.model(PluginGroup.SortMenuItem).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
UkuiItems.StyleBackground {
width: 48; height: width
radius: Platform.Theme.minRadius
useStyleTransparency: false
paletteRole: Platform.Theme.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: Platform.Theme.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
ToolTip.delay: 500
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
}
}