2023-04-26 17:04:22 +08:00
|
|
|
import QtQuick 2.12
|
2023-03-17 17:25:50 +08:00
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
import QtQuick.Controls 2.12
|
2024-01-04 11:13:41 +08:00
|
|
|
import org.ukui.quick.platform 1.0 as Platform
|
2023-12-11 16:13:53 +08:00
|
|
|
import org.ukui.quick.items 1.0 as UkuiItems
|
2023-03-17 17:25:50 +08:00
|
|
|
import org.ukui.menu.core 1.0
|
2023-03-24 17:47:17 +08:00
|
|
|
import org.ukui.menu.utils 1.0
|
2023-03-17 17:25:50 +08:00
|
|
|
|
|
|
|
Item {
|
|
|
|
clip: true
|
2023-04-08 18:42:31 +08:00
|
|
|
property alias searchOpacity: searchInputBar.opacity
|
2023-08-15 10:10:13 +08:00
|
|
|
property alias searchText: searchInputBar.text
|
2023-12-04 10:03:41 +08:00
|
|
|
|
|
|
|
PluginSelectButton {
|
|
|
|
id: pluginSelectButton
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 72
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
height: 32; width: 64
|
|
|
|
}
|
|
|
|
|
2023-03-24 17:47:17 +08:00
|
|
|
SearchInputBar {
|
2023-04-08 18:42:31 +08:00
|
|
|
id: searchInputBar
|
2023-03-24 17:47:17 +08:00
|
|
|
width: 372; height: 36
|
|
|
|
anchors.centerIn: parent
|
2024-01-04 11:13:41 +08:00
|
|
|
radius: Platform.Theme.minRadius
|
2023-04-08 18:42:31 +08:00
|
|
|
visible: opacity
|
2023-03-24 17:47:17 +08:00
|
|
|
|
|
|
|
onTextChanged: {
|
|
|
|
if (text === "") {
|
2023-12-11 16:13:53 +08:00
|
|
|
appPageHeaderUtils.model(PluginGroup.SortMenuItem).reactivateProvider();
|
2023-03-24 17:47:17 +08:00
|
|
|
} else {
|
|
|
|
appPageHeaderUtils.model(PluginGroup.Button).reactivateProvider();
|
|
|
|
appPageHeaderUtils.startSearch(text);
|
|
|
|
}
|
|
|
|
}
|
2023-04-08 18:42:31 +08:00
|
|
|
Behavior on opacity {
|
|
|
|
NumberAnimation { duration: 300; easing.type: Easing.InOutCubic }
|
|
|
|
}
|
2023-03-24 17:47:17 +08:00
|
|
|
}
|
2023-03-17 17:25:50 +08:00
|
|
|
|
2023-12-11 16:13:53 +08:00
|
|
|
UkuiItems.StyleBackground {
|
2023-03-24 17:47:17 +08:00
|
|
|
width: 48; height: width
|
2024-01-04 11:13:41 +08:00
|
|
|
radius: Platform.Theme.minRadius
|
2023-12-11 16:13:53 +08:00
|
|
|
useStyleTransparency: false
|
2024-01-04 11:13:41 +08:00
|
|
|
paletteRole: Platform.Theme.Light
|
2023-03-24 17:47:17 +08:00
|
|
|
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
|
2024-01-04 11:13:41 +08:00
|
|
|
borderColor: Platform.Theme.Highlight
|
2023-04-26 17:04:22 +08:00
|
|
|
border.width: buttonMouseArea.activeFocus ? 2 : 0
|
2023-03-24 17:47:17 +08:00
|
|
|
|
|
|
|
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-06 09:22:29 +08:00
|
|
|
ToolTip.delay: 500
|
2023-06-02 15:44:16 +08:00
|
|
|
ToolTip.text: qsTr("Contract")
|
|
|
|
ToolTip.visible: containsMouse
|
2023-03-24 17:47:17 +08:00
|
|
|
onClicked: mainWindow.exitFullScreen()
|
2023-04-26 17:04:22 +08:00
|
|
|
activeFocusOnTab: true
|
|
|
|
Keys.onPressed: {
|
|
|
|
if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) {
|
|
|
|
mainWindow.exitFullScreen();
|
|
|
|
}
|
|
|
|
}
|
2023-03-24 17:47:17 +08:00
|
|
|
}
|
2023-03-17 17:25:50 +08:00
|
|
|
}
|
|
|
|
}
|