Skip to content

Commit

Permalink
Merge #309 [stable-3.14] nmc/2055-Main_Window_Changes_New
Browse files Browse the repository at this point in the history
  • Loading branch information
memurats committed Oct 30, 2024
2 parents 4223d66 + 68695d8 commit 506dab0
Show file tree
Hide file tree
Showing 13 changed files with 498 additions and 162 deletions.
2 changes: 2 additions & 0 deletions resources.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<RCC>
<qresource prefix="/qml">
<file>src/gui/nmcgui/NMCHeaderButton.qml</file>
<file>src/gui/nmcgui/NMCMenuItem.qml</file>
<file>src/gui/UserStatusSelector.qml</file>
<file>src/gui/UserStatusSelectorPage.qml</file>
<file>src/gui/EmojiPicker.qml</file>
Expand Down
74 changes: 74 additions & 0 deletions src/gui/nmcgui/NMCHeaderButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* 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: 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
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
leftPadding: 8
rightPadding: 8
}
}
}

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.nmcTrayWindowHeaderTextColor : Style.nmcTrayWindowHeaderTextColor
hoverEnabled: true
font.pixelSize: Style.topLinePixelSize
}
14 changes: 14 additions & 0 deletions src/gui/tray/ActivityItemActions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ Repeater {

onClicked: isTalkReplyButton ? root.showReplyField() : root.triggerAction(model.index)

textColor: Style.nmcTextInButtonColor
textColorHovered: Style.nmcTextInButtonColor

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

HoverHandler {
id: mouse
acceptedDevices: PointerDevice.Mouse
}

background: Rectangle {
color: mouse.hovered? Style.nmcConflictHoverColor : Style.nmcConflictColor
radius: Style.nmcStandardRadius
height: Style.nmcTraySyncButtonHeight
}
}
}
8 changes: 5 additions & 3 deletions src/gui/tray/ActivityItemContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ 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 * (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 @@ -174,7 +176,7 @@ RowLayout {

display: Button.IconOnly

visible: model.showFileDetails
visible: false

onClicked: Systray.presentShareViewInTray(model.openablePath)
}
Expand Down
4 changes: 3 additions & 1 deletion src/gui/tray/ActivityList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ ScrollView {
width: activityList.contentItem.width

isFileActivityList: controlRoot.isFileActivityList
iconSize: controlRoot.iconSize
// 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
Loading

0 comments on commit 506dab0

Please sign in to comment.