Fix white bar above sticker picker

This commit is contained in:
Nicolas Werner 2023-01-12 21:41:08 +01:00
parent c38c4b47c8
commit 0c6a2fb706
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
2 changed files with 17 additions and 35 deletions

View File

@ -112,7 +112,6 @@ Menu {
Layout.preferredHeight: cellHeight * 5 Layout.preferredHeight: cellHeight * 5
Layout.preferredWidth: 7 * 52 + 20 Layout.preferredWidth: 7 * 52 + 20
Layout.leftMargin: 0
cellWidth: 52 cellWidth: 52
cellHeight: 52 cellHeight: 52
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds

View File

@ -34,10 +34,11 @@ Menu {
popup(showAt ? showAt : null); popup(showAt ? showAt : null);
} }
margins: 0 margins: 2
bottomPadding: 1 bottomPadding: 0
leftPadding: 1 leftPadding: 0
rightPadding: 1 rightPadding: 0
topPadding: 0
modal: true modal: true
focus: true focus: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
@ -45,26 +46,24 @@ Menu {
Rectangle { Rectangle {
color: Nheko.colors.window color: Nheko.colors.window
height: columnView.implicitHeight + 4 height: columnView.implicitHeight + Nheko.paddingSmall*2
width: stickersPerRow * stickerDimPad + 20 width: stickersPerRow * stickerDimPad + 20
ColumnLayout { ColumnLayout {
id: columnView id: columnView
spacing: 0 spacing: Nheko.paddingSmall
anchors.leftMargin: 3 anchors.leftMargin: Nheko.paddingSmall
anchors.rightMargin: 3 anchors.rightMargin: Nheko.paddingSmall
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.topMargin: 2
// Search field // Search field
TextField { TextField {
id: emojiSearch id: emojiSearch
Layout.topMargin: 3 Layout.preferredWidth: stickersPerRow * stickerDimPad + 20 - Nheko.paddingSmall
Layout.preferredWidth: stickersPerRow * stickerDimPad + 20 - 6
palette: Nheko.colors palette: Nheko.colors
background: null background: null
placeholderTextColor: Nheko.colors.buttonText placeholderTextColor: Nheko.colors.buttonText
@ -87,37 +86,22 @@ Menu {
onTriggered: stickerPopup.model.searchString = emojiSearch.text onTriggered: stickerPopup.model.searchString = emojiSearch.text
} }
ToolButton { ImageButton {
id: clearSearch id: clearSearch
visible: emojiSearch.text !== '' 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 focusPolicy: Qt.NoFocus
onClicked: emojiSearch.clear() onClicked: emojiSearch.clear()
hoverEnabled: true hoverEnabled: true
background: null
anchors { anchors {
verticalCenter: parent.verticalCenter top: parent.top
bottom: parent.bottom
right: parent.right 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 // emoji grid
@ -126,8 +110,7 @@ Menu {
model: roomid ? TimelineManager.completerFor("stickers", roomid) : null model: roomid ? TimelineManager.completerFor("stickers", roomid) : null
Layout.preferredHeight: cellHeight * 3.5 Layout.preferredHeight: cellHeight * 3.5
Layout.preferredWidth: stickersPerRow * stickerDimPad + 20 Layout.preferredWidth: stickersPerRow * stickerDimPad + 20 - Nheko.paddingSmall
Layout.leftMargin: 4
cellWidth: stickerDimPad cellWidth: stickerDimPad
cellHeight: stickerDimPad cellHeight: stickerDimPad
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds