Skip to content

Commit

Permalink
feat(qml): move source selector to search input
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Apr 27, 2024
1 parent 1044a04 commit 7303246
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/gui-qml/src/components/SearchEdit.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ TextEdit {
visible: !(parent.text.length || parent.inputMethodComposing)
font: parent.font
color: "#666"
leftPadding: parent.leftPadding
}

SyntaxHighlighterHelper {
Expand Down
16 changes: 16 additions & 0 deletions src/gui-qml/src/components/SearchField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ FocusScope {
property alias text: textInput.fakeText
property alias placeholderText: textInput.placeholderText
property bool isOpen: false
property int spacing: 4

activeFocusOnTab: true

Expand All @@ -27,6 +28,8 @@ FocusScope {
anchors.fill: parent
anchors.leftMargin: 12
anchors.rightMargin: 12
leftPadding: leftButton.width - anchors.leftMargin + root.spacing
rightPadding: rightButton.width - anchors.rightMargin + root.spacing
focus: true

property string fakeText
Expand All @@ -46,6 +49,19 @@ FocusScope {
}

ToolButton {
id: leftButton
icon.source: searchTab.site.icon
icon.color: "transparent"
onClicked: searchTab.openSources()
flat: true
height: 34
width: 34
anchors.left: editbg.left
anchors.verticalCenter: editbg.verticalCenter
}

ToolButton {
id: rightButton
icon.source: root.isOpen
? "/images/icons/remove.png"
: "/images/icons/add.png"
Expand Down
17 changes: 1 addition & 16 deletions src/gui-qml/src/components/SearchScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -211,21 +211,6 @@ Page {
}
}

Button {
id: sourcesButton
background.anchors.fill: sourcesButton
implicitWidth: 50
icon.source: searchTab.site.icon
icon.color: "transparent"
leftPadding: 0
rightPadding: 0
Layout.fillHeight: true
Material.elevation: 0
Material.roundedScale: Material.NotRounded

onClicked: searchTab.openSources()
}

Label {
text: pageLoader.status === TagSearchLoader.Ready
? (results.length > 0
Expand All @@ -239,7 +224,7 @@ Page {
Layout.fillHeight: true

background: Rectangle {
color: sourcesButton.background.color
color: nextButton.background.color
}
}

Expand Down

0 comments on commit 7303246

Please sign in to comment.