Skip to content

Commit

Permalink
Changes to Main menu and List view
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugen Fischer authored and Eugen Fischer committed Jan 10, 2024
1 parent c7dd7dc commit 1098012
Show file tree
Hide file tree
Showing 17 changed files with 347 additions and 149 deletions.
2 changes: 2 additions & 0 deletions resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@
<file>src/gui/ConflictDelegate.qml</file>
<file>src/gui/ConflictItemFileInfo.qml</file>
<file>src/gui/filedetails/NCInputDateField.qml</file>
<file>src/gui/nmcgui/NMCHeaderButton.qml</file>
<file>src/gui/nmcgui/NMCMenuItem.qml</file>
</qresource>
</RCC>
73 changes: 73 additions & 0 deletions src/gui/nmcgui/NMCHeaderButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Copyright (C) 2024 by Eugen Fischer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/

import QtQml 2.15
import QtQml.Models 2.15
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.15

// Custom qml modules are in /theme (and included by resources.qrc)
import Style 1.0
import com.nextcloud.desktopclient 1.0

Item{
id: rec

width: 80
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
icon.source: rec.iconSource
icon.width: Style.nmcTrayWindowIconWidth
icon.height: Style.nmcTrayWindowIconWidth

onClicked: {
rec.clickedButton()
}

background: Rectangle {
color: iconHovered || button.visualFocus ? "black" : "transparent"
opacity: 0.05
}
Layout.alignment: Qt.AlignHCenter
}

Text {
width: rec.width
text: rec.iconText
elide: Text.ElideRight
color: Style.nmcTrayWindowHeaderTextColor
font.pixelSize: Style.nmcFontSizeIconText
font.bold: false
Layout.alignment: Qt.AlignHCenter
}
}
}

26 changes: 26 additions & 0 deletions src/gui/nmcgui/NMCMenuItem.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2023 by Eugen Fischer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/

import QtQml 2.15
import QtQuick 2.15
import QtQuick.Controls 2.15

import Style 1.0

MenuItem {
icon.color: hovered ? Style.ncBlue : Style.ncTextColor
palette.windowText: hovered ? Style.ncBlue : Style.ncTextColor
hoverEnabled: true
font.pixelSize: Style.topLinePixelSize
}
2 changes: 1 addition & 1 deletion src/gui/tray/ActivityItemContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ RowLayout {
bgColor: palette.mid
bgNormalOpacity: 0

visible: model.showFileDetails
visible: false //model.showFileDetails

onClicked: Systray.presentShareViewInTray(model.openablePath)
}
Expand Down
8 changes: 7 additions & 1 deletion src/gui/tray/SyncStatus.qml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ RowLayout {
text: qsTr("Sync now")

padding: Style.smallSpacing
textColor: Style.adjustedCurrentUserHeaderColor
textColor: Style.nmcTextInButtonColor
textColorHovered: Style.currentUserHeaderTextColor
contentsFont.bold: true
bgColor: Style.currentUserHeaderColor
Expand All @@ -113,6 +113,12 @@ RowLayout {
NC.UserModel.currentUser.forceSyncNow();
}
}

background: Rectangle {
color: Style.nmcTelekomMagentaColor
radius: 5
height: Style.nmcTraySyncButtonHeight
}
}

CustomButton {
Expand Down
41 changes: 29 additions & 12 deletions src/gui/tray/UserLine.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.0

import "../nmcgui/"

// Custom qml modules are in /theme (and included by resources.qrc)
import Style 1.0
Expand Down Expand Up @@ -51,9 +54,10 @@ AbstractButton {
Layout.leftMargin: 7
verticalAlignment: Qt.AlignCenter
cache: false
source: model.avatar !== "" ? model.avatar : Theme.darkMode ? "image://avatars/fallbackWhite" : "image://avatars/fallbackBlack"
Layout.preferredHeight: Style.accountAvatarSize
Layout.preferredWidth: Style.accountAvatarSize
visible:false
source: Style.nmcAccountAvatarIcon
sourceSize.width: Style.nmcTrayWindowIconWidth //NMC Customization: These changes making the image sharp
sourceSize.height: Style.nmcTrayWindowIconWidth

Rectangle {
id: accountStatusIndicatorBackground
Expand Down Expand Up @@ -81,6 +85,18 @@ AbstractButton {
}
}

//this section is added to add hover effect on account avatar image
//MagentaCustomization
ColorOverlay {
cached: true
color: hovered ? Style.nmcTelekomMagentaColor : Style.ncTextColor
width: source.width
height: source.height
source: accountAvatar
anchors.leftMargin: 16
Layout.leftMargin: 16
}

ColumnLayout {
id: accountLabels
Layout.leftMargin: Style.accountLabelsSpacing
Expand All @@ -96,6 +112,7 @@ AbstractButton {
elide: Text.ElideRight
font.pixelSize: Style.topLinePixelSize
font.bold: true
palette.windowText :hovered ? Style.nmcTelekomMagentaColor : Style.ncTextColor
}

RowLayout {
Expand Down Expand Up @@ -142,7 +159,7 @@ AbstractButton {
flat: true

icon.source: "qrc:///client/theme/more.svg"
icon.color: palette.buttonText
icon.color: hovered ? Style.nmcTelekomMagentaColor : Style.ncTextColor

Accessible.role: Accessible.ButtonMenu
Accessible.name: qsTr("Account actions")
Expand All @@ -158,6 +175,8 @@ AbstractButton {
AutoSizingMenu {
id: userMoreButtonMenu
closePolicy: Menu.CloseOnPressOutsideParent | Menu.CloseOnEscape
width: 170
height: Math.min(implicitHeight, maxMenuHeight)

MenuItem {
visible: model.isConnected && model.serverHasUserStatus
Expand All @@ -169,11 +188,10 @@ AbstractButton {
onClicked: showUserStatusSelector(index)
}

MenuItem {
NMCMenuItem {
text: model.isConnected ? qsTr("Log out") : qsTr("Log in")
font.pixelSize: Style.topLinePixelSize
palette.windowText: Style.ncTextColor
hoverEnabled: true
icon.source: Style.nmcLogOutIcon
icon.color: hovered ? Style.nmcTelekomMagentaColor : Style.ncTextColor
onClicked: {
model.isConnected ? UserModel.logout(index) : UserModel.login(index)
accountMenu.close()
Expand Down Expand Up @@ -202,12 +220,11 @@ AbstractButton {
}
}

MenuItem {
NMCMenuItem {
id: removeAccountButton
text: qsTr("Remove account")
font.pixelSize: Style.topLinePixelSize
palette.windowText: Style.ncTextColor
hoverEnabled: true
icon.source: Style.nmcRemoveIcon
icon.color: hovered ? Style.nmcTelekomMagentaColor : Style.ncTextColor
onClicked: {
UserModel.removeAccount(index)
accountMenu.close()
Expand Down
Loading

0 comments on commit 1098012

Please sign in to comment.