Skip to content

Commit

Permalink
Merge pull request #280 from ioriayane/Release/v0.38.0
Browse files Browse the repository at this point in the history
Release/v0.38.0
  • Loading branch information
ioriayane authored Sep 28, 2024
2 parents 3f28667 + 3c8f7c2 commit f7a0d0b
Show file tree
Hide file tree
Showing 43 changed files with 380 additions and 193 deletions.
2 changes: 1 addition & 1 deletion 1stparty/atproto
Submodule atproto updated 230 files
2 changes: 1 addition & 1 deletion app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int main(int argc, char *argv[])
app.setOrganizationName(QStringLiteral("relog"));
app.setOrganizationDomain(QStringLiteral("hagoromo.relog.tech"));
app.setApplicationName(QStringLiteral("Hagoromo"));
app.setApplicationVersion(QStringLiteral("0.37.0"));
app.setApplicationVersion(QStringLiteral("0.38.0"));
#ifndef HAGOROMO_RELEASE_BUILD
app.setApplicationVersion(app.applicationVersion() + "d");
#endif
Expand Down
8 changes: 8 additions & 0 deletions app/qml/dialogs/AccountDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ Dialog {
fontPointSize: AdjustedValues.f8
visible: model.isMain
}
TagLabel {
source: ""
text: " Please login"
color: Material.color(Material.Red)
fontPointSize: AdjustedValues.f8
visible: !model.authorized
}

Item {
Layout.fillWidth: true
Layout.preferredHeight: 1
Expand Down
2 changes: 1 addition & 1 deletion app/qml/dialogs/MessageDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Dialog {
property int parentWidth: parent.width
property alias text: messageTextArea.text

property string status: "normal"
property string status: "normal" // normal, error
property bool useCancel: false

function show(status, title, message){
Expand Down
47 changes: 40 additions & 7 deletions app/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,27 @@ ApplicationWindow {

AccountDialog {
id: accountDialog
property bool showLogainAgainMessage: false
accountModel: accountListModel
onClosed: accountListModel.syncColumn()
onOpened: {
if(showLogainAgainMessage){
messageDialog.show("error", qsTr("Authentication error"),
qsTr("Some accounts require you to log in again."))
}
showLogainAgainMessage = false
}
onClosed: {
if(columnManageModel.rowCount() === 0){
if(accountListModel.allAccountsReady){
// すべてのアカウント情報の認証が終わったのでカラムを復元
console.log("start loading columns")
columnManageModel.load()
listsListModel.load()
}
}else{
accountListModel.syncColumn()
}
}
onErrorOccured: (account_uuid, code, message) => appWindow.errorHandler(account_uuid, code, message)
onRequestAddMutedWords: (account_uuid) => {
if(addMutedWordDialog.account.set(accountListModel, account_uuid)){
Expand Down Expand Up @@ -450,18 +469,31 @@ ApplicationWindow {
id: accountListModel
onUpdatedSession: (row, uuid) => {
console.log("onUpdatedSession:" + row + ", " + uuid)
if(columnManageModel.rowCount() === 0 && allAccountsReady()){
// すべてのアカウント情報の認証が終わったのでカラムを復元
console.log("start loading columns")
columnManageModel.load()
listsListModel.load()
}
}
onUpdatedAccount: (row, uuid) => {
console.log("onUpdatedAccount:" + row + ", " + uuid)
// カラムを更新しにいく
repeater.updateAccount(uuid)
}
onFinished: {
console.log("onFinished:" + allAccountsReady + ", count=" + columnManageModel.rowCount())
if(rowCount() === 0){
accountDialog.open()
}else if(columnManageModel.rowCount() === 0){
if(allAccountsReady){
// すべてのアカウント情報の認証が終わったのでカラムを復元
console.log("start loading columns")
columnManageModel.load()
listsListModel.load()
}else{
// 失敗しているアカウントがあるのでダイアログを出す
messageDialog.close()
accountDialog.showLogainAgainMessage = true
accountDialog.open()
}
}
}

onErrorOccured: (code, message) => appWindow.errorHandler("", code, message)

function syncColumn(){
Expand Down Expand Up @@ -717,6 +749,7 @@ ApplicationWindow {
SideBar {
anchors.fill: parent
anchors.margins: 1
ready: accountListModel.allAccountsReady
post.onClicked: postDialog.open()
search.onClicked: searchDialog.open()
addColumn.onClicked: addColumnDialog.open()
Expand Down
2 changes: 1 addition & 1 deletion app/qml/parts/ExternalLinkCard.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ClickableFrame {
ImageWithIndicator {
id: thumbImage
Layout.preferredWidth: externalLinkFrame.width
Layout.preferredHeight: status !== Image.Null ? externalLinkFrame.width * 0.5 : 5
Layout.preferredHeight: thumbImage.source !== "" ? externalLinkFrame.width * 0.5 : 5
fillMode: Image.PreserveAspectCrop
}
Label {
Expand Down
127 changes: 74 additions & 53 deletions app/qml/parts/ImagePreview.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,88 +6,109 @@ import tech.relog.hagoromo.singleton 1.0

import "../controls"

GridLayout {
Frame {
id: imagePreviewLayout
visible: embedImages.length > 0
columnSpacing: 6
rowSpacing: 6
columns: 2
contentWidth: contentRootLayout.implicitWidth
contentHeight: contentRootLayout.implicitHeight
topInset: 0
leftInset: 0
rightInset: 0
bottomInset: 0
topPadding: 0
leftPadding: 0
rightPadding: 0
bottomPadding: 0

background: Rectangle {
color: "transparent"
}

// 0:compact, 1:normal, 2:when one is whole, 3:all whole
property int layoutType: 1
property int layoutWidth: 100
property var embedImages: []
property var embedAlts: []
property var embedImageRatios: []

property int cellWidthAdjust: 3
property int cellWidth: imagePreviewLayout.layoutWidth / columns - cellWidthAdjust
property int cellWidth: imagePreviewLayout.layoutWidth / contentRootLayout.columns - cellWidthAdjust

signal requestViewImages(int index)

states: [
State {
when: layoutType === 0
PropertyChanges { target: imagePreviewLayout; columns: 4 }
PropertyChanges { target: contentRootLayout; columns: 4 }
PropertyChanges { target: imagePreviewLayout; cellWidthAdjust: 5 }
},
State {
when: layoutType === 1 || layoutType === 2
PropertyChanges { target: imagePreviewLayout; columns: 2 }
PropertyChanges { target: contentRootLayout; columns: 2 }
PropertyChanges { target: imagePreviewLayout; cellWidthAdjust: 3 }
},
State {
when: layoutType === 3
PropertyChanges { target: imagePreviewLayout; columns: 1 }
PropertyChanges { target: contentRootLayout; columns: 1 }
PropertyChanges { target: imagePreviewLayout; cellWidthAdjust: 0 }
}
]

Repeater {
id: repeater
model: imagePreviewLayout.embedImages
delegate: ImageWithIndicator {
id: image
property bool isWide: false
property bool isTall: false
Layout.preferredWidth: isWide ? imagePreviewLayout.layoutWidth : imagePreviewLayout.cellWidth
Layout.preferredHeight: isTall ? (imagePreviewLayout.layoutWidth * sourceSize.height / sourceSize.width) : imagePreviewLayout.cellWidth
Layout.columnSpan: isWide ? 2 : 1
fillMode: Image.PreserveAspectCrop
source: modelData
states: [
State {
when: imagePreviewLayout.layoutType === 0
PropertyChanges { target: image; isWide: false }
PropertyChanges { target: image; isTall: false }
},
State {
when: imagePreviewLayout.layoutType === 1
PropertyChanges { target: image; isWide: (repeater.count % 2 === 1 && model.index === (repeater.count - 1)) }
PropertyChanges { target: image; isTall: false }
},
State {
when: imagePreviewLayout.layoutType === 2
PropertyChanges { target: image; isWide: (repeater.count % 2 === 1 && model.index === (repeater.count - 1)) }
PropertyChanges { target: image; isTall: (repeater.count === 1) }
},
State {
when: imagePreviewLayout.layoutType === 3
PropertyChanges { target: image; isWide: false }
PropertyChanges { target: image; isTall: true }
GridLayout {
id: contentRootLayout
columnSpacing: 6
rowSpacing: 6
columns: 2
Repeater {
id: repeater
model: imagePreviewLayout.embedImages
delegate: ImageWithIndicator {
id: image
property bool isWide: false
property bool isTall: false
Layout.preferredWidth: isWide ? imagePreviewLayout.layoutWidth : imagePreviewLayout.cellWidth
Layout.preferredHeight: isTall ? (imagePreviewLayout.layoutWidth * (
model.index < embedImageRatios.length ? parseFloat(embedImageRatios[model.index]) : (sourceSize.height / sourceSize.width)
)
) : imagePreviewLayout.cellWidth
Layout.columnSpan: isWide ? 2 : 1
fillMode: Image.PreserveAspectCrop
source: modelData
states: [
State {
when: imagePreviewLayout.layoutType === 0
PropertyChanges { target: image; isWide: false }
PropertyChanges { target: image; isTall: false }
},
State {
when: imagePreviewLayout.layoutType === 1
PropertyChanges { target: image; isWide: (repeater.count % 2 === 1 && model.index === (repeater.count - 1)) }
PropertyChanges { target: image; isTall: false }
},
State {
when: imagePreviewLayout.layoutType === 2
PropertyChanges { target: image; isWide: (repeater.count % 2 === 1 && model.index === (repeater.count - 1)) }
PropertyChanges { target: image; isTall: (repeater.count === 1) }
},
State {
when: imagePreviewLayout.layoutType === 3
PropertyChanges { target: image; isWide: false }
PropertyChanges { target: image; isTall: true }
}
]
TagLabel {
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: 3
visible: model.index < embedAlts.length ? embedAlts[model.index].length > 0 : false
source: ""
fontPointSize: AdjustedValues.f8
text: "Alt"
}
MouseArea {
anchors.fill: parent
onClicked: imagePreviewLayout.requestViewImages(model.index)
}
]
TagLabel {
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: 3
visible: model.index < embedAlts.length ? embedAlts[model.index].length > 0 : false
source: ""
fontPointSize: AdjustedValues.f8
text: "Alt"
}
MouseArea {
anchors.fill: parent
onClicked: imagePreviewLayout.requestViewImages(model.index)
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions app/qml/parts/PostDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ ClickableFrame {
Layout.preferredWidth: parent.width
Layout.topMargin: 5
visible: postFrame.hasQuote &&
quoteFilterFrame.showContent &&
contentMediaFilterFrame.showContent
quoteFilterFrame.showContent
basisWidth: bodyLayout.basisWidth
onOpenLink: (url) => postFrame.openLink(url)
onDisplayLink: (url) => postFrame.displayLink(url)
Expand Down
9 changes: 5 additions & 4 deletions app/qml/parts/SideBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ColumnLayout {
anchors.margins: 1
spacing: 0

property bool ready: false
property alias post: post
property alias search: search
property alias addColumn: addColumn
Expand All @@ -23,7 +24,7 @@ ColumnLayout {
width: parent.width
Layout.preferredWidth: parent.width
Layout.preferredHeight: AdjustedValues.b36
enabled: accountListModel.count > 0
enabled: parent.ready
display: AbstractButton.IconOnly
iconSource: "../images/edit.png"
// iconText: qsTr("New Post")
Expand All @@ -35,7 +36,7 @@ ColumnLayout {
width: parent.width
Layout.preferredWidth: parent.width
Layout.preferredHeight: AdjustedValues.b36
enabled: accountListModel.count > 0
enabled: parent.ready
display: AbstractButton.IconOnly
iconSource: "../images/search.png"
onWidthChanged: console.log("search:" + width)
Expand All @@ -51,7 +52,7 @@ ColumnLayout {
width: parent.width
Layout.preferredWidth: parent.width
Layout.preferredHeight: AdjustedValues.b36
enabled: accountListModel.count > 0
enabled: parent.ready
display: AbstractButton.IconOnly
iconSource: "../images/column.png"
// iconText: qsTr("Add column")
Expand All @@ -63,7 +64,7 @@ ColumnLayout {
Layout.preferredWidth: parent.width
Layout.preferredHeight: AdjustedValues.b36
visible: false
enabled: accountListModel.count > 0
enabled: parent.ready
display: AbstractButton.IconOnly
iconSource: "../images/hand.png"
}
Expand Down
2 changes: 1 addition & 1 deletion app/qml/parts/VideoFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ClickableFrame {
id: thumbImage
width: videoFrame.width
height: {
if(status !== Image.Null) {
if(thumbImage.source !== "") {
if(sourceSize.width > sourceSize.height){
return (width / sourceSize.width) * sourceSize.height
}else{
Expand Down
1 change: 1 addition & 0 deletions app/qml/view/NotificationListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ ScrollView {
postImagePreview.layoutType: notificationListView.imageLayoutType
postImagePreview.embedImages: model.embedImages
postImagePreview.embedAlts: model.embedImagesAlt
postImagePreview.embedImageRatios: model.embedImagesRatio
postImagePreview.onRequestViewImages: (index) => requestViewImages(index, model.embedImagesFull, model.embedImagesAlt)
blockedQuoteFrame.visible: model.quoteRecordBlocked
blockedQuoteFrameLabel.text: model.quoteRecordBlockedStatus
Expand Down
1 change: 1 addition & 0 deletions app/qml/view/PostThreadView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ ColumnLayout {
postImagePreview.layoutType: postThreadView.imageLayoutType
postImagePreview.embedImages: model.embedImages
postImagePreview.embedAlts: model.embedImagesAlt
postImagePreview.embedImageRatios: model.embedImagesRatio
postImagePreview.onRequestViewImages: (index) => requestViewImages(index, model.embedImagesFull, model.embedImagesAlt)

quoteFilterFrame.visible: model.quoteFilterMatched && !model.quoteRecordBlocked
Expand Down
1 change: 1 addition & 0 deletions app/qml/view/TimelineView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ ScrollView {
postImagePreview.layoutType: timelineView.imageLayoutType
postImagePreview.embedImages: model.embedImages
postImagePreview.embedAlts: model.embedImagesAlt
postImagePreview.embedImageRatios: model.embedImagesRatio
postImagePreview.onRequestViewImages: (index) => requestViewImages(index, model.embedImagesFull, model.embedImagesAlt)

quoteFilterFrame.visible: model.quoteFilterMatched && !model.quoteRecordBlocked
Expand Down
Loading

0 comments on commit f7a0d0b

Please sign in to comment.