Skip to content

Commit f6b7e7a

Browse files
committed
Merge #413 [stable-4.0] [master] 2055-Custom_Main_Window
2 parents 2258b78 + 8f0d4d4 commit f6b7e7a

29 files changed

+745
-423
lines changed

resources.qrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<RCC>
22
<qresource prefix="/qml">
3+
<file alias="NMCGui/qmldir">src/gui/nmcgui/qmldir</file>
4+
<file alias="NMCGui/NMCHeaderButton.qml">src/gui/nmcgui/NMCHeaderButton.qml</file>
5+
<file alias="NMCGui/NMCMenuItem.qml">src/gui/nmcgui/NMCMenuItem.qml</file>
36
<file>src/gui/UserStatusMessageView.qml</file>
47
<file>src/gui/UserStatusSelectorPage.qml</file>
58
<file>src/gui/EmojiPicker.qml</file>

src/gui/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ endif()
2323
configure_file(${CMAKE_SOURCE_DIR}/theme.qrc.in ${CMAKE_SOURCE_DIR}/theme.qrc)
2424
set(theme_dir ${CMAKE_SOURCE_DIR}/theme)
2525

26+
#NMC customization: needed to find the ui file in a different location than the header file
27+
set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui")
28+
2629
set(client_UI_SRCS
2730
accountsettings.ui
2831
conflictdialog.ui
@@ -260,6 +263,10 @@ set(client_SRCS
260263
wizard/wizardproxysettingsdialog.cpp
261264
)
262265

266+
file(GLOB NMC_FILES "nmcgui/*")
267+
set(NMC_SRCS ${NMC_FILES})
268+
list(APPEND client_SRCS ${NMC_SRCS})
269+
263270
if (NOT DISABLE_ACCOUNT_MIGRATION)
264271
list(APPEND client_SRCS
265272
legacyaccountselectiondialog.h

src/gui/nmcgui/NMCHeaderButton.qml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import QtQuick
2+
import QtQuick.Controls
3+
import QtQuick.Layouts
4+
5+
import Style
6+
import com.nextcloud.desktopclient
7+
8+
Item {
9+
id: rec
10+
11+
width: 92
12+
height: Style.nmcTrayWindowHeaderHeight
13+
14+
signal clickedButton
15+
16+
property string iconText: ""
17+
property string iconSource: ""
18+
property bool iconHovered: false
19+
20+
ColumnLayout {
21+
spacing: 0
22+
anchors.centerIn: parent
23+
24+
Button {
25+
id: button
26+
flat: true
27+
focusPolicy: Qt.NoFocus
28+
Layout.alignment: Qt.AlignHCenter
29+
30+
contentItem: Image {
31+
source: rec.iconSource
32+
width: Style.nmcTrayWindowIconWidth
33+
height: Style.nmcTrayWindowIconWidth
34+
fillMode: Image.PreserveAspectFit
35+
anchors.centerIn: parent
36+
}
37+
38+
background: Rectangle {
39+
color: rec.iconHovered || button.visualFocus ? "black" : "transparent"
40+
opacity: 0.05
41+
radius: 4
42+
}
43+
44+
MouseArea {
45+
id: buttonArea
46+
anchors.fill: parent
47+
onClicked: rec.clickedButton() // Trigger the button click signal
48+
}
49+
50+
// Optional: Handle hover on icon to change its state
51+
onClicked: rec.clickedButton()
52+
}
53+
54+
Text {
55+
width: rec.width
56+
text: rec.iconText
57+
elide: Text.ElideRight
58+
color: Style.nmcTrayWindowHeaderTextColor
59+
font.pixelSize: Style.nmcFontSizeIconText
60+
horizontalAlignment: Text.AlignHCenter
61+
leftPadding: 8
62+
rightPadding: 8
63+
}
64+
}
65+
}

src/gui/nmcgui/NMCMenuItem.qml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import QtQuick
2+
import QtQuick.Controls
3+
import QtQuick.Layouts
4+
5+
import Style
6+
7+
MenuItem {
8+
id: root
9+
10+
contentItem: RowLayout {
11+
spacing: 8
12+
anchors.fill: parent
13+
anchors.leftMargin: 12
14+
15+
Image {
16+
source: root.icon.source
17+
visible: root.icon.source !== ""
18+
width: Style.nmcTrayWindowIconWidth
19+
height: Style.nmcTrayWindowIconWidth
20+
fillMode: Image.PreserveAspectFit
21+
}
22+
23+
Text {
24+
text: root.text
25+
color: hovered ? Style.nmcTrayWindowHeaderTextColor : Style.nmcTrayWindowHeaderTextColor
26+
font.pixelSize: Style.topLinePixelSize
27+
verticalAlignment: Text.AlignVCenter
28+
horizontalAlignment: Text.AlignLeft
29+
elide: Text.ElideRight
30+
Layout.fillWidth: true
31+
}
32+
}
33+
34+
background: Rectangle {
35+
color: root.hovered ? Style.nmcTrayWindowHeaderHighlightColor : "transparent"
36+
}
37+
}

src/gui/nmcgui/qmldir

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module NMCGui
2+
NMCHeaderButton 1.0 NMCHeaderButton.qml
3+
NMCMenuItem 1.0 NMCMenuItem.qml

src/gui/tray/ActivityItemActions.qml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,25 @@ Repeater {
5050
onClicked: isTalkReplyButton ? root.showReplyField() : root.triggerAction(model.index)
5151

5252
visible: verb !== "REPLY" || (verb === "REPLY" && root.talkReplyButtonVisible)
53+
54+
HoverHandler {
55+
id: mouse
56+
acceptedDevices: PointerDevice.AllPointerTypes
57+
}
58+
59+
background: Rectangle {
60+
color: mouse.hovered ? Style.nmcConflictHoverColor : Style.nmcConflictColor
61+
radius: Style.nmcStandardRadius
62+
height: Style.nmcTraySyncButtonHeight
63+
}
64+
65+
contentItem: Text {
66+
text: activityActionButton.text
67+
color: mouse.hovered ? Style.nmcTextInButtonColor : Style.nmcTextInButtonColor
68+
font.pixelSize: Style.fontSizeSmall
69+
horizontalAlignment: Text.AlignHCenter
70+
verticalAlignment: Text.AlignVCenter
71+
elide: Text.ElideRight
72+
}
5373
}
5474
}

src/gui/tray/ActivityItemContent.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ RowLayout {
3333
Item {
3434
id: thumbnailItem
3535

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

4040
implicitWidth: root.iconSize
@@ -184,7 +184,7 @@ RowLayout {
184184
}
185185

186186
display: Button.IconOnly
187-
visible: model.showFileDetails
187+
visible: false
188188
onClicked: Systray.presentShareViewInTray(model.openablePath)
189189
}
190190

src/gui/tray/ActivityList.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ ScrollView {
9898
width: activityList.contentItem.width
9999

100100
isFileActivityList: controlRoot.isFileActivityList
101-
iconSize: controlRoot.iconSize
101+
iconSize: Style.nmcListViewIconSize
102+
leftPadding: Style.nmcListViewLeftPadding
102103
flickable: activityList
103104
onHoveredChanged: if (hovered) {
104105
// When we set the currentIndex the list view will scroll...

0 commit comments

Comments
 (0)