Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct search bar progress not filling-up toolbar height. Contributes TJC#212568 #138

Merged
merged 3 commits into from Aug 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions plugin/IndexButton.qml
Expand Up @@ -20,6 +20,7 @@ import QtQuick 2.0
import Sailfish.Silica 1.0

MouseArea {
id: root
property bool allowed: true
property color color: Theme.primaryColor
property int index
Expand All @@ -29,13 +30,13 @@ MouseArea {
enabled: count > 1 && allowed
opacity: count > 0 && allowed ? (count > 1 ? 1.0 : Theme.opacityHigh) : 0.0
width: Theme.itemSizeSmall
height: Theme.itemSizeSmall
height: parent.height

Label {
anchors.centerIn: parent
width: Math.min(parent.width - Theme.paddingSmall, implicitWidth)
fontSizeMode: Text.HorizontalFit
color: highlighted ? Theme.highlightColor : parent.color
color: root.highlighted ? Theme.highlightColor : parent.color
text: index + " | " + count
}
}
12 changes: 6 additions & 6 deletions plugin/SearchBarItem.qml
Expand Up @@ -39,23 +39,24 @@
import QtQuick 2.0
import Sailfish.Silica 1.0

BackgroundItem {
Item {
id: root

property bool active
property int matchCount: -1
property real expandedWidth
property bool searching
property alias searchProgress: progressBar.progress
property alias highlighted: searchIcon.highlighted

property real _margin: Math.max((width - searchIcon.width) / 2., 0.)

signal clicked()
signal requestSearch(string text)
signal requestPreviousMatch()
signal requestNextMatch()
signal requestCancel()

onClicked: active = true
onActiveChanged: if (active) searchField.forceActiveFocus()

states: State {
Expand All @@ -74,7 +75,6 @@ BackgroundItem {
duration: 400
}
}
highlighted: down || searchIcon.down

Rectangle {
id: progressBar
Expand Down Expand Up @@ -104,11 +104,11 @@ BackgroundItem {
width: icon.width
height: parent.height
icon.source: "image://theme/icon-m-search"
highlighted: down || root.down || searchField.activeFocus
highlighted: down || searchField.activeFocus

onClicked: {
root.clicked(mouse)
searchField.forceActiveFocus()
root.active = true
root.clicked()
}
}

Expand Down
2 changes: 1 addition & 1 deletion plugin/ToolBar.qml
Expand Up @@ -75,8 +75,8 @@ PanelBackground {
id: contentItem

spacing: Theme.paddingLarge
anchors.verticalCenter: parent.verticalCenter
x: Math.max(0, parent.width/2 - width/2)
height: parent.height
}

Connections {
Expand Down