Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-3.16] gui/tray: Fix some tray view papercuts #7955

Merged
merged 5 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 7 additions & 69 deletions src/gui/UserStatusSelector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -145,33 +145,11 @@ ColumnLayout {

property color borderColor: showBorder ? Style.ncBlue : palette.dark

// We create the square with only the top-left and bottom-left rounded corners
// by overlaying different rectangles on top of each other
background: Rectangle {
radius: Style.slightlyRoundedButtonRadius
color: palette.button
border.color: fieldButton.borderColor
border.width: Style.normalBorderWidth

Rectangle {
anchors.fill: parent
anchors.leftMargin: parent.width / 2
anchors.rightMargin: -1
z: 1
color: palette.button
border.color: fieldButton.borderColor
border.width: Style.normalBorderWidth
}

Rectangle { // We need to cover the blue border of the non-radiused rectangle
anchors.fill: parent
anchors.leftMargin: parent.width / 4
anchors.rightMargin: parent.width / 4
anchors.topMargin: Style.normalBorderWidth
anchors.bottomMargin: Style.normalBorderWidth
z: 2
color: palette.button
}
}

contentItem: Label {
Expand Down Expand Up @@ -212,43 +190,11 @@ ColumnLayout {
TextField {
id: userStatusMessageTextField

property color borderColor: activeFocus ? Style.ncBlue : palette.dark

Layout.fillWidth: true
Layout.preferredHeight: contentHeight + (Style.smallSpacing * 2)

placeholderText: qsTr("What is your status?")
placeholderTextColor: palette.dark
text: userStatusSelectorModel.userStatusMessage
verticalAlignment: TextInput.AlignVCenter
selectByMouse: true
onEditingFinished: userStatusSelectorModel.userStatusMessage = text

background: Rectangle {
radius: Style.slightlyRoundedButtonRadius
color: palette.base
border.color: userStatusMessageTextField.borderColor
border.width: Style.normalBorderWidth

Rectangle {
anchors.fill: parent
anchors.rightMargin: parent.width / 2
z: 1
color: palette.base
border.color: userStatusMessageTextField.borderColor
border.width: Style.normalBorderWidth
}

Rectangle { // We need to cover the blue border of the non-radiused rectangle
anchors.fill: parent
anchors.leftMargin: parent.width / 4
anchors.rightMargin: parent.width / 4
anchors.topMargin: Style.normalBorderWidth
anchors.bottomMargin: Style.normalBorderWidth
z: 2
color: palette.base
}
}
}
}

Expand Down Expand Up @@ -321,28 +267,20 @@ ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom

UserStatusSelectorButton {
// Prevent being squashed by the other buttons with larger text
Layout.minimumWidth: implicitWidth
Layout.fillHeight: true
primary: true
Button {
text: qsTr("Cancel")
onClicked: finished()
}
UserStatusSelectorButton {
Item { // Spacing
Layout.fillWidth: true
Layout.fillHeight: true
primary: true
text: qsTr("Clear status message")
}
Button {
text: qsTr("Clear")
onClicked: userStatusSelectorModel.clearUserStatus()
}
UserStatusSelectorButton {
Layout.fillWidth: true
Layout.fillHeight: true
primary: true
colored: true
Button {
focusPolicy: Qt.StrongFocus
text: qsTr("Set status message")
text: qsTr("Apply")
onClicked: userStatusSelectorModel.setUserStatus()
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/gui/tray/TrayWindowHeader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,13 @@ Rectangle {
model: UserAppsModel
delegate: MenuItem {
id: appEntry
anchors.left: parent.left
anchors.right: parent.right
text: model.appName
// HACK: Without creating our own component (and killing native styling)
// HACK: we do not have a way to adjust the text and icon spacing.
text: " " + model.appName
font.pixelSize: Style.topLinePixelSize
icon.source: model.appIconUrl
icon.color: palette.windowText
onTriggered: UserAppsModel.openAppUrl(appUrl)
hoverEnabled: true
Accessible.role: Accessible.MenuItem
Accessible.name: qsTr("Open %1 in browser").arg(model.appName)
Accessible.onPressAction: appEntry.triggered()
Expand Down
Loading