Skip to content

Commit

Permalink
Fix padding and sizing of call notification window
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
  • Loading branch information
claucambra committed Apr 21, 2022
1 parent cdad959 commit 45da741
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
29 changes: 18 additions & 11 deletions src/gui/tray/CallNotificationDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ Window {
color: "transparent"
flags: Qt.Dialog | Qt.FramelessWindowHint

readonly property int windowMargins: 50
readonly property int windowSpacing: 10
readonly property int windowWidth: 240
readonly property int windowHeight: 160

readonly property string svgImage: "image://svgimage-custom-color/%1.svg" + "/"
readonly property string talkIcon: svgImage.arg("wizard-talk")
Expand All @@ -34,7 +33,7 @@ Window {
}

width: root.windowWidth
height: root.windowHeight
height: rootBackground.height

Component.onCompleted: {
Systray.forceWindowInit(root);
Expand All @@ -55,7 +54,8 @@ Window {

Rectangle {
id: rootBackground
anchors.fill: parent
width: parent.width
height: contentLayout.height + (root.windowSpacing * 2)
radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius
color: Style.backgroundColor
border.width: Style.trayWindowBorderWidth
Expand Down Expand Up @@ -116,8 +116,12 @@ Window {
}

ColumnLayout {
anchors.centerIn: parent
spacing: 10
id: contentLayout
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: root.windowSpacing
spacing: root.windowSpacing

Item {
width: Style.accountAvatarSize
Expand Down Expand Up @@ -162,12 +166,15 @@ Window {
text: root.subject
color: root.usingUserAvatar ? "white" : Style.ncTextColor
font.pixelSize: Style.topLinePixelSize
elide: Text.ElideRight
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.fillWidth: true
}

Row {
spacing: 5
RowLayout {
spacing: root.windowSpacing / 2
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter

Repeater {
Expand All @@ -190,7 +197,7 @@ Window {
imageSource: root.talkIcon + Style.ncHeaderTextColor
imageSourceHover: root.talkIcon + Style.ncHeaderTextColor

Layout.preferredWidth: Style.callNotificationPrimaryButtonMinWidth
Layout.fillWidth: true
Layout.preferredHeight: Style.callNotificationPrimaryButtonMinHeight

onClicked: {
Expand All @@ -217,7 +224,7 @@ Window {
imageSource: root.deleteIcon + "white"
imageSourceHover: root.deleteIcon + "white"

Layout.preferredWidth: Style.callNotificationPrimaryButtonMinWidth
Layout.fillWidth: true
Layout.preferredHeight: Style.callNotificationPrimaryButtonMinHeight

onClicked: root.closeNotification()
Expand Down
2 changes: 1 addition & 1 deletion theme/Style/Style.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ QtObject {
property int activityItemActionSecondaryButtonMinWidth: 80

property int callNotificationPrimaryButtonMinWidth: 100
property int callNotificationPrimaryButtonMinHeight: 50
property int callNotificationPrimaryButtonMinHeight: 40

property int roundButtonBackgroundVerticalMargins: 10
property int roundedButtonBackgroundVerticalMargins: 5
Expand Down

0 comments on commit 45da741

Please sign in to comment.