Skip to content

Commit

Permalink
Clean up code, move values to Style.qml.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila <hello@camila.codes>
  • Loading branch information
Camila committed May 24, 2022
1 parent be17152 commit aff3b43
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/gui/tray/ActivityItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ MouseArea {
active: root.isChatActivity && root.isTalkReplyPossible && root.activityData.messageSent === ""
visible: root.isTalkReplyOptionVisible

Layout.preferredWidth: Style.talkReplyTextFieldPreferredWidth
Layout.preferredHeight: Style.talkReplyTextFieldPreferredHeight
Layout.leftMargin: Style.trayListItemIconSize + activityContent.spacing
Layout.preferredHeight: root.isTalkReplyOptionVisible ? implicitHeight : 0

sourceComponent: TalkReplyTextField {
onSendReply: {
Expand Down
12 changes: 4 additions & 8 deletions src/gui/tray/TalkReplyTextField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ Item {
root.sendReply(replyMessageTextField.text);
}

height: 30
width: 250

TextField {
id: replyMessageTextField

anchors.fill: parent
topPadding: 4
rightPadding: sendReplyMessageButton.width

visible: model.messageSent === ""

color: Style.ncSecondaryTextColor
Expand All @@ -43,7 +39,7 @@ Item {

Button {
id: sendReplyMessageButton
width: 32
width: Style.talkReplyTextFieldPreferredWidth * 0.12
height: parent.height
opacity: 0.8
flat: true
Expand All @@ -52,8 +48,8 @@ Item {

icon {
source: "image://svgimage-custom-color/send.svg" + "/" + Style.menuBorder
width: 38
height: 38
width: Style.talkReplyTextFieldPreferredWidth * 0.12
height: Style.talkReplyTextFieldPreferredHeight
color: hovered || !sendReplyMessageButton.enabled? Style.menuBorder : UserModel.currentUser.accentColor
}

Expand Down
3 changes: 3 additions & 0 deletions theme/Style/Style.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ QtObject {

property int activityLabelBaseWidth: 240

property int talkReplyTextFieldPreferredHeight: 34
property int talkReplyTextFieldPreferredWidth: 250

property int activityItemActionPrimaryButtonMinWidth: 100
property int activityItemActionSecondaryButtonMinWidth: 80

Expand Down

0 comments on commit aff3b43

Please sign in to comment.