Skip to content

Commit

Permalink
Fix white bar above sticker picker
Browse files Browse the repository at this point in the history
  • Loading branch information
deepbluev7 committed Jan 12, 2023
1 parent c38c4b4 commit 0c6a2fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 35 deletions.
1 change: 0 additions & 1 deletion resources/qml/emoji/EmojiPicker.qml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ Menu {

Layout.preferredHeight: cellHeight * 5
Layout.preferredWidth: 7 * 52 + 20
Layout.leftMargin: 0
cellWidth: 52
cellHeight: 52
boundsBehavior: Flickable.StopAtBounds
Expand Down
51 changes: 17 additions & 34 deletions resources/qml/emoji/StickerPicker.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,36 @@ Menu {
popup(showAt ? showAt : null);
}

margins: 0
bottomPadding: 1
leftPadding: 1
rightPadding: 1
margins: 2
bottomPadding: 0
leftPadding: 0
rightPadding: 0
topPadding: 0
modal: true
focus: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
width: stickersPerRow * stickerDimPad + 20

Rectangle {
color: Nheko.colors.window
height: columnView.implicitHeight + 4
height: columnView.implicitHeight + Nheko.paddingSmall*2
width: stickersPerRow * stickerDimPad + 20

ColumnLayout {
id: columnView

spacing: 0
anchors.leftMargin: 3
anchors.rightMargin: 3
spacing: Nheko.paddingSmall
anchors.leftMargin: Nheko.paddingSmall
anchors.rightMargin: Nheko.paddingSmall
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 2

// Search field
TextField {
id: emojiSearch

Layout.topMargin: 3
Layout.preferredWidth: stickersPerRow * stickerDimPad + 20 - 6
Layout.preferredWidth: stickersPerRow * stickerDimPad + 20 - Nheko.paddingSmall
palette: Nheko.colors
background: null
placeholderTextColor: Nheko.colors.buttonText
Expand All @@ -87,37 +86,22 @@ Menu {
onTriggered: stickerPopup.model.searchString = emojiSearch.text
}

ToolButton {
ImageButton {
id: clearSearch

visible: emojiSearch.text !== ''
icon.source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearSearch.hovered ? Nheko.colors.highlight : Nheko.colors.buttonText)

image: ":/icons/icons/ui/round-remove-button.svg"
focusPolicy: Qt.NoFocus
onClicked: emojiSearch.clear()
hoverEnabled: true
background: null

anchors {
verticalCenter: parent.verticalCenter
top: parent.top
bottom: parent.bottom
right: parent.right
rightMargin: Nheko.paddingSmall
}
// clear the default hover effects.

Image {
height: parent.height - 2 * Nheko.paddingSmall
width: height
source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearSearch.hovered ? Nheko.colors.highlight : Nheko.colors.buttonText)

anchors {
verticalCenter: parent.verticalCenter
right: parent.right
margins: Nheko.paddingSmall
}

}

}

}

// emoji grid
Expand All @@ -126,8 +110,7 @@ Menu {

model: roomid ? TimelineManager.completerFor("stickers", roomid) : null
Layout.preferredHeight: cellHeight * 3.5
Layout.preferredWidth: stickersPerRow * stickerDimPad + 20
Layout.leftMargin: 4
Layout.preferredWidth: stickersPerRow * stickerDimPad + 20 - Nheko.paddingSmall
cellWidth: stickerDimPad
cellHeight: stickerDimPad
boundsBehavior: Flickable.StopAtBounds
Expand Down

0 comments on commit 0c6a2fb

Please sign in to comment.