Skip to content
Open
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
3 changes: 3 additions & 0 deletions resources.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<RCC>
<qresource prefix="/qml">
<file alias="NMCGui/qmldir">src/gui/nmcgui/qmldir</file>
<file alias="NMCGui/NMCHeaderButton.qml">src/gui/nmcgui/NMCHeaderButton.qml</file>
<file alias="NMCGui/NMCMenuItem.qml">src/gui/nmcgui/NMCMenuItem.qml</file>
<file>src/gui/UserStatusMessageView.qml</file>
<file>src/gui/UserStatusSelectorPage.qml</file>
<file>src/gui/EmojiPicker.qml</file>
Expand Down
7 changes: 7 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ endif()
configure_file(${CMAKE_SOURCE_DIR}/theme.qrc.in ${CMAKE_SOURCE_DIR}/theme.qrc)
set(theme_dir ${CMAKE_SOURCE_DIR}/theme)

#NMC customization: needed to find the ui file in a different location than the header file
set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui")

set(client_UI_SRCS
accountsettings.ui
conflictdialog.ui
Expand Down Expand Up @@ -259,6 +262,10 @@ set(client_SRCS
integration/fileactionsmodel.cpp
)

file(GLOB NMC_FILES "nmcgui/*")
set(NMC_SRCS ${NMC_FILES})
list(APPEND client_SRCS ${NMC_SRCS})

if (NOT DISABLE_ACCOUNT_MIGRATION)
list(APPEND client_SRCS
legacyaccountselectiondialog.h
Expand Down
17 changes: 3 additions & 14 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,8 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
const auto fpSettingsWidget = fpSettingsController->settingsViewWidget(fpAccountUserIdAtHost, fileProviderPanelContents,
QQuickWidget::SizeRootObjectToView);
fpSettingsLayout->setContentsMargins(0, 0, 0, 0);
fpSettingsLayout->setSpacing(0);

fpSettingsWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
if (const auto fpSettingsWidgetLayout = fpSettingsWidget->layout()) {
fpSettingsWidgetLayout->setContentsMargins(0, 0, 0, 0);
}
fpSettingsLayout->addWidget(fpSettingsWidget, 1);
fileProviderPanelContents->setLayout(fpSettingsLayout);
fpSettingsLayout->addWidget(fpSettingsWidget);
} else {
// macOS 13 Ventura: the file provider feature is unsupported there.
// This branch can be removed once Ventura is no longer supported.
_ui->fileProviderPanel->setVisible(false);
}
#else
Expand All @@ -240,10 +231,8 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
networkSettingsLayout->setContentsMargins(0, 0, 0, 0);
}
connectionSettingsLayout->setContentsMargins(0, 0, 0, 0);
connectionSettingsLayout->setSpacing(0);
connectionSettingsLayout->addWidget(networkSettings, 1);
connectionSettingsPanelContents->setLayout(connectionSettingsLayout);

connectionSettingsLayout->addWidget(networkSettings);

const auto mouseCursorChanger = new MouseCursorChanger(this);
mouseCursorChanger->folderList = _ui->_folderList;
mouseCursorChanger->model = _model;
Expand Down
65 changes: 65 additions & 0 deletions src/gui/nmcgui/NMCHeaderButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

import Style
import com.nextcloud.desktopclient

Item {
id: rec

width: 92
height: Style.nmcTrayWindowHeaderHeight

signal clickedButton

property string iconText: ""
property string iconSource: ""
property bool iconHovered: false

ColumnLayout {
spacing: 0
anchors.centerIn: parent

Button {
id: button
flat: true
focusPolicy: Qt.NoFocus
Layout.alignment: Qt.AlignHCenter

contentItem: Image {
source: rec.iconSource
width: Style.nmcTrayWindowIconWidth
height: Style.nmcTrayWindowIconWidth
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
}

background: Rectangle {
color: rec.iconHovered || button.visualFocus ? "black" : "transparent"
opacity: 0.05
radius: 4
}

MouseArea {
id: buttonArea
anchors.fill: parent
onClicked: rec.clickedButton() // Trigger the button click signal
}

// Optional: Handle hover on icon to change its state
onClicked: rec.clickedButton()
}

Text {
width: rec.width
text: rec.iconText
elide: Text.ElideRight
color: Style.nmcTrayWindowHeaderTextColor
font.pixelSize: Style.nmcFontSizeIconText
horizontalAlignment: Text.AlignHCenter
leftPadding: 8
rightPadding: 8
}
}
}
37 changes: 37 additions & 0 deletions src/gui/nmcgui/NMCMenuItem.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

import Style

MenuItem {
id: root

contentItem: RowLayout {
spacing: 8
anchors.fill: parent
anchors.leftMargin: 12

Image {
source: root.icon.source
visible: root.icon.source !== ""
width: Style.nmcTrayWindowIconWidth
height: Style.nmcTrayWindowIconWidth
fillMode: Image.PreserveAspectFit
}

Text {
text: root.text
color: hovered ? Style.nmcTrayWindowHeaderTextColor : Style.nmcTrayWindowHeaderTextColor
font.pixelSize: Style.topLinePixelSize
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
elide: Text.ElideRight
Layout.fillWidth: true
}
}

background: Rectangle {
color: root.hovered ? Style.nmcTrayWindowHeaderHighlightColor : "transparent"
}
}
3 changes: 3 additions & 0 deletions src/gui/nmcgui/qmldir
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module NMCGui
NMCHeaderButton 1.0 NMCHeaderButton.qml
NMCMenuItem 1.0 NMCMenuItem.qml
16 changes: 12 additions & 4 deletions src/gui/tray/ActivityItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import QtQml
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

import Style
import com.nextcloud.desktopclient

Expand All @@ -24,25 +25,31 @@ ItemDelegate {
property bool isTalkReplyOptionVisible: model.messageSent !== ""

padding: Style.standardSpacing
hoverEnabled: true

Accessible.role: Accessible.ListItem
Accessible.name: (model.path !== "" && model.displayPath !== "") ? qsTr("Open %1 locally").arg(model.displayPath) : model.message
Accessible.onPressAction: root.clicked()

background: Rectangle {
color: root.hovered || root.activeFocus ? palette.highlight : "transparent"
radius: Style.mediumRoundedButtonRadius
border.width: 0
}

ToolTip {
popupType: Qt.platform.os === "windows" ? Popup.Item : Popup.Native
visible: root.hovered && !activityContent.childHovered && model.displayLocation !== ""
text: qsTr("In %1").arg(model.displayLocation)
}

// TODO: the current style does not support customization of this control
contentItem: ColumnLayout {
spacing: Style.smallSpacing

ActivityItemContent {
id: activityContent

adaptiveTextColor: root.activeFocus ? palette.highlightedText : palette.text
adaptiveTextColor: root.hovered || root.activeFocus ? palette.highlightedText : palette.text

Layout.fillWidth: true
Layout.minimumHeight: Style.minActivityHeight
Expand All @@ -60,6 +67,7 @@ ItemDelegate {

Loader {
id: talkReplyTextFieldLoader

active: root.isChatActivity && root.isTalkReplyPossible && model.messageSent === ""
visible: root.isTalkReplyOptionVisible

Expand All @@ -69,8 +77,8 @@ ItemDelegate {

sourceComponent: TalkReplyTextField {
onSendReply: {
UserModel.currentUser.sendReplyMessage(model.activityIndex, model.conversationToken, reply, model.messageId);
talkReplyTextFieldLoader.visible = false;
UserModel.currentUser.sendReplyMessage(model.activityIndex, model.conversationToken, reply, model.messageId)
talkReplyTextFieldLoader.visible = false
}
}
}
Expand Down
20 changes: 20 additions & 0 deletions src/gui/tray/ActivityItemActions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,25 @@ Repeater {
onClicked: isTalkReplyButton ? root.showReplyField() : root.triggerAction(model.index)

visible: verb !== "REPLY" || (verb === "REPLY" && root.talkReplyButtonVisible)

HoverHandler {
id: mouse
acceptedDevices: PointerDevice.AllPointerTypes
}

background: Rectangle {
color: mouse.hovered ? Style.nmcConflictHoverColor : Style.nmcConflictColor
radius: Style.nmcStandardRadius
height: Style.nmcTraySyncButtonHeight
}

contentItem: Text {
text: activityActionButton.text
color: mouse.hovered ? Style.nmcTextInButtonColor : Style.nmcTextInButtonColor
font.pixelSize: Style.fontSizeSmall
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
}
}
30 changes: 4 additions & 26 deletions src/gui/tray/ActivityItemContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ RowLayout {
Item {
id: thumbnailItem

readonly property int imageWidth: width * (1 - Style.thumbnailImageSizeReduction)
readonly property int imageHeight: height * (1 - Style.thumbnailImageSizeReduction)
readonly property int imageWidth: width
readonly property int imageHeight: height
readonly property int thumbnailRadius: model.thumbnail && model.thumbnail.isUserAvatar ? width / 2 : 3

implicitWidth: root.iconSize
Expand Down Expand Up @@ -184,30 +184,8 @@ RowLayout {
}

display: Button.IconOnly
visible: model.showFileDetails
onClicked: fileMoreButtonMenu.visible ? fileMoreButtonMenu.close() : fileMoreButtonMenu.popup()

AutoSizingMenu {
id: fileMoreButtonMenu
closePolicy: Menu.CloseOnPressOutsideParent | Menu.CloseOnEscape

MenuItem {
height: visible ? implicitHeight : 0
text: qsTr("File details")
font.pixelSize: Style.topLinePixelSize
hoverEnabled: true
onClicked: Systray.presentShareViewInTray(model.openablePath)
}

MenuItem {
visible: model.serverHasIntegration
height: visible ? implicitHeight : 0
text: qsTr("File actions")
font.pixelSize: Style.topLinePixelSize
hoverEnabled: true
onClicked: Systray.presentFileActionsViewInSystray(model.openablePath)
}
}
visible: false
onClicked: Systray.presentShareViewInTray(model.openablePath)
}

Button {
Expand Down
Loading