fix text color and button, copy roomID on click

This commit is contained in:
Malte E 2022-03-03 21:51:26 +01:00
parent 02da8e445a
commit cf7353c1e9

View file

@ -113,11 +113,13 @@ ApplicationWindow {
font.pixelSize: fontMetrics.font.pixelSize * 2 font.pixelSize: fontMetrics.font.pixelSize * 2
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: TextEdit.AlignHCenter horizontalAlignment: TextEdit.AlignHCenter
color: Nheko.colors.text
} }
Label { Label {
text: qsTr("%n member(s)", "", roomSettings.memberCount) text: qsTr("%n member(s)", "", roomSettings.memberCount)
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
color: Nheko.colors.text
TapHandler { TapHandler {
onSingleTapped: TimelineManager.openRoomMembers(Rooms.getRoomById(roomSettings.roomId)) onSingleTapped: TimelineManager.openRoomMembers(Rooms.getRoomById(roomSettings.roomId))
@ -142,7 +144,7 @@ ApplicationWindow {
property bool cut: implicitHeight > 100 property bool cut: implicitHeight > 100
property bool showMore property bool showMore
clip: true clip: true
height: cut && !showMore? 100 : implicitHeight height: cut && !showMore? 100 : undefined
Layout.preferredHeight: height Layout.preferredHeight: height
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true Layout.fillWidth: true
@ -183,6 +185,7 @@ ApplicationWindow {
Label { Label {
text: qsTr("SETTINGS") text: qsTr("SETTINGS")
font.bold: true font.bold: true
color: Nheko.colors.text
} }
Item { Item {
@ -192,6 +195,7 @@ ApplicationWindow {
Label { Label {
text: qsTr("Notifications") text: qsTr("Notifications")
Layout.fillWidth: true Layout.fillWidth: true
color: Nheko.colors.text
} }
ComboBox { ComboBox {
@ -207,6 +211,7 @@ ApplicationWindow {
Label { Label {
text: qsTr("Room access") text: qsTr("Room access")
Layout.fillWidth: true Layout.fillWidth: true
color: Nheko.colors.text
} }
ComboBox { ComboBox {
@ -231,6 +236,7 @@ ApplicationWindow {
Label { Label {
text: qsTr("Encryption") text: qsTr("Encryption")
color: Nheko.colors.text
} }
ToggleButton { ToggleButton {
@ -268,6 +274,7 @@ ApplicationWindow {
Label { Label {
text: qsTr("Sticker & Emote Settings") text: qsTr("Sticker & Emote Settings")
color: Nheko.colors.text
} }
Button { Button {
@ -279,6 +286,7 @@ ApplicationWindow {
Label { Label {
text: qsTr("Hidden events") text: qsTr("Hidden events")
color: Nheko.colors.text
} }
HiddenEventsDialog { HiddenEventsDialog {
@ -307,6 +315,7 @@ ApplicationWindow {
Label { Label {
text: qsTr("INFO") text: qsTr("INFO")
font.bold: true font.bold: true
color: Nheko.colors.text
} }
Item { Item {
@ -315,24 +324,48 @@ ApplicationWindow {
Label { Label {
text: qsTr("Internal ID") text: qsTr("Internal ID")
color: Nheko.colors.text
} }
Label { AbstractButton { // AbstractButton does not allow setting text color
text: roomSettings.roomId
font.pixelSize: Math.floor(fontMetrics.font.pixelSize * 0.8)
wrapMode: Text.WrapAnywhere
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: idLabel.height
Label { // TextEdit does not trigger onClicked
id: idLabel
text: roomSettings.roomId
font.pixelSize: Math.floor(fontMetrics.font.pixelSize * 0.8)
color: Nheko.colors.text
width: parent.width
wrapMode: Text.WrapAnywhere
ToolTip.text: qsTr("Copied to clipboard")
ToolTip.visible: toolTipTimer.running
}
TextEdit{ // label does not allow selection
id: textEdit
visible: false
text: roomSettings.roomId
}
onClicked: {
textEdit.selectAll()
textEdit.copy()
toolTipTimer.start()
}
Timer {
id: toolTipTimer
}
} }
Label { Label {
text: qsTr("Room Version") text: qsTr("Room Version")
color: Nheko.colors.text
} }
Label { Label {
text: roomSettings.roomVersion text: roomSettings.roomVersion
font.pixelSize: fontMetrics.font.pixelSize font.pixelSize: fontMetrics.font.pixelSize
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
color: Nheko.colors.text
} }
} }
@ -341,7 +374,7 @@ ApplicationWindow {
Button { Button {
id: showMoreButton id: showMoreButton
x: contentLayout1.showMorePos.x x: contentLayout1.showMorePos.x
y: Math.min(contentLayout1.showMorePos.y-flickable.contentY,parent.height-height) y: Math.min(contentLayout1.showMorePos.y-flickable.contentY,flickable.height-height)
visible: roomTopic.cut visible: roomTopic.cut
text: roomTopic.showMore? "show less" : "show more" text: roomTopic.showMore? "show less" : "show more"
onClicked: {roomTopic.showMore = !roomTopic.showMore onClicked: {roomTopic.showMore = !roomTopic.showMore