small fixes for notification page

This commit is contained in:
molan-git 2020-06-10 10:17:51 +02:00
parent d157c08c34
commit 7eaad1b867
5 changed files with 35 additions and 42 deletions

View file

@ -270,7 +270,9 @@ Page {
IconButton {
id: btnSmileys
property string selection
opacity: 0.7
icon {
color: Theme.secondaryColor
@ -284,9 +286,7 @@ Page {
right: parent.right
rightMargin: Theme.paddingSmall
}
onSelectionChanged: {
console.log(selection)
}
onSelectionChanged: { console.log(selection) }
onClicked: pageStack.push(emojiSelect)
}

View file

@ -87,7 +87,7 @@ Page {
if (search.charAt(0) === "@") {
loader.sourceComponent = userListComponent
} else if (search.charAt(0) === "#") {
loader.sourceComponen = tagListComponent
loader.sourceComponent = tagListComponent
} else { loader.sourceComponent = wordListComponent}
}

View file

@ -9,45 +9,47 @@ Item {
Label {
id: lblName
anchors {
left: parent.left
leftMargin: Theme.paddingMedium
}
text:
if (account_display_name === "") {
account_username.split('@')[0]
}
else account_display_name
width: contentWidth > parent.width /2 ? parent.width /2 : contentWidth
truncationMode: TruncationMode.Fade
font.weight: Font.Bold
font.pixelSize: Theme.fontSizeSmall
color: (pressed ? Theme.highlightColor : Theme.primaryColor)
color: if (myList.type === "notifications" && ( model.type === "favourite" || model.type === "reblog" )) {
(pressed ? Theme.secondaryHighlightColor : (!highlight ? Theme.secondaryColor : Theme.secondaryHighlightColor))
} else (pressed ? Theme.highlightColor : (!highlight ? Theme.primaryColor : Theme.secondaryColor))
truncationMode: TruncationMode.Fade
width: contentWidth > parent.width /2 ? parent.width /2 : contentWidth
anchors {
left: parent.left
leftMargin: Theme.paddingMedium
}
}
Image {
id: iconLocked
id: icnLocked
visible: account_locked
opacity: 0.8
source: "image://theme/icon-s-secure?" + (pressed ? Theme.highlightColor : Theme.primaryColor)
width: account_locked ? Theme.iconSizeExtraSmall*0.8 : 0
height: width
y: Theme.paddingLarge
anchors {
left: lblName.right
leftMargin: Theme.paddingSmall
verticalCenter: lblName.verticalCenter
}
visible: account_locked
width: account_locked ? Theme.iconSizeExtraSmall*0.8 : 0
opacity: 0.8
height: width
source: "image://theme/icon-s-secure?" + (pressed ? Theme.highlightColor : Theme.primaryColor)
}
Label {
id: lblScreenName
truncationMode: TruncationMode.Fade
text: '@'+account_username
font.pixelSize: Theme.fontSizeExtraSmall
color: (pressed ? Theme.secondaryHighlightColor : Theme.secondaryColor)
truncationMode: TruncationMode.Fade
anchors {
left: iconLocked.right
left: icnLocked.right
right: lblDate.left
leftMargin: Theme.paddingMedium
baseline: lblName.baseline
@ -56,9 +58,9 @@ Item {
Label {
id: lblDate
color: (pressed ? Theme.highlightColor : Theme.primaryColor)
text: Format.formatDate(created_at, new Date() - created_at < 60*60*1000 ? Formatter.DurationElapsedShort : Formatter.TimeValueTwentyFourHours)
font.pixelSize: Theme.fontSizeExtraSmall
color: (pressed ? Theme.highlightColor : Theme.primaryColor)
horizontalAlignment: Text.AlignRight
anchors {
right: parent.right

View file

@ -85,7 +85,7 @@ BackgroundItem {
}
Image {
id: iconVerified
id: iconLocked
visible: account_locked
y: Theme.paddingLarge
opacity: 0.8
@ -108,7 +108,7 @@ BackgroundItem {
font.pixelSize: Theme.fontSizeExtraSmall
color: (pressed ? Theme.secondaryHighlightColor : Theme.secondaryColor)
anchors {
left: iconVerified.right
left: iconLocked.right
right: lblDate.left
leftMargin: Theme.paddingMedium
baseline: lblName.baseline

View file

@ -13,31 +13,18 @@ BackgroundItem {
height: if (myList.type === "notifications" && ( model.type === "favourite" || model.type === "reblog" )) {
mnu.height + miniHeader.height + Theme.paddingLarge + lblContent.height + Theme.paddingLarge + (miniStatus.visible ? miniStatus.height : 0)
} else mnu.height + miniHeader.height + (typeof attachments !== "undefined" && attachments.count ? media.height + Theme.paddingLarge + Theme.paddingMedium: Theme.paddingLarge) + lblContent.height + Theme.paddingLarge + (miniStatus.visible ? miniStatus.height : 0) + (iconDirectMsg.visible ? iconDirectMsg.height : 0)
Rectangle {
id: bgDirect
x: 0
y: 0
visible: status_visibility == 'direct'
visible: status_visibility === "direct"
width: parent.width
height: parent.height
opacity: 0.3
color: Theme.highlightBackgroundColor
}
/* Rectangle {
id: bgDelegate
x: 0
y: 0
visible: status_visibility !== 'direct'
width: parent.width
height: parent.height
opacity: 0.15
gradient: Gradient {
GradientStop { position: 0.7; color: "transparent" }
GradientStop { position: 1.0; color: Theme.highlightDimmerColor }
}
} */
Rectangle {
id: bgNotifications
x: 0
@ -120,7 +107,7 @@ BackgroundItem {
Image {
id: iconDirectMsg
visible: status_visibility == 'direct'
visible: status_visibility === "direct"
width: Theme.iconSizeMedium
height: width
source: "image://theme/icon-m-mail"
@ -271,7 +258,9 @@ BackgroundItem {
id: mnu
MenuItem {
id: mnuBoost
visible: model.type !== "follow"
enabled: status_visibility !== "direct"
text: typeof model.reblogged !== "undefined" && model.reblogged ? qsTr("Unboost") : qsTr("Boost")
onClicked: {
var status = typeof model.reblogged !== "undefined" && model.reblogged
@ -311,7 +300,8 @@ BackgroundItem {
}
MenuItem {
visible: model.type !== "follow"
id: mnuFavourite
visible: model.type !== "follow" || model.status_visibility !== "direct"
text: typeof model.favourited !== "undefined" && model.favourited ? qsTr("Unfavorite") : qsTr("Favorite")
onClicked: {
var status = typeof model.favourited !== "undefined" && model.favourited
@ -351,6 +341,7 @@ BackgroundItem {
}
MenuItem {
id: mnuMention
visible: model.type === "follow"
text: qsTr("Mention")
onClicked: {