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

View file

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

View file

@ -9,45 +9,47 @@ Item {
Label { Label {
id: lblName id: lblName
text:
if (account_display_name === "") {
account_username.split('@')[0]
}
else account_display_name
font.weight: Font.Bold
font.pixelSize: Theme.fontSizeSmall
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 { anchors {
left: parent.left left: parent.left
leftMargin: Theme.paddingMedium 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)
} }
Image { 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 y: Theme.paddingLarge
anchors { anchors {
left: lblName.right left: lblName.right
leftMargin: Theme.paddingSmall leftMargin: Theme.paddingSmall
verticalCenter: lblName.verticalCenter 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 { Label {
id: lblScreenName id: lblScreenName
truncationMode: TruncationMode.Fade
text: '@'+account_username text: '@'+account_username
font.pixelSize: Theme.fontSizeExtraSmall font.pixelSize: Theme.fontSizeExtraSmall
color: (pressed ? Theme.secondaryHighlightColor : Theme.secondaryColor) color: (pressed ? Theme.secondaryHighlightColor : Theme.secondaryColor)
truncationMode: TruncationMode.Fade
anchors { anchors {
left: iconLocked.right left: icnLocked.right
right: lblDate.left right: lblDate.left
leftMargin: Theme.paddingMedium leftMargin: Theme.paddingMedium
baseline: lblName.baseline baseline: lblName.baseline
@ -56,9 +58,9 @@ Item {
Label { Label {
id: lblDate id: lblDate
color: (pressed ? Theme.highlightColor : Theme.primaryColor)
text: Format.formatDate(created_at, new Date() - created_at < 60*60*1000 ? Formatter.DurationElapsedShort : Formatter.TimeValueTwentyFourHours) text: Format.formatDate(created_at, new Date() - created_at < 60*60*1000 ? Formatter.DurationElapsedShort : Formatter.TimeValueTwentyFourHours)
font.pixelSize: Theme.fontSizeExtraSmall font.pixelSize: Theme.fontSizeExtraSmall
color: (pressed ? Theme.highlightColor : Theme.primaryColor)
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
anchors { anchors {
right: parent.right right: parent.right

View file

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

View file

@ -13,31 +13,18 @@ BackgroundItem {
height: if (myList.type === "notifications" && ( model.type === "favourite" || model.type === "reblog" )) { 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) 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) } 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 { Rectangle {
id: bgDirect id: bgDirect
x: 0 x: 0
y: 0 y: 0
visible: status_visibility == 'direct' visible: status_visibility === "direct"
width: parent.width width: parent.width
height: parent.height height: parent.height
opacity: 0.3 opacity: 0.3
color: Theme.highlightBackgroundColor 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 { Rectangle {
id: bgNotifications id: bgNotifications
x: 0 x: 0
@ -120,7 +107,7 @@ BackgroundItem {
Image { Image {
id: iconDirectMsg id: iconDirectMsg
visible: status_visibility == 'direct' visible: status_visibility === "direct"
width: Theme.iconSizeMedium width: Theme.iconSizeMedium
height: width height: width
source: "image://theme/icon-m-mail" source: "image://theme/icon-m-mail"
@ -271,7 +258,9 @@ BackgroundItem {
id: mnu id: mnu
MenuItem { MenuItem {
id: mnuBoost
visible: model.type !== "follow" visible: model.type !== "follow"
enabled: status_visibility !== "direct"
text: typeof model.reblogged !== "undefined" && model.reblogged ? qsTr("Unboost") : qsTr("Boost") text: typeof model.reblogged !== "undefined" && model.reblogged ? qsTr("Unboost") : qsTr("Boost")
onClicked: { onClicked: {
var status = typeof model.reblogged !== "undefined" && model.reblogged var status = typeof model.reblogged !== "undefined" && model.reblogged
@ -311,7 +300,8 @@ BackgroundItem {
} }
MenuItem { 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") text: typeof model.favourited !== "undefined" && model.favourited ? qsTr("Unfavorite") : qsTr("Favorite")
onClicked: { onClicked: {
var status = typeof model.favourited !== "undefined" && model.favourited var status = typeof model.favourited !== "undefined" && model.favourited
@ -351,6 +341,7 @@ BackgroundItem {
} }
MenuItem { MenuItem {
id: mnuMention
visible: model.type === "follow" visible: model.type === "follow"
text: qsTr("Mention") text: qsTr("Mention")
onClicked: { onClicked: {