Commit 0e82fc26 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

emojier: improve placement of the delegates

Removes weird margin on the right side and the delegates look purposely
placed.
parent 953ef671
...@@ -29,6 +29,8 @@ Kirigami.ScrollablePage ...@@ -29,6 +29,8 @@ Kirigami.ScrollablePage
id: view id: view
property alias model: emojiModel.sourceModel property alias model: emojiModel.sourceModel
property alias category: filter.category property alias category: filter.category
leftPadding: 0
rightPadding: 0
header: QQC2.TextField { header: QQC2.TextField {
id: searchField id: searchField
...@@ -61,8 +63,13 @@ Kirigami.ScrollablePage ...@@ -61,8 +63,13 @@ Kirigami.ScrollablePage
GridView { GridView {
id: emojiView id: emojiView
cellWidth: 64
cellHeight: cellWidth readonly property real desiredSize: Kirigami.Units.gridUnit * 3
readonly property real columnsToHave: Math.ceil(width/desiredSize)
cellWidth: width/columnsToHave
cellHeight: desiredSize
model: CategoryModelFilter { model: CategoryModelFilter {
id: filter id: filter
sourceModel: SearchModelFilter { sourceModel: SearchModelFilter {
...@@ -78,11 +85,19 @@ Kirigami.ScrollablePage ...@@ -78,11 +85,19 @@ Kirigami.ScrollablePage
} }
currentIndex: -1 currentIndex: -1
delegate: QQC2.Label { delegate: MouseArea {
font.pointSize: 30 QQC2.Label {
fontSizeMode: Text.Fit font.pointSize: 30
minimumPointSize: 10 fontSizeMode: Text.Fit
text: model.display minimumPointSize: 10
text: model.display
horizontalAlignment: Text.AlignHCenter
anchors.fill: parent
anchors.margins: 1
}
width: emojiView.cellWidth
height: emojiView.cellHeight
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
QQC2.ToolTip.text: model.toolTip QQC2.ToolTip.text: model.toolTip
...@@ -98,12 +113,10 @@ Kirigami.ScrollablePage ...@@ -98,12 +113,10 @@ Kirigami.ScrollablePage
window.report(model.display, model.toolTip) window.report(model.display, model.toolTip)
} }
MouseArea {
id: mouse id: mouse
anchors.fill: parent hoverEnabled: true
hoverEnabled: true onClicked: reportEmoji()
onClicked: reportEmoji()
}
} }
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment