1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 10:42:29 +01:00

Add workaround for small search

See https://bugreports.qt.io/browse/QTBUG-111515
This commit is contained in:
Elias Steurer 2023-02-25 10:50:30 +01:00
parent 00a830518e
commit 02072a63af
3 changed files with 43 additions and 51 deletions

View File

@ -1,5 +1,6 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Controls.Material
import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material.impl
@ -48,8 +49,7 @@ Item {
TabBar {
height: parent.height
background: Item {
}
background: Item {}
anchors {
top: parent.top
topMargin: 5
@ -95,14 +95,52 @@ Item {
}
}
Util.Search {
height: parent.height
RowLayout {
anchors {
right: btnSortOrder.left
rightMargin: 10
top: parent.top
bottom: parent.bottom
}
Text {
text: qsTr("Search:")
color: Material.secondaryTextColor
font.pointSize: 12
font.family: App.settings.font
Layout.alignment: Qt.AlignVCenter
Layout.rightMargin: 10
}
TextField {
id: txtSearch
// Workaround with manual Text until
// https://bugreports.qt.io/browse/QTBUG-111515 is fixed
// placeholderTextColor: Material.secondaryTextColor
// placeholderText: qsTr("Search for Wallpaper & Widgets")
Layout.preferredHeight: 30
Layout.preferredWidth : 250
Layout.alignment: Qt.AlignVCenter
color: Material.secondaryTextColor
onTextChanged: {
if (txtSearch.text.length === 0)
App.installedListFilter.resetFilter();
else
App.installedListFilter.sortByName(txtSearch.text);
}
}
ToolButton {
id: icnSearch
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_search.svg"
implicitHeight: 30
implicitWidth: height
icon.width: height
icon.height: height
icon.color: Material.iconColor
}
}
ToolButton {

View File

@ -31,7 +31,6 @@ set(QML
qml/MouseHoverBlocker.qml
qml/Popup.qml
qml/RippleEffect.qml
qml/Search.qml
qml/Shake.qml
qml/Slider.qml
qml/Tag.qml

View File

@ -1,45 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material 2.0
import ScreenPlayApp
import ScreenPlay
Item {
id: root
implicitWidth: 300
implicitHeight: 50
ToolButton {
id: icnSearch
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_search.svg"
height: 30
width: 30
icon.width: 30
icon.height: 30
icon.color: Material.iconColor
anchors {
right: parent.right
verticalCenter: parent.verticalCenter
}
}
TextField {
id: txtSearch
placeholderTextColor: Material.secondaryTextColor
anchors.fill:parent
anchors.margins: 10
color: Material.secondaryTextColor
placeholderText: qsTr("Search for Wallpaper & Widgets")
onTextChanged: {
if (txtSearch.text.length === 0)
App.installedListFilter.resetFilter();
else
App.installedListFilter.sortByName(txtSearch.text);
}
}
}