diff --git a/images/system-search-symbolic.svg b/images/system-search-symbolic.svg
new file mode 100755
index 0000000..196143a
--- /dev/null
+++ b/images/system-search-symbolic.svg
@@ -0,0 +1,8 @@
+
diff --git a/qml.qrc b/qml.qrc
index 46f3992..177d2dd 100755
--- a/qml.qrc
+++ b/qml.qrc
@@ -4,5 +4,6 @@
qml/GridItemDelegate.qml
qml/AllAppsView.qml
qml/CategoryView.qml
+ images/system-search-symbolic.svg
diff --git a/qml/main.qml b/qml/main.qml
index 77c6aaa..c091e35 100755
--- a/qml/main.qml
+++ b/qml/main.qml
@@ -167,7 +167,7 @@ Item {
TextMetrics {
id: fontMetrics
- text: textField.placeholderText
+ text: _placeLabel.text
}
TextField {
@@ -176,31 +176,49 @@ Item {
width: searchItem.width * 0.2
height: parent.height
- leftPadding: FishUI.Units.largeSpacing
+ leftPadding: textField.activeFocus ? _placeImage.width + FishUI.Units.largeSpacing : FishUI.Units.largeSpacing
rightPadding: FishUI.Units.largeSpacing
selectByMouse: true
- placeholderText: qsTr("Search")
+ // placeholderText: qsTr("Search")
wrapMode: Text.NoWrap
color: "white"
- Label {
- id: placeholder
- x: textField.leftPadding
- y: textField.topPadding
- width: textField.width - (textField.leftPadding + textField.rightPadding)
- height: textField.height - (textField.topPadding + textField.bottomPadding)
- text: textField.placeholderText
- font: textField.font
- color: "white"
- opacity: 0.65
- visible: !textField.length && !textField.preeditText && (!textField.activeFocus || textField.horizontalAlignment !== Qt.AlignHCenter)
- elide: Text.ElideRight
- wrapMode: Text.NoWrap
- horizontalAlignment: Text.AlignLeft
- verticalAlignment: textField.verticalAlignment
+ Item {
+ id: placeHolderItem
+ height: textField.height
+ width: _placeHolderLayout.implicitWidth
+ opacity: 0.6
+ x: textField.activeFocus ? FishUI.Units.smallSpacing : (textField.width - placeHolderItem.width) / 2
+ y: 0
+
+ Behavior on x {
+ NumberAnimation {
+ duration: 200
+ }
+ }
+
+ RowLayout {
+ id: _placeHolderLayout
+ anchors.fill: parent
+
+ Image {
+ id: _placeImage
+ height: placeHolderItem.height - FishUI.Units.largeSpacing
+ width: height
+ sourceSize: Qt.size(width, height)
+ source: "qrc:/images/system-search-symbolic.svg"
+ }
+
+ Label {
+ id: _placeLabel
+ color: "white"
+ text: qsTr("Search")
+ visible: !textField.length && !textField.preeditText && (!textField.activeFocus || textField.horizontalAlignment !== Qt.AlignHCenter)
+ }
+ }
}
background: Rectangle {
diff --git a/translations/en_US.ts b/translations/en_US.ts
index 1fc57b5..51862fe 100644
--- a/translations/en_US.ts
+++ b/translations/en_US.ts
@@ -27,26 +27,15 @@
Launcher
-
- LauncherGridDelegate
-
- Open
- Open
-
-
- Uninstall
- Uninstall
-
-
main
-
+
Search
Search
-
+
Not found
Not found
diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts
index 3b2e3de..923e455 100644
--- a/translations/zh_CN.ts
+++ b/translations/zh_CN.ts
@@ -27,34 +27,15 @@
启动器
-
- LauncherGridDelegate
-
- Open
- 打开
-
-
- Send to dock
- 发送到程序坞
-
-
- Remove from dock
- 在程序坞中移除
-
-
- Uninstall
- 卸载
-
-
main
-
+
Search
搜索
-
+
Not found
未找到