Skip to content

Commit

Permalink
Fix search not grabbing focus
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekmedia committed Jul 7, 2021
1 parent ac702e9 commit 6bf39e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
16 changes: 6 additions & 10 deletions contents/ui/ItemMultiGridView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,10 @@ PlasmaExtras.ScrollArea {

property bool grabFocus: false
property bool showDescriptions: false
property bool square: false
property int iconSize: units.iconSizes.medium

property alias model: repeater.model
property alias count: repeater.count
property int cellWidth: parent.width
property int cellHeight: iconSize + (2 * highlightItemSvg.margins.top)

//clip: true
verticalScrollBarPolicy: Qt.ScrollBarAsNeeded
Expand Down Expand Up @@ -112,7 +109,7 @@ PlasmaExtras.ScrollArea {
PlasmaExtras.Heading {
id: gridViewLabel
anchors.top: parent.top
anchors.topMargin: 10
//anchors.topMargin: 8
x: units.smallSpacing
width: parent.width - x
height: dummyHeading.height
Expand All @@ -138,19 +135,18 @@ PlasmaExtras.ScrollArea {
top: gridViewLabel.bottom
topMargin: units.smallSpacing
}
square: itemMultiGrid.square
showDescriptions: itemMultiGrid.showDescriptions
increaseLeftSpacings: true

//TODO >
dragEnabled: false
dropEnabled: false
showDescriptions: itemMultiGrid.showDescriptions
// <

width: parent.width
height: Math.ceil(count * cellHeight)
cellWidth: itemMultiGrid.cellWidth
cellHeight: itemMultiGrid.cellHeight
iconSize: itemMultiGrid.iconSize
cellWidth: parent.width
cellHeight: root.iconSize + (2 * highlightItemSvg.margins.top)//<>cellSize
iconSize: root.iconSize
model: repeater.model.modelForRow(index)

onFocusChanged: {
Expand Down
7 changes: 2 additions & 5 deletions contents/ui/MainColumnItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ Item {
width: parent.width
model: runnerModel
showDescriptions: plasmoid.configuration.showDescription
grabFocus: true
opacity: searching ? 1.0 : 0.0
onOpacityChanged: {
if (opacity == 1.0) {
Expand All @@ -363,11 +364,7 @@ Item {
}

Keys.onPressed: {

if (event.key == Qt.Key_Tab) {
event.accepted = true;
documentsFavoritesGrid.tryActivate(0, 0)
} else if (event.key == Qt.Key_Backspace) {
if (event.key == Qt.Key_Backspace) {
event.accepted = true;
if (searching)
searchField.backspace();
Expand Down

0 comments on commit 6bf39e4

Please sign in to comment.