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
|
|
|
|
import AppControls2 1.0 as AppControls2
|
|
|
|
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-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
|
2023-11-29 16:13:50 +08:00
|
|
|
radius: 4 //change theme
|
2023-04-08 18:42:31 +08:00
|
|
|
visible: opacity
|
2023-03-24 17:47:17 +08:00
|
|
|
|
|
|
|
onTextChanged: {
|
|
|
|
if (text === "") {
|
|
|
|
pluginSelectMenu.model.reactivateProvider();
|
|
|
|
} 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
|
|
|
|
|
|
|
PluginSelectMenu {
|
2023-03-24 17:47:17 +08:00
|
|
|
id: pluginSelectMenu
|
2023-03-17 17:25:50 +08:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 72 // 48+24
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2023-03-24 17:47:17 +08:00
|
|
|
height: 48; width: 72 // 48+16+8
|
2023-03-17 17:25:50 +08:00
|
|
|
spacing: 8
|
|
|
|
}
|
|
|
|
|
2023-03-24 17:47:17 +08:00
|
|
|
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
|
2023-04-26 17:04:22 +08:00
|
|
|
borderColor: Palette.Highlight
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|