added margins and ui changes for quickswitcher and completer

This commit is contained in:
Jedi18 2021-02-24 19:32:13 +05:30
parent 096f37df1f
commit 0ce7f78446
2 changed files with 19 additions and 11 deletions

View File

@ -15,6 +15,8 @@ Popup {
property bool centerRowContent: true
property int avatarHeight: 24
property int avatarWidth: 24
property int rowMargin: 0
property int rowSpacing: 5
property alias count: listView.count
signal completionClicked(string completion)
@ -89,10 +91,11 @@ Popup {
implicitWidth: fullWidth ? parent.width : contentItem.childrenRect.width
model: completer
verticalLayoutDirection: popup.bottomToTop ? ListView.BottomToTop : ListView.TopToBottom
spacing: rowSpacing
delegate: Rectangle {
color: model.index == popup.currentIndex ? colors.highlight : colors.base
height: chooser.childrenRect.height + 4
height: chooser.childrenRect.height + 2 * popup.rowMargin
implicitWidth: fullWidth ? popup.width : chooser.childrenRect.width + 4
property variant modelData: model
@ -120,11 +123,8 @@ Popup {
id: chooser
roleValue: popup.completerName
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: centerRowContent ? parent : null
anchors.centerIn: centerRowContent ? parent : null
anchors.fill: parent
anchors.margins: popup.rowMargin
DelegateChoice {
roleValue: "user"
@ -132,7 +132,8 @@ Popup {
RowLayout {
id: del
anchors.centerIn: centerRowContent ? parent : null
anchors.centerIn: parent
spacing: rowSpacing
Avatar {
height: popup.avatarHeight
@ -162,7 +163,8 @@ Popup {
RowLayout {
id: del
anchors.centerIn: centerRowContent ? parent : null
anchors.centerIn: parent
spacing: rowSpacing
Label {
text: model.unicode
@ -185,7 +187,8 @@ Popup {
RowLayout {
id: del
anchors.centerIn: centerRowContent ? parent : null
anchors.centerIn: centerRowContent ? parent : undefined
spacing: rowSpacing
Avatar {
height: popup.avatarHeight
@ -212,7 +215,8 @@ Popup {
RowLayout {
id: del
anchors.centerIn: centerRowContent ? parent : null
anchors.centerIn: parent
spacing: rowSpacing
Avatar {
height: popup.avatarHeight

View File

@ -6,6 +6,7 @@ Popup {
id: quickSwitcher
property int textWidth: 48
property int textMargin: 8
x: parent.width / 2 - width / 2
y: parent.height / 4 - height / 2
@ -23,7 +24,8 @@ Popup {
id: roomTextInput
anchors.fill: parent
font.pixelSize: quickSwitcher.textWidth - 24
font.pixelSize: quickSwitcher.textWidth - 18
padding: textMargin
color: colors.text
onTextEdited: {
@ -56,6 +58,8 @@ Popup {
avatarHeight: textWidth
avatarWidth: textWidth
centerRowContent: false
rowMargin: 8
rowSpacing: 6
closePolicy: Popup.NoAutoClose
}