Skip to content

Commit

Permalink
Merge pull request #7498 from nextcloud/bugfix/ui-polish
Browse files Browse the repository at this point in the history
Polish tray window interface
  • Loading branch information
mgallien authored Nov 21, 2024
2 parents a060174 + cf2d895 commit 258ba6d
Show file tree
Hide file tree
Showing 37 changed files with 642 additions and 1,001 deletions.
7 changes: 2 additions & 5 deletions resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
<file>src/gui/tray/UserLine.qml</file>
<file>src/gui/tray/HeaderButton.qml</file>
<file>src/gui/tray/SyncStatus.qml</file>
<file>src/gui/tray/ActivityActionButton.qml</file>
<file>src/gui/tray/ActivityItem.qml</file>
<file>src/gui/tray/AutoSizingMenu.qml</file>
<file>src/gui/tray/ActivityList.qml</file>
<file>src/gui/tray/CurrentAccountHeaderButton.qml</file>
<file>src/gui/tray/TrayWindowHeader.qml</file>
<file>src/gui/tray/UnifiedSearchInputContainer.qml</file>
<file>src/gui/tray/UnifiedSearchResultFetchMoreTrigger.qml</file>
<file>src/gui/tray/UnifiedSearchResultItem.qml</file>
Expand All @@ -38,10 +39,6 @@
<file>src/gui/tray/UnifiedSearchResultListItem.qml</file>
<file>src/gui/tray/UnifiedSearchResultNothingFound.qml</file>
<file>src/gui/tray/UnifiedSearchResultSectionItem.qml</file>
<file>src/gui/tray/CustomButton.qml</file>
<file>src/gui/tray/NCButtonContents.qml</file>
<file>src/gui/tray/NCButtonBackground.qml</file>
<file>src/gui/tray/TextButtonContents.qml</file>
<file>src/gui/tray/ActivityItemContextMenu.qml</file>
<file>src/gui/tray/ActivityItemActions.qml</file>
<file>src/gui/tray/ActivityItemContent.qml</file>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/ResolveConflictsDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ ApplicationWindow {
}

Rectangle {
color: Style.backgroundColor
color: palette.base
anchors.fill: parent
z: 1
}
Expand Down
25 changes: 16 additions & 9 deletions src/gui/UserStatusSelector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,18 @@ ColumnLayout {
Layout.fillWidth: true
spacing: 0

UserStatusSelectorButton {
AbstractButton {
id: fieldButton

readonly property bool showBorder: hovered || checked || emojiDialog.visible

Layout.preferredWidth: userStatusMessageTextField.height
Layout.preferredHeight: userStatusMessageTextField.height

text: userStatusSelectorModel.userStatusEmoji

onClicked: emojiDialog.open()
onHeightChanged: topButtonsLayout.maxButtonHeight = Math.max(topButtonsLayout.maxButtonHeight, height)

primary: true
padding: 0
z: hovered ? 2 : 0 // Make sure highlight is seen on top of text field
z: showBorder ? 2 : 0 // Make sure highlight is seen on top of text field
hoverEnabled: true

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

Expand Down Expand Up @@ -175,6 +173,15 @@ ColumnLayout {
color: palette.button
}
}

contentItem: Label {
text: fieldButton.text
textFormat: Text.PlainText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}

onClicked: emojiDialog.open()
}

Popup {
Expand All @@ -186,7 +193,7 @@ ColumnLayout {
anchors.centerIn: Overlay.overlay

background: Rectangle {
color: palette.window
color: palette.base
border.width: Style.normalBorderWidth
border.color: palette.dark
radius: Style.slightlyRoundedButtonRadius
Expand All @@ -211,7 +218,7 @@ ColumnLayout {
Layout.preferredHeight: contentHeight + (Style.smallSpacing * 2)

placeholderText: qsTr("What is your status?")
placeholderTextColor: palette.midlight
placeholderTextColor: palette.dark
text: userStatusSelectorModel.userStatusMessage
verticalAlignment: TextInput.AlignVCenter
selectByMouse: true
Expand Down
2 changes: 1 addition & 1 deletion src/gui/UserStatusSelectorPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Page {
padding: Style.standardSpacing * 2

background: Rectangle {
color: palette.window
color: palette.base
radius: Style.trayWindowRadius
}

Expand Down
7 changes: 2 additions & 5 deletions src/gui/filedetails/FileDetailsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Page {
bottomPadding: intendedPadding

background: Rectangle {
color: palette.window
color: palette.base
visible: root.backgroundsVisible
}

Expand Down Expand Up @@ -130,7 +130,7 @@ Page {
wrapMode: Text.Wrap
}

CustomButton {
Button {
id: closeButton

Layout.rowSpan: headerGridLayout.rows
Expand All @@ -142,10 +142,7 @@ Page {
icon.source: "image://svgimage-custom-color/clear.svg" + "/" + palette.buttonText
icon.width: Style.activityListButtonIconSize
icon.height: Style.activityListButtonIconSize
toolTipText: qsTr("Dismiss")

visible: root.showCloseButton

onClicked: root.closeButtonClicked()
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/filedetails/FileDetailsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ StackView {
property bool backgroundsVisible: true

background: Rectangle {
color: palette.window
color: palette.base
visible: root.backgroundsVisible
}

Expand Down
3 changes: 1 addition & 2 deletions src/gui/filedetails/NCInputTextEdit.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ TextEdit {
readonly property alias submitButton: submitButton

clip: true
color: Style.ncTextColor
textMargin: Style.smallSpacing
wrapMode: TextEdit.Wrap
selectByMouse: true
Expand All @@ -39,7 +38,7 @@ TextEdit {
radius: Style.trayWindowRadius
border.width: Style.normalBorderWidth
border.color: root.activeFocus ? root.accentColor : root.secondaryColor
color: palette.window
color: palette.base
z: -1
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/filedetails/NCTabButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ TabButton {
padding: Style.smallSpacing
background: Rectangle {
radius: Style.slightlyRoundedButtonRadius
color: tabButton.pressed ? palette.highlight : palette.window
color: tabButton.pressed ? palette.highlight : "transparent"
}

contentItem: ColumnLayout {
Expand Down
42 changes: 13 additions & 29 deletions src/gui/filedetails/ShareDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -152,26 +152,25 @@ GridLayout {

spacing: 0

CustomButton {
Button {
id: createLinkButton

Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Style.iconButtonWidth
Layout.preferredHeight: width

toolTipText: qsTr("Create a new share link")
Layout.preferredWidth: Style.activityListButtonWidth
Layout.preferredHeight: Style.activityListButtonHeight

icon.source: "image://svgimage-custom-color/add.svg/" + palette.buttonText
icon.width: Style.smallIconSize
icon.height: Style.smallIconSize
icon.width: Style.activityListButtonIconSize
icon.height: Style.activityListButtonIconSize
display: AbstractButton.IconOnly

visible: (root.isPlaceholderLinkShare || root.isSecureFileDropPlaceholderLinkShare) && root.canCreateLinkShares
enabled: visible

onClicked: root.createNewLinkShare()
}

CustomButton {
Button {
id: copyLinkButton

function copyShareLink() {
Expand All @@ -190,29 +189,17 @@ GridLayout {
Layout.preferredWidth: shareLinkCopied ? implicitWidth : Style.activityListButtonWidth
Layout.preferredHeight: Style.activityListButtonHeight

toolTipText: qsTr("Copy share link location")

text: shareLinkCopied ? qsTr("Copied!") : ""

icon.source: shareLinkCopied ? "image://svgimage-custom-color/copy.svg/" + palette.brightText :
"image://svgimage-custom-color/copy.svg/" + palette.buttonText
icon.width: Style.smallIconSize
icon.height: Style.smallIconSize

icon.width: Style.activityListButtonIconSize
icon.height: Style.activityListButtonIconSize
display: AbstractButton.IconOnly
visible: root.isLinkShare || root.isInternalLinkShare
enabled: visible

onClicked: copyShareLink()

// TODO
// Behavior on bgColor {
// ColorAnimation { duration: Style.shortAnimationDuration }
// }

// Behavior on bgNormalOpacity {
// NumberAnimation { duration: Style.shortAnimationDuration }
// }

Behavior on Layout.preferredWidth {
SmoothedAnimation { duration: Style.shortAnimationDuration }
}
Expand All @@ -229,22 +216,19 @@ GridLayout {
}
}

CustomButton {
Button {
id: moreButton

toolTipText: qsTr("Share options")

Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredWidth: Style.activityListButtonWidth
Layout.preferredHeight: Style.activityListButtonHeight
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter

icon.source: "image://svgimage-custom-color/more.svg/" + palette.buttonText
icon.width: Style.activityListButtonIconSize
icon.height: Style.activityListButtonIconSize

display: AbstractButton.IconOnly
visible: !root.isPlaceholderLinkShare && !root.isSecureFileDropPlaceholderLinkShare && !root.isInternalLinkShare
enabled: visible

onClicked: root.rootStackView.push(shareDetailsPageComponent, {}, StackView.PushTransition)

Component {
Expand Down
Loading

0 comments on commit 258ba6d

Please sign in to comment.