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
10 changes: 10 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets Svg Qml Quick Qui
find_package(KF6Archive REQUIRED)
find_package(KF6GuiAddons)

#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")

if(CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-DQT_QML_DEBUG)
endif()
Expand All @@ -23,6 +26,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 @@ -260,6 +266,10 @@ set(client_SRCS
wizard/wizardproxysettingsdialog.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
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
3 changes: 3 additions & 0 deletions src/gui/nmcgui/qmldir.txt
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
5 changes: 5 additions & 0 deletions src/gui/tray/ActivityItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ ItemDelegate {
property bool isTalkReplyOptionVisible: model.messageSent !== ""

padding: Style.standardSpacing
focusPolicy: Qt.NoFocus
background: Rectangle {
color: "transparent"
border.width: 0
}

Accessible.role: Accessible.ListItem
Accessible.name: (model.path !== "" && model.displayPath !== "") ? qsTr("Open %1 locally").arg(model.displayPath) : model.message
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
}
}
}
6 changes: 3 additions & 3 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,7 +184,7 @@ RowLayout {
}

display: Button.IconOnly
visible: model.showFileDetails
visible: false
onClicked: Systray.presentShareViewInTray(model.openablePath)
}

Expand Down
5 changes: 3 additions & 2 deletions src/gui/tray/ActivityList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ ScrollView {
width: activityList.contentItem.width

isFileActivityList: controlRoot.isFileActivityList
iconSize: controlRoot.iconSize
iconSize: Style.nmcListViewIconSize
leftPadding: Style.nmcListViewLeftPadding
flickable: activityList
onHoveredChanged: if (hovered) {
// When we set the currentIndex the list view will scroll...
Expand Down Expand Up @@ -150,7 +151,7 @@ ScrollView {

Column {
id: placeholderColumn
width: parent.width * 0.8
width: parent.width * 0.75
anchors.centerIn: parent
visible: activityList.count === 0
spacing: Style.standardSpacing
Expand Down
Loading