small ui-adjustments

This commit is contained in:
molan-git 2020-06-04 19:44:12 +02:00
parent 75e4a71955
commit 99b070124b
8 changed files with 58 additions and 20 deletions

View file

@ -88,7 +88,6 @@ var tootParser = function(data){
ret.display_name = data.account.display_name ret.display_name = data.account.display_name
ret.avatar_static = data.account.avatar_static ret.avatar_static = data.account.avatar_static
ret.favourited = data.favourited ? true : false ret.favourited = data.favourited ? true : false
ret.favourites_count = data.favourites_count ? data.favourites_count : 0 ret.favourites_count = data.favourites_count ? data.favourites_count : 0
@ -100,7 +99,6 @@ var tootParser = function(data){
ret.sensitive = data.sensitive ? true : false ret.sensitive = data.sensitive ? true : false
ret.visibility = data.visibility ? data.visibility : false ret.visibility = data.visibility ? data.visibility : false
console.log(ret) console.log(ret)
} }
var test = 1; var test = 1;

View file

@ -259,7 +259,7 @@ Page {
property string selection property string selection
opacity: 0.7 opacity: 0.7
icon { icon {
color: Theme.highlightColor color: Theme.secondaryColor
width: Theme.iconSizeSmallPlus width: Theme.iconSizeSmallPlus
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: "../../qml/images/emojiselect.svg" source: "../../qml/images/emojiselect.svg"

View file

@ -31,14 +31,13 @@ Page {
focus: true focus: true
label: qsTr("Enter a valid Mastodon instance URL") label: qsTr("Enter a valid Mastodon instance URL")
text: "https://" text: "https://"
placeholderText: "https://mastodon.social"
width: parent.width width: parent.width
validator: RegExpValidator { regExp: /^(ftp|http|https):\/\/[^ "]+$/ } validator: RegExpValidator { regExp: /^(ftp|http|https):\/\/[^ "]+$/ }
EnterKey.enabled: instance.acceptableInput; EnterKey.enabled: instance.acceptableInput;
EnterKey.highlighted: instance.acceptableInput; EnterKey.highlighted: instance.acceptableInput;
EnterKey.iconSource: "image://theme/icon-m-accept" EnterKey.iconSource: "image://theme/icon-m-accept"
EnterKey.onClicked: { EnterKey.onClicked: {
Logic.api = new Logic.MastodonAPI({ instance: instance.text, api_user_token: "" }); Logic.api = Logic.mastodonAPI({ instance: instance.text, api_user_token: "" });
Logic.api.registerApplication("Tooter", Logic.api.registerApplication("Tooter",
'http://localhost/harbour-tooter', // redirect uri, we will need this later on 'http://localhost/harbour-tooter', // redirect uri, we will need this later on
["read", "write", "follow"], //scopes ["read", "write", "follow"], //scopes

View file

@ -32,7 +32,7 @@ Page {
VisualItemModel { VisualItemModel {
id: visualModel id: visualModel
MyList{ MyList{
id: tlHome; id: tlHome
title: qsTr("Home") title: qsTr("Home")
type: "timelines/home" type: "timelines/home"
mdl: Logic.modelTLhome mdl: Logic.modelTLhome
@ -42,35 +42,35 @@ Page {
} }
MyList{ MyList{
id: tlNotifications; id: tlNotifications
title: qsTr("Notifications") title: qsTr("Notifications")
type: "notifications" type: "notifications"
notifier: true notifier: true
mdl: Logic.modelTLnotifications mdl: Logic.modelTLnotifications
width: parent.itemWidth width: parent.itemWidth
height: parent.itemHeight height: parent.itemHeight
onOpenDrawer: infoPanel.open = setDrawer onOpenDrawer: infoPanel.open = setDrawer
} }
MyList{ MyList{
id: tlLocal; id: tlLocal
title: qsTr("Local") title: qsTr("Local")
type: "timelines/public?local=true" type: "timelines/public?local=true"
//params: ["local", true] //params: ["local", true]
mdl: Logic.modelTLlocal mdl: Logic.modelTLlocal
width: parent.itemWidth width: parent.itemWidth
height: parent.itemHeight height: parent.itemHeight
onOpenDrawer: infoPanel.open = setDrawer onOpenDrawer: infoPanel.open = setDrawer
} }
MyList{ MyList{
id: tlPublic; id: tlPublic
title: qsTr("Federated") title: qsTr("Federated")
type: "timelines/public" type: "timelines/public"
mdl: Logic.modelTLpublic mdl: Logic.modelTLpublic
width: parent.itemWidth width: parent.itemWidth
height: parent.itemHeight height: parent.itemHeight
onOpenDrawer: infoPanel.open = setDrawer onOpenDrawer: infoPanel.open = setDrawer
} }
Item { Item {

View file

@ -15,7 +15,7 @@ Page {
property string profileBackground: "" property string profileBackground: ""
property string note: "" property string note: ""
property string url: "" property string url: ""
property int user_id property string user_id: ""
property int statuses_count property int statuses_count
property int following_count property int following_count
property int followers_count property int followers_count
@ -175,7 +175,6 @@ Page {
id: txtContainer id: txtContainer
width: parent.width width: parent.width
height: Math.min( txtNote.height, parent.height * 0.55 ) height: Math.min( txtNote.height, parent.height * 0.55 )
//color: "transparent"
visible: { visible: {
if ((note.text === "") || ( note.text === "<p></p>" )) { if ((note.text === "") || ( note.text === "<p></p>" )) {
false false

View file

@ -46,7 +46,7 @@ Page {
height: txtRemoveAccount.height + btnRemoveAccount.height + Theme.paddingLarge height: txtRemoveAccount.height + btnRemoveAccount.height + Theme.paddingLarge
anchors { anchors {
left: parent.left left: parent.left
leftMargin: Theme.paddingLarge leftMargin: Theme.horizontalPageMargin
right: parent.right right: parent.right
rightMargin: Theme.paddingLarge rightMargin: Theme.paddingLarge
} }
@ -99,9 +99,8 @@ Page {
color: Theme.highlightColor color: Theme.highlightColor
anchors { anchors {
left: parent.left left: parent.left
leftMargin: Theme.paddingLarge * 1.9
right: parent.right right: parent.right
rightMargin: Theme.paddingLarge * 1.2 rightMargin: Theme.paddingLarge + icnRemoveAccount
} }
} }
} }

View file

@ -22,6 +22,7 @@ SilicaListView {
property variant vars property variant vars
property variant conf property variant conf
property bool notifier: false property bool notifier: false
model: mdl model: mdl
signal notify (string what, int num) signal notify (string what, int num)

View file

@ -13,6 +13,7 @@ BackgroundItem {
height: 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) height: 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)
Rectangle { Rectangle {
id: bgDirect
x: 0 x: 0
y: 0 y: 0
visible: status_visibility == 'direct' visible: status_visibility == 'direct'
@ -22,6 +23,20 @@ BackgroundItem {
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 }
}
} */
MiniStatus { MiniStatus {
id: miniStatus id: miniStatus
anchors { anchors {
@ -117,13 +132,16 @@ BackgroundItem {
Text { Text {
id: lblContent id: lblContent
visible: model.type !== "follow"
text: content.replace(new RegExp("<a ", 'g'), '<a style="text-decoration: none; color:'+(pressed ? Theme.secondaryColor : Theme.highlightColor)+'" ') text: content.replace(new RegExp("<a ", 'g'), '<a style="text-decoration: none; color:'+(pressed ? Theme.secondaryColor : Theme.highlightColor)+'" ')
textFormat: Text.RichText textFormat: Text.RichText
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
linkColor: Theme.highlightColor linkColor: Theme.highlightColor
wrapMode: Text.Wrap wrapMode: Text.Wrap
color: (pressed ? Theme.highlightColor : (!highlight ? Theme.primaryColor : Theme.secondaryColor)) color: (pressed ? Theme.highlightColor : (!highlight ? Theme.primaryColor : Theme.secondaryColor))
height: content.length ? (contentWarningLabel.paintedHeight > paintedHeight ? contentWarningLabel.paintedHeight : paintedHeight) : 0 height: if (model.type === "follow") {
Theme.paddingLarge
} else content.length ? (contentWarningLabel.paintedHeight > paintedHeight ? contentWarningLabel.paintedHeight : paintedHeight) : 0
anchors { anchors {
left: miniHeader.left left: miniHeader.left
leftMargin: Theme.paddingMedium leftMargin: Theme.paddingMedium
@ -210,7 +228,7 @@ BackgroundItem {
id: mnu id: mnu
MenuItem { MenuItem {
enabled: model.type !== "follow" visible: model.type !== "follow"
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
@ -250,7 +268,7 @@ BackgroundItem {
} }
MenuItem { MenuItem {
enabled: model.type !== "follow" visible: model.type !== "follow"
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
@ -288,6 +306,30 @@ BackgroundItem {
} }
} }
} }
MenuItem {
visible: model.type === "follow"
text: qsTr("Mention")
onClicked: {
pageStack.push(Qt.resolvedUrl("../ConversationPage.qml"), {
headerTitle: "Mention",
description: "@"+reblog_account_acct,
type: "new"
})
}
Image {
id: icMT
anchors {
leftMargin: Theme.horizontalPageMargin
left: parent.left
verticalCenter: parent.verticalCenter
}
width: Theme.iconSizeExtraSmall
height: width
source: "image://theme/icon-s-chat?" + (!model.favourited ? Theme.highlightColor : Theme.primaryColor)
}
}
} }
onClicked: { onClicked: {