Changeset View
Changeset View
Standalone View
Standalone View
src/apps/qml/qml/messages/UserMessage.qml
Show All 30 Lines | |||||
31 | 31 | | |||
32 | import "../common" | 32 | import "../common" | ||
33 | 33 | | |||
34 | MessageBase { | 34 | MessageBase { | ||
35 | id: root | 35 | id: root | ||
36 | 36 | | |||
37 | property alias attachments: attachmentsLayout.children | 37 | property alias attachments: attachmentsLayout.children | ||
38 | 38 | | |||
39 | implicitHeight: rowLayout.height | 39 | implicitHeight: mainLayout.height | ||
40 | 40 | | |||
41 | Loader { | 41 | Loader { | ||
42 | id: messageMenuLoader | 42 | id: messageMenuLoader | ||
43 | active: false | 43 | active: false | ||
44 | property var posX | 44 | property var posX | ||
45 | property var posY | 45 | property var posY | ||
46 | sourceComponent: MessageMenu { | 46 | sourceComponent: MessageMenu { | ||
47 | id: menu | 47 | id: menu | ||
48 | x: messageMenuLoader.posX | 48 | x: messageMenuLoader.posX | ||
49 | y: messageMenuLoader.posY | 49 | y: messageMenuLoader.posY | ||
50 | can_edit_message: i_can_edit_message | 50 | can_edit_message: i_can_edit_message | ||
51 | user_ignored : i_user_ignored | 51 | user_ignored : i_user_ignored | ||
52 | starred: i_starred | 52 | starred: i_starred | ||
53 | pinned_message: i_pinned | 53 | pinned_message: i_pinned | ||
54 | showTranslatedMessage: i_showTranslatedMessage | 54 | showTranslatedMessage: i_showTranslatedMessage | ||
55 | Component.onCompleted: { | 55 | Component.onCompleted: { | ||
56 | open() | 56 | open() | ||
57 | } | 57 | } | ||
58 | onAboutToHide: { | 58 | onAboutToHide: { | ||
59 | messageMenuLoader.active = false; | 59 | messageMenuLoader.active = false; | ||
60 | } | 60 | } | ||
61 | } | 61 | } | ||
62 | } | 62 | } | ||
63 | 63 | | |||
64 | RowLayout { | 64 | ColumnLayout { | ||
65 | id: rowLayout | 65 | id: mainLayout | ||
66 | | ||||
67 | width: parent.width | ||||
68 | | ||||
69 | spacing: 0 | ||||
70 | | ||||
71 | Item { | ||||
72 | id: topSpacer | ||||
66 | 73 | | |||
67 | width: parent.width | 74 | width: parent.width | ||
75 | height: Kirigami.Units.smallSpacing | ||||
76 | } | ||||
68 | 77 | | |||
78 | RowLayout { | ||||
69 | AvatarImage { | 79 | AvatarImage { | ||
70 | id: avatarRect | 80 | id: avatarRect | ||
71 | 81 | | |||
72 | Layout.alignment: Qt.AlignTop | 82 | Layout.alignment: Qt.AlignTop | ||
73 | avatarurl: i_avatar | 83 | avatarurl: i_avatar | ||
74 | aliasname: i_aliasname | 84 | aliasname: i_aliasname | ||
75 | username: i_username | 85 | username: i_username | ||
76 | onShowUserInfo: { | 86 | onShowUserInfo: { | ||
77 | messageMain.showUserInfo(i_own_username) | 87 | messageMain.showUserInfo(i_own_username) | ||
78 | } | 88 | } | ||
79 | visible: !i_groupable | 89 | visible: !i_groupable | ||
80 | } | 90 | } | ||
81 | ColumnLayout { | 91 | ColumnLayout { | ||
82 | spacing: Kirigami.Units.smallSpacing / 2 // reduce spacing a little | 92 | spacing: Kirigami.Units.smallSpacing / 2 // reduce spacing a little | ||
93 | Layout.alignment: Qt.AlignTop | ||||
94 | | ||||
83 | GridLayout { | 95 | GridLayout { | ||
84 | rowSpacing: 0 | 96 | rowSpacing: 0 | ||
85 | columnSpacing: Kirigami.Units.smallSpacing | 97 | columnSpacing: Kirigami.Units.smallSpacing | ||
86 | columns: compactViewMode ? -1 : 1 // user name label + roles info in one row | 98 | columns: compactViewMode ? -1 : 1 // user name label + roles info in one row | ||
87 | RowLayout { | 99 | RowLayout { | ||
88 | Layout.alignment: Qt.AlignLeft | Qt.AlignTop | 100 | Layout.alignment: Qt.AlignLeft | Qt.AlignTop | ||
89 | Layout.rightMargin: Kirigami.Units.smallSpacing | 101 | Layout.rightMargin: Kirigami.Units.smallSpacing | ||
90 | 102 | | |||
▲ Show 20 Lines • Show All 171 Lines • ▼ Show 20 Line(s) | 272 | ThreadLabel { | |||
262 | onOpenThread: { | 274 | onOpenThread: { | ||
263 | console.log(RuqolaDebugCategorySingleton.category, " OPen thread " + i_messageID) | 275 | console.log(RuqolaDebugCategorySingleton.category, " OPen thread " + i_messageID) | ||
264 | messageMain.openThread(i_messageID, i_messageText) | 276 | messageMain.openThread(i_messageID, i_messageText) | ||
265 | } | 277 | } | ||
266 | } | 278 | } | ||
267 | } | 279 | } | ||
268 | 280 | | |||
269 | ReactionsPopup { | 281 | ReactionsPopup { | ||
282 | Layout.alignment: Qt.AlignTop | ||||
270 | visible: i_useMenuMessage | 283 | visible: i_useMenuMessage | ||
271 | showIcon: root.hovered | 284 | showIcon: root.hovered | ||
272 | onInsertReaction: { | 285 | onInsertReaction: { | ||
273 | messageMain.addReaction(i_messageID, emoji) | 286 | messageMain.addReaction(i_messageID, emoji) | ||
274 | } | 287 | } | ||
275 | } | 288 | } | ||
276 | 289 | | |||
277 | TimestampText { | 290 | TimestampText { | ||
278 | id: timestampText | 291 | id: timestampText | ||
292 | | ||||
293 | Layout.alignment: Qt.AlignTop | ||||
279 | timestamp: i_timestamp | 294 | timestamp: i_timestamp | ||
280 | visible: !i_groupable | 295 | visible: !i_groupable | ||
281 | } | 296 | } | ||
282 | } | 297 | } | ||
298 | | ||||
299 | Item { | ||||
300 | id: bottomSpacer | ||||
301 | | ||||
302 | width: parent.width | ||||
303 | height: Kirigami.Units.smallSpacing | ||||
304 | } | ||||
305 | } | ||||
306 | | ||||
283 | } | 307 | } |