diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index a5a352dd47..4a6391d8c9 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #ifdef USE_FDO_NOTIFICATIONS #include @@ -129,6 +130,12 @@ Systray::Systray() }); #endif + const auto ptr = qobject_cast(QGuiApplication::instance()); + if(ptr) { + _guiAppInstance.reset(ptr); + connect(ptr, &QGuiApplication::paletteChanged, this, &Systray::darkModeChanged); + } + connect(UserModel::instance(), &UserModel::newUserSelected, this, &Systray::slotNewUserSelected); connect(UserModel::instance(), &UserModel::addAccount, @@ -224,6 +231,24 @@ bool Systray::useNormalWindow() const return cfg.showMainDialogAsNormalWindow(); } +bool Systray::darkMode() +{ +#if defined(Q_OS_MACOS) + return osXInDarkMode(); +// Windows: Check registry for dark mode +#elif defined(Q_OS_WIN) + const auto darkModeSubkey = QStringLiteral("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"); + if (!Utility::registryKeyExists(HKEY_CURRENT_USER, darkModeSubkey)) { + return false; + } + const auto darkMode = Utility::registryGetKeyValue(HKEY_CURRENT_USER, darkModeSubkey, QStringLiteral("AppsUseLightTheme")).toBool(); + return darkMode; +// Probably Linux +#else + return Theme::isDarkColor(QGuiApplication::palette().window().color()); +#endif +} + Q_INVOKABLE void Systray::setOpened() { _isOpen = true; diff --git a/src/gui/systray.h b/src/gui/systray.h index 84f90d34bd..c0dc404ade 100644 --- a/src/gui/systray.h +++ b/src/gui/systray.h @@ -27,6 +27,7 @@ class QQmlApplicationEngine; class QQuickWindow; class QWindow; class QQuickWindow; +class QGuiApplication; namespace OCC { @@ -39,6 +40,7 @@ public: }; #ifdef Q_OS_OSX +bool osXInDarkMode(); bool canOsXSendUserNotification(); void sendOsXUserNotification(const QString &title, const QString &message); void setTrayWindowLevelAndVisibleOnAllSpaces(QWindow *window); @@ -56,6 +58,7 @@ class Systray Q_PROPERTY(QString windowTitle READ windowTitle CONSTANT) Q_PROPERTY(bool useNormalWindow READ useNormalWindow CONSTANT) + Q_PROPERTY(bool darkMode READ darkMode NOTIFY darkModeChanged) public: static Systray *instance(); @@ -71,6 +74,7 @@ public: bool isOpen(); QString windowTitle() const; bool useNormalWindow() const; + bool darkMode(); Q_INVOKABLE void pauseResumeSync(); Q_INVOKABLE bool syncIsPaused(); @@ -93,6 +97,8 @@ signals: void showFileActivityDialog(const QString &objectName, const int objectId); void sendChatMessage(const QString &token, const QString &message, const QString &replyTo); + void darkModeChanged(); + public slots: void slotNewUserSelected(); @@ -119,6 +125,8 @@ private: QPointer _trayEngine; AccessManagerFactory _accessManagerFactory; + + QScopedPointer _guiAppInstance; }; } // namespace OCC diff --git a/src/gui/systray.mm b/src/gui/systray.mm index 544455c16e..7f564fcd22 100644 --- a/src/gui/systray.mm +++ b/src/gui/systray.mm @@ -56,4 +56,10 @@ void setTrayWindowLevelAndVisibleOnAllSpaces(QWindow *window) [nativeWindow setLevel:NSMainMenuWindowLevel]; } +bool osXInDarkMode() +{ + NSString *osxMode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"]; + return [osxMode containsString:@"Dark"]; +} + } diff --git a/src/gui/tray/ActivityActionButton.qml b/src/gui/tray/ActivityActionButton.qml index 275749c74b..eca55ebdcb 100644 --- a/src/gui/tray/ActivityActionButton.qml +++ b/src/gui/tray/ActivityActionButton.qml @@ -15,8 +15,8 @@ Item { property string imageSource: "" property string imageSourceHover: "" - property color textColor: Style.unifiedSearchResulTitleColor - property color textColorHovered: Style.unifiedSearchResulSublineColor + property color textColor: Style.ncTextColor + property color textColorHovered: Style.ncSecondaryTextColor signal clicked() diff --git a/src/gui/tray/ActivityItem.qml b/src/gui/tray/ActivityItem.qml index b3363a7eb7..3808d5b003 100644 --- a/src/gui/tray/ActivityItem.qml +++ b/src/gui/tray/ActivityItem.qml @@ -22,10 +22,6 @@ MouseArea { height: childrenRect.height - ToolTip.visible: containsMouse && !activityContent.childHovered && model.displayLocation !== "" - ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval - ToolTip.text: qsTr("In %1").arg(model.displayLocation) - Accessible.role: Accessible.ListItem Accessible.name: (model.path !== "" && model.displayPath !== "") ? qsTr("Open %1 locally").arg(model.displayPath) : model.message Accessible.onPressAction: root.clicked() @@ -36,6 +32,21 @@ MouseArea { color: (parent.containsMouse ? Style.lightHover : "transparent") } + ToolTip { + id: activityMouseAreaTooltip + visible: containsMouse && !activityContent.childHovered && model.displayLocation !== "" + delay: Qt.styleHints.mousePressAndHoldInterval + text: qsTr("In %1").arg(model.displayLocation) + contentItem: Label { + text: activityMouseAreaTooltip.text + color: Style.ncTextColor + } + background: Rectangle { + border.color: Style.menuBorder + color: Style.backgroundColor + } + } + ColumnLayout { anchors.left: root.left anchors.right: root.right diff --git a/src/gui/tray/ActivityItemActions.qml b/src/gui/tray/ActivityItemActions.qml index 32c3b893f6..3f14fbd4d4 100644 --- a/src/gui/tray/ActivityItemActions.qml +++ b/src/gui/tray/ActivityItemActions.qml @@ -43,8 +43,8 @@ RowLayout { imageSource: model.modelData.imageSource imageSourceHover: model.modelData.imageSourceHovered - textColor: imageSource !== "" ? UserModel.currentUser.headerColor : Style.unifiedSearchResulSublineColor - textColorHovered: imageSource !== "" ? Style.lightHover : Style.unifiedSearchResulTitleColor + textColor: imageSource !== "" ? UserModel.currentUser.headerColor : Style.ncTextColor + textColorHovered: imageSource !== "" ? Style.lightHover : Style.ncTextColor bold: primary @@ -67,15 +67,27 @@ RowLayout { id: moreActionsButton icon.source: "qrc:///client/theme/more.svg" + icon.color: Style.ncTextColor background: Rectangle { - color: parent.hovered ? "white" : root.moreActionsButtonColor + color: parent.hovered ? Style.lightHover : root.moreActionsButtonColor radius: width / 2 } - ToolTip.visible: hovered - ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval - ToolTip.text: qsTr("Show more actions") + ToolTip { + id: moreActionsButtonTooltip + visible: parent.hovered + delay: Qt.styleHints.mousePressAndHoldInterval + text: qsTr("Show more actions") + contentItem: Label { + text: moreActionsButtonTooltip.text + color: Style.ncTextColor + } + background: Rectangle { + border.color: Style.menuBorder + color: Style.backgroundColor + } + } Accessible.name: qsTr("Show more actions") diff --git a/src/gui/tray/ActivityItemContent.qml b/src/gui/tray/ActivityItemContent.qml index aa7534c62c..60e3fac60a 100644 --- a/src/gui/tray/ActivityItemContent.qml +++ b/src/gui/tray/ActivityItemContent.qml @@ -76,7 +76,12 @@ RowLayout { anchors.right: if(model.thumbnail !== undefined) parent.right anchors.bottom: if(model.thumbnail !== undefined) parent.bottom cache: true - source: icon + + property string sourceUrl: Systray.darkMode ? + model.icon.replace("__COLOR__", "white").replace("__WHITE_GOES_HERE__", "-white") : + model.icon.replace("__COLOR__", "black").replace("__WHITE_GOES_HERE__", "") + + source: sourceUrl sourceSize.height: 64 sourceSize.width: 64 } @@ -99,7 +104,8 @@ RowLayout { wrapMode: Text.Wrap maximumLineCount: 2 font.pixelSize: Style.topLinePixelSize - color: root.activityData.activityTextTitleColor + color: Style.ncTextColor + //color: root.activityData.activityTextTitleColor } Label { @@ -114,6 +120,7 @@ RowLayout { wrapMode: Text.Wrap maximumLineCount: 2 font.pixelSize: Style.subLinePixelSize + color: Style.ncTextColor } Label { @@ -125,8 +132,8 @@ RowLayout { wrapMode: Text.Wrap maximumLineCount: 2 font.pixelSize: Style.subLinePixelSize - color: "#808080" - } + color: Style.ncSecondaryTextColor + } Loader { id: talkReplyTextFieldLoader @@ -152,9 +159,20 @@ RowLayout { Layout.margins: Style.roundButtonBackgroundVerticalMargins - ToolTip.visible: hovered - ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval - ToolTip.text: qsTr("Dismiss") + ToolTip { + id: dismissActionButtonTooltip + visible: parent.hovered + delay: Qt.styleHints.mousePressAndHoldInterval + text: qsTr("Dismiss") + contentItem: Label { + text: dismissActionButtonTooltip.text + color: Style.ncTextColor + } + background: Rectangle { + border.color: Style.menuBorder + color: Style.backgroundColor + } + } Accessible.name: qsTr("Dismiss") @@ -166,7 +184,9 @@ RowLayout { contentItem: Image { anchors.fill: parent - source: parent.hovered ? "image://svgimage-custom-color/clear.svg/black" : "image://svgimage-custom-color/clear.svg/grey" + source: parent.hovered ? Systray.darkMode ? + "image://svgimage-custom-color/clear.svg/white" : "image://svgimage-custom-color/clear.svg/black" : + "image://svgimage-custom-color/clear.svg/grey" sourceSize.width: 24 sourceSize.height: 24 } diff --git a/src/gui/tray/ActivityItemContextMenu.qml b/src/gui/tray/ActivityItemContextMenu.qml index acf9b42670..de35e35848 100644 --- a/src/gui/tray/ActivityItemContextMenu.qml +++ b/src/gui/tray/ActivityItemContextMenu.qml @@ -1,6 +1,7 @@ import QtQml 2.15 import QtQuick 2.15 import QtQuick.Controls 2.3 +import Style 1.0 AutoSizingMenu { id: moreActionsButtonContextMenu @@ -19,6 +20,7 @@ AutoSizingMenu { delegate: MenuItem { id: moreActionsButtonContextMenuEntry text: model.modelData.label + palette.windowText: Style.ncTextColor onTriggered: menuEntryTriggered(model.modelData.actionIndex) } } diff --git a/src/gui/tray/AutoSizingMenu.qml b/src/gui/tray/AutoSizingMenu.qml index fe929eb3c1..efc23d1bf5 100644 --- a/src/gui/tray/AutoSizingMenu.qml +++ b/src/gui/tray/AutoSizingMenu.qml @@ -1,7 +1,13 @@ import QtQuick 2.15 import QtQuick.Controls 2.3 +import Style 1.0 Menu { + background: Rectangle { + border.color: Style.menuBorder + color: Style.backgroundColor + } + width: { var result = 0; var padding = 0; diff --git a/src/gui/tray/CustomButton.qml b/src/gui/tray/CustomButton.qml index 7e73740bd8..4c96c4b25a 100644 --- a/src/gui/tray/CustomButton.qml +++ b/src/gui/tray/CustomButton.qml @@ -1,6 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.2 +import Style 1.0 Button { id: root @@ -26,6 +27,21 @@ Button { leftPadding: root.text === "" ? 5 : 10 rightPadding: root.text === "" ? 5 : 10 + ToolTip { + id: customButtonTooltip + text: root.toolTipText + delay: Qt.styleHints.mousePressAndHoldInterval + visible: root.toolTipText !== "" && root.hovered + contentItem: Label { + text: customButtonTooltip.text + color: Style.ncTextColor + } + background: Rectangle { + border.color: Style.menuBorder + color: Style.backgroundColor + } + } + contentItem: RowLayout { Image { id: icon @@ -52,10 +68,4 @@ Button { elide: Text.ElideRight } } - - ToolTip { - text: root.toolTipText - delay: Qt.styleHints.mousePressAndHoldInterval - visible: root.toolTipText !== "" && root.hovered - } } diff --git a/src/gui/tray/CustomTextButton.qml b/src/gui/tray/CustomTextButton.qml index 86323a1c0a..000a54d3cc 100644 --- a/src/gui/tray/CustomTextButton.qml +++ b/src/gui/tray/CustomTextButton.qml @@ -12,8 +12,8 @@ Label { height: implicitHeight - property color textColor: Style.unifiedSearchResulTitleColor - property color textColorHovered: Style.unifiedSearchResulSublineColor + property color textColor: Style.ncTextColor + property color textColorHovered: Style.ncSecondaryTextColor Accessible.role: Accessible.Button Accessible.name: text @@ -33,9 +33,18 @@ Label { signal clicked(QtObject mouse) ToolTip { + id: customTextButtonTooltip text: root.toolTipText delay: Qt.styleHints.mousePressAndHoldInterval visible: root.toolTipText !== "" && root.hovered + contentItem: Label { + text: customTextButtonTooltip.text + color: Style.ncTextColor + } + background: Rectangle { + border.color: Style.menuBorder + color: Style.backgroundColor + } } MouseArea { diff --git a/src/gui/tray/FileActivityDialog.qml b/src/gui/tray/FileActivityDialog.qml index 785d458063..58264ef28c 100644 --- a/src/gui/tray/FileActivityDialog.qml +++ b/src/gui/tray/FileActivityDialog.qml @@ -1,6 +1,8 @@ +import QtQml 2.15 import QtQuick 2.15 import QtQuick.Window 2.15 +import Style 1.0 import com.nextcloud.desktopclient 1.0 as NC Window { @@ -15,6 +17,12 @@ Window { width: 500 height: 500 + Rectangle { + id: background + anchors.fill: parent + color: Style.backgroundColor + } + ActivityList { isFileActivityList: true anchors.fill: parent diff --git a/src/gui/tray/HeaderButton.qml b/src/gui/tray/HeaderButton.qml index 7df075ff00..b6fe6ab86b 100644 --- a/src/gui/tray/HeaderButton.qml +++ b/src/gui/tray/HeaderButton.qml @@ -18,7 +18,7 @@ Button { icon.width: Style.headerButtonIconSize icon.height: Style.headerButtonIconSize - icon.color: Style.ncTextColor + icon.color: Style.ncHeaderTextColor Layout.alignment: Qt.AlignRight Layout.preferredWidth: Style.trayWindowHeaderHeight diff --git a/src/gui/tray/SyncStatus.qml b/src/gui/tray/SyncStatus.qml index 83a38cf4ff..0fd3ea2c1b 100644 --- a/src/gui/tray/SyncStatus.qml +++ b/src/gui/tray/SyncStatus.qml @@ -62,6 +62,7 @@ RowLayout { verticalAlignment: Text.AlignVCenter font.pixelSize: Style.topLinePixelSize font.bold: true + color: Style.ncTextColor } Loader { @@ -84,7 +85,7 @@ RowLayout { text: syncStatus.syncStatusDetailString visible: syncStatus.syncStatusDetailString !== "" - color: "#808080" + color: Style.ncSecondaryTextColor font.pixelSize: Style.subLinePixelSize } } diff --git a/src/gui/tray/UnifiedSearchInputContainer.qml b/src/gui/tray/UnifiedSearchInputContainer.qml index df99c66308..cb56875308 100644 --- a/src/gui/tray/UnifiedSearchInputContainer.qml +++ b/src/gui/tray/UnifiedSearchInputContainer.qml @@ -28,10 +28,13 @@ TextField { selectByMouse: true + palette.text: Style.ncSecondaryTextColor + background: Rectangle { radius: 5 border.color: parent.activeFocus ? UserModel.currentUser.accentColor : Style.menuBorder border.width: 1 + color: Style.backgroundColor } Image { diff --git a/src/gui/tray/UnifiedSearchResultFetchMoreTrigger.qml b/src/gui/tray/UnifiedSearchResultFetchMoreTrigger.qml index 1af2d42ca7..02ea71f2b9 100644 --- a/src/gui/tray/UnifiedSearchResultFetchMoreTrigger.qml +++ b/src/gui/tray/UnifiedSearchResultFetchMoreTrigger.qml @@ -13,7 +13,7 @@ ColumnLayout { property int fontSize: Style.topLinePixelSize - property string textColor: "grey" + property string textColor: Style.ncSecondaryTextColor Accessible.role: Accessible.ListItem Accessible.name: unifiedSearchResultItemFetchMoreText.text diff --git a/src/gui/tray/UnifiedSearchResultItem.qml b/src/gui/tray/UnifiedSearchResultItem.qml index 69daa19dfe..702b3a331f 100644 --- a/src/gui/tray/UnifiedSearchResultItem.qml +++ b/src/gui/tray/UnifiedSearchResultItem.qml @@ -23,8 +23,8 @@ RowLayout { property int titleFontSize: Style.topLinePixelSize property int sublineFontSize: Style.subLinePixelSize - property string titleColor: "black" - property string sublineColor: "grey" + property color titleColor: Style.ncTextColor + property color sublineColor: Style.ncSecondaryTextColor Accessible.role: Accessible.ListItem Accessible.name: resultTitle @@ -65,12 +65,12 @@ RowLayout { } Image { id: unifiedSearchResultThumbnailPlaceholder - visible: icons && iconPlaceholder && unifiedSearchResultThumbnail.status !== Image.Ready Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter Layout.leftMargin: iconLeftMargin verticalAlignment: Qt.AlignCenter cache: true source: iconPlaceholder + visible: false sourceSize.height: unifiedSearchResultItemDetails.iconWidth sourceSize.width: unifiedSearchResultItemDetails.iconWidth Layout.preferredWidth: unifiedSearchResultItemDetails.iconWidth diff --git a/src/gui/tray/UnifiedSearchResultItemSkeleton.qml b/src/gui/tray/UnifiedSearchResultItemSkeleton.qml index 3f86c4b9f8..ddc38d29dc 100644 --- a/src/gui/tray/UnifiedSearchResultItemSkeleton.qml +++ b/src/gui/tray/UnifiedSearchResultItemSkeleton.qml @@ -14,8 +14,8 @@ RowLayout { property int titleFontSize: Style.topLinePixelSize property int sublineFontSize: Style.subLinePixelSize - property string titleColor: "black" - property string sublineColor: "grey" + property color titleColor: Style.ncTextColor + property color sublineColor: Style.ncSecondaryTextColor property string iconColor: "#afafaf" diff --git a/src/gui/tray/UnifiedSearchResultItemSkeletonContainer.qml b/src/gui/tray/UnifiedSearchResultItemSkeletonContainer.qml index 1b9f8c262a..e128f6860a 100644 --- a/src/gui/tray/UnifiedSearchResultItemSkeletonContainer.qml +++ b/src/gui/tray/UnifiedSearchResultItemSkeletonContainer.qml @@ -13,9 +13,9 @@ Column { property int itemHeight: Style.trayWindowHeaderHeight property int titleFontSize: Style.topLinePixelSize property int sublineFontSize: Style.subLinePixelSize - property string titleColor: "black" - property string sublineColor: "grey" - property string iconColor: "#afafaf" + property color titleColor: Style.ncTextColor + property color sublineColor: Style.ncSecondaryTextColor + property color iconColor: "#afafaf" Repeater { model: 10 diff --git a/src/gui/tray/UnifiedSearchResultListItem.qml b/src/gui/tray/UnifiedSearchResultListItem.qml index 33a05f2d56..785f8f5256 100644 --- a/src/gui/tray/UnifiedSearchResultListItem.qml +++ b/src/gui/tray/UnifiedSearchResultListItem.qml @@ -14,8 +14,8 @@ MouseArea { property int titleFontSize: Style.topLinePixelSize property int sublineFontSize: Style.subLinePixelSize - property string titleColor: "black" - property string sublineColor: "grey" + property color titleColor: Style.ncTextColor + property color sublineColor: Style.ncSecondaryTextColor property string currentFetchMoreInProgressProviderId: "" @@ -33,9 +33,18 @@ MouseArea { hoverEnabled: enabled ToolTip { + id: unifiedSearchResultMouseAreaTooltip visible: unifiedSearchResultMouseArea.containsMouse text: isFetchMoreTrigger ? qsTr("Load more results") : model.resultTitle + "\n\n" + model.subline delay: Qt.styleHints.mousePressAndHoldInterval + contentItem: Label { + text: unifiedSearchResultMouseAreaTooltip.text + color: Style.ncTextColor + } + background: Rectangle { + border.color: Style.menuBorder + color: Style.backgroundColor + } } Rectangle { diff --git a/src/gui/tray/UnifiedSearchResultNothingFound.qml b/src/gui/tray/UnifiedSearchResultNothingFound.qml index 36cea93a63..67bd8108e8 100644 --- a/src/gui/tray/UnifiedSearchResultNothingFound.qml +++ b/src/gui/tray/UnifiedSearchResultNothingFound.qml @@ -35,7 +35,7 @@ ColumnLayout { Label { id: unifiedSearchResultsNoResultsLabelDetails text: unifiedSearchResultNothingFoundContainer.text - color: "black" + color: Style.ncTextColor font.pixelSize: Style.topLinePixelSize * 1.25 wrapMode: Text.Wrap maximumLineCount: 2 diff --git a/src/gui/tray/UserLine.qml b/src/gui/tray/UserLine.qml index 442dc1f58f..3c25dc8658 100644 --- a/src/gui/tray/UserLine.qml +++ b/src/gui/tray/UserLine.qml @@ -48,7 +48,7 @@ MenuItem { Rectangle { anchors.fill: parent anchors.margins: 1 - color: parent.parent.hovered || parent.parent.visualFocus ? Style.lightHover : "transparent" + color: parent.parent.hovered || parent.parent.visualFocus ? Style.lightHover : Style.backgroundColor } } @@ -61,7 +61,7 @@ MenuItem { Layout.leftMargin: 7 verticalAlignment: Qt.AlignCenter cache: false - source: model.avatar != "" ? model.avatar : "image://avatars/fallbackBlack" + source: model.avatar != "" ? model.avatar : Systray.darkMode ? "image://avatars/fallbackWhite" : "image://avatars/fallbackBlack" Layout.preferredHeight: Style.accountAvatarSize Layout.preferredWidth: Style.accountAvatarSize Rectangle { @@ -100,7 +100,7 @@ MenuItem { id: accountUser text: name elide: Text.ElideRight - color: "black" + color: Style.ncTextColor font.pixelSize: Style.topLinePixelSize font.bold: true width: parent.width @@ -121,7 +121,7 @@ MenuItem { visible: model.statusMessage !== "" text: statusMessage elide: Text.ElideRight - color: "black" + color: Style.ncTextColor font.pixelSize: Style.subLinePixelSize leftPadding: Style.accountLabelsSpacing } @@ -132,7 +132,7 @@ MenuItem { height: Style.topLinePixelSize text: server elide: Text.ElideRight - color: "black" + color: Style.ncTextColor font.pixelSize: Style.subLinePixelSize } } @@ -146,7 +146,7 @@ MenuItem { flat: true icon.source: "qrc:///client/theme/more.svg" - icon.color: "transparent" + icon.color: Style.ncTextColor Accessible.role: Accessible.ButtonMenu Accessible.name: qsTr("Account actions") @@ -173,6 +173,7 @@ MenuItem { background: Rectangle { border.color: Style.menuBorder + color: Style.backgroundColor radius: 2 } @@ -181,6 +182,7 @@ MenuItem { height: visible ? implicitHeight : 0 text: qsTr("Set status") font.pixelSize: Style.topLinePixelSize + palette.windowText: Style.ncTextColor hoverEnabled: true onClicked: { showUserStatusSelectorDialog(index) @@ -201,6 +203,7 @@ MenuItem { MenuItem { text: model.isConnected ? qsTr("Log out") : qsTr("Log in") font.pixelSize: Style.topLinePixelSize + palette.windowText: Style.ncTextColor hoverEnabled: true onClicked: { model.isConnected ? UserModel.logout(index) : UserModel.login(index) @@ -234,6 +237,7 @@ MenuItem { id: removeAccountButton text: qsTr("Remove account") font.pixelSize: Style.topLinePixelSize + palette.windowText: Style.ncTextColor hoverEnabled: true onClicked: { UserModel.removeAccount(index) diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index a6f97a6804..2cc13dd7b3 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -111,6 +111,7 @@ Window { radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius border.width: Style.trayWindowBorderWidth border.color: Style.menuBorder + color: Style.backgroundColor Accessible.role: Accessible.Grouping Accessible.name: qsTr("Nextcloud desktop main dialog") @@ -137,6 +138,7 @@ Window { Layout.preferredHeight: Style.trayWindowHeaderHeight display: AbstractButton.IconOnly flat: true + palette: Style.systemPalette Accessible.role: Accessible.ButtonMenu Accessible.name: qsTr("Current account") @@ -168,9 +170,11 @@ Window { width: (Style.currentAccountButtonWidth - 2) height: Math.min(implicitHeight, maxMenuHeight) closePolicy: Menu.CloseOnPressOutsideParent | Menu.CloseOnEscape + palette: Style.palette background: Rectangle { border.color: Style.menuBorder + color: Style.backgroundColor radius: Style.currentAccountButtonRadius } @@ -216,6 +220,7 @@ Window { id: addAccountButton height: Style.addAccountButtonHeight hoverEnabled: true + palette: Theme.systemPalette background: Item { height: parent.height @@ -234,14 +239,14 @@ Window { Image { Layout.leftMargin: 12 verticalAlignment: Qt.AlignCenter - source: "qrc:///client/theme/black/add.svg" + source: Systray.darkMode ? "qrc:///client/theme/white/add.svg" : "qrc:///client/theme/black/add.svg" sourceSize.width: Style.headerButtonIconSize sourceSize.height: Style.headerButtonIconSize } Label { Layout.leftMargin: 14 text: qsTr("Add account") - color: "black" + color: Style.ncTextColor font.pixelSize: Style.topLinePixelSize } // Filler on the right @@ -267,6 +272,7 @@ Window { MenuItem { id: syncPauseButton font.pixelSize: Style.topLinePixelSize + palette.windowText: Style.ncTextColor hoverEnabled: true onClicked: Systray.pauseResumeSync() @@ -289,6 +295,7 @@ Window { id: settingsButton text: qsTr("Settings") font.pixelSize: Style.topLinePixelSize + palette.windowText: Style.ncTextColor hoverEnabled: true onClicked: Systray.openSettings() @@ -311,6 +318,7 @@ Window { id: exitButton text: qsTr("Exit"); font.pixelSize: Style.topLinePixelSize + palette.windowText: Style.ncTextColor hoverEnabled: true onClicked: Systray.shutdown() @@ -411,6 +419,7 @@ Window { text: UserModel.currentUser.name elide: Text.ElideRight color: UserModel.currentUser.headerTextColor + font.pixelSize: Style.topLinePixelSize font.bold: true } @@ -566,6 +575,7 @@ Window { background: Rectangle { border.color: Style.menuBorder + color: Style.backgroundColor radius: 2 } @@ -578,10 +588,22 @@ Window { id: appEntry text: appName font.pixelSize: Style.topLinePixelSize + palette.windowText: Style.ncTextColor icon.source: appIconUrl + icon.color: Style.ncTextColor onTriggered: UserAppsModel.openAppUrl(appUrl) hoverEnabled: true + background: Item { + height: parent.height + width: parent.width + Rectangle { + anchors.fill: parent + anchors.margins: 1 + color: parent.parent.hovered || parent.parent.visualFocus ? Style.lightHover : "transparent" + } + } + Accessible.role: Accessible.MenuItem Accessible.name: qsTr("Open %1 in browser").arg(appName) Accessible.onPressAction: appEntry.triggered() @@ -713,16 +735,16 @@ Window { delegate: UnifiedSearchResultListItem { width: unifiedSearchResultsListView.width - height: trayWindowBackground.Style.unifiedSearchItemHeight + height: Style.unifiedSearchItemHeight isSearchInProgress: unifiedSearchResultsListView.model.isSearchInProgress - textLeftMargin: trayWindowBackground.Style.unifiedSearchResultTextLeftMargin - textRightMargin: trayWindowBackground.Style.unifiedSearchResultTextRightMargin - iconWidth: trayWindowBackground.Style.unifiedSearchResulIconWidth - iconLeftMargin: trayWindowBackground.Style.unifiedSearchResulIconLeftMargin - titleFontSize: trayWindowBackground.Style.unifiedSearchResulTitleFontSize - sublineFontSize: trayWindowBackground.Style.unifiedSearchResulSublineFontSize - titleColor: trayWindowBackground.Style.unifiedSearchResulTitleColor - sublineColor: trayWindowBackground.Style.unifiedSearchResulSublineColor + textLeftMargin: Style.unifiedSearchResultTextLeftMargin + textRightMargin: Style.unifiedSearchResultTextRightMargin + iconWidth: Style.unifiedSearchResulIconWidth + iconLeftMargin: Style.unifiedSearchResulIconLeftMargin + titleFontSize: Style.unifiedSearchResulTitleFontSize + sublineFontSize: Style.unifiedSearchResulSublineFontSize + titleColor: Style.ncTextColor + sublineColor: Style.ncSecondaryTextColor currentFetchMoreInProgressProviderId: unifiedSearchResultsListView.model.currentFetchMoreInProgressProviderId fetchMoreTriggerClicked: unifiedSearchResultsListView.model.fetchMoreTriggerClicked resultClicked: unifiedSearchResultsListView.model.resultClicked diff --git a/src/gui/tray/activitylistmodel.cpp b/src/gui/tray/activitylistmodel.cpp index 45fcdf949e..63733b8be2 100644 --- a/src/gui/tray/activitylistmodel.cpp +++ b/src/gui/tray/activitylistmodel.cpp @@ -33,6 +33,7 @@ #include "activitydata.h" #include "activitylistmodel.h" +#include "systray.h" #include "theme.h" @@ -215,41 +216,48 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const } case ActionIconRole: { + auto colorIconPath = QStringLiteral("qrc:///client/theme/__COLOR__/"); // We will replace __COLOR__ in QML if (a._type == Activity::NotificationType) { - return "qrc:///client/theme/black/bell.svg"; + colorIconPath.append("bell.svg"); + return colorIconPath; } else if (a._type == Activity::SyncResultType) { - return "qrc:///client/theme/black/state-error.svg"; + colorIconPath.append("state-error.svg"); + return colorIconPath; } else if (a._type == Activity::SyncFileItemType) { if (a._status == SyncFileItem::NormalError || a._status == SyncFileItem::FatalError || a._status == SyncFileItem::DetailError || a._status == SyncFileItem::BlacklistedError) { - return "qrc:///client/theme/black/state-error.svg"; + colorIconPath.append("state-error.svg"); + return colorIconPath; } else if (a._status == SyncFileItem::SoftError || a._status == SyncFileItem::Conflict || a._status == SyncFileItem::Restoration || a._status == SyncFileItem::FileLocked || a._status == SyncFileItem::FileNameInvalid) { - return "qrc:///client/theme/black/state-warning.svg"; + colorIconPath.append("state-warning.svg"); + return colorIconPath; } else if (a._status == SyncFileItem::FileIgnored) { - return "qrc:///client/theme/black/state-info.svg"; + colorIconPath.append("state-info.svg"); + return colorIconPath; } else { // File sync successful if (a._fileAction == "file_created") { - return a._previews.empty() ? "qrc:///client/theme/colored/add.svg" - : "qrc:///client/theme/colored/add-bordered.svg"; + return a._previews.empty() ? QStringLiteral("qrc:///client/theme/colored/add.svg") + : QStringLiteral("qrc:///client/theme/colored/add-bordered.svg"); } else if (a._fileAction == "file_deleted") { - return a._previews.empty() ? "qrc:///client/theme/colored/delete.svg" - : "qrc:///client/theme/colored/delete-bordered.svg"; + return a._previews.empty() ? QStringLiteral("qrc:///client/theme/colored/delete.svg") + : QStringLiteral("qrc:///client/theme/colored/delete-bordered.svg"); } else { - return a._previews.empty() ? "qrc:///client/theme/change.svg" - : "qrc:///client/theme/colored/change-bordered.svg"; + return a._previews.empty() ? colorIconPath % QStringLiteral("change.svg") + : QStringLiteral("qrc:///client/theme/colored/change-bordered.svg"); } } } else { // We have an activity if (a._icon.isEmpty()) { - return "qrc:///client/theme/black/activity.svg"; + colorIconPath.append("activity.svg"); + return colorIconPath; } return a._icon; @@ -390,7 +398,21 @@ void ActivityListModel::ingestActivities(const QJsonArray &activities) for (const auto &activ : activities) { const auto json = activ.toObject(); - const auto a = Activity::fromActivityJson(json, _accountState->account()); + auto a = Activity::fromActivityJson(json, _accountState->account()); + + auto colorIconPath = QStringLiteral("qrc:///client/theme/__COLOR__/"); + if(a._icon.contains("change.svg")) { + colorIconPath.append("change.svg"); + a._icon = colorIconPath; + } else if(a._icon.contains("calendar.svg")) { + colorIconPath.append("calendar.svg"); + a._icon = colorIconPath; + } else if(a._icon.contains("personal.svg")) { + colorIconPath.append("user.svg"); + a._icon = colorIconPath; + } else if(a._icon.contains("core/img/actions")) { + a._icon.insert(a._icon.indexOf(".svg"), "__WHITE_GOES_HERE__"); + } list.append(a); _currentItem = list.last()._id; diff --git a/src/gui/tray/activitylistmodel.h b/src/gui/tray/activitylistmodel.h index 9c966e92cd..44b521352e 100644 --- a/src/gui/tray/activitylistmodel.h +++ b/src/gui/tray/activitylistmodel.h @@ -115,6 +115,7 @@ signals: void sendNotificationRequest(const QString &accountName, const QString &link, const QByteArray &verb, int row); protected: + void setup(); void activitiesReceived(const QJsonDocument &json, int statusCode); QHash roleNames() const override; diff --git a/src/gui/tray/unifiedsearchresultslistmodel.cpp b/src/gui/tray/unifiedsearchresultslistmodel.cpp index 751ab7bbbd..708acb7ded 100644 --- a/src/gui/tray/unifiedsearchresultslistmodel.cpp +++ b/src/gui/tray/unifiedsearchresultslistmodel.cpp @@ -19,6 +19,7 @@ #include "guiutility.h" #include "folderman.h" #include "networkjobs.h" +#include "systray.h" #include @@ -30,17 +31,17 @@ QString imagePlaceholderUrlForProviderId(const QString &providerId) { if (providerId.contains(QStringLiteral("message"), Qt::CaseInsensitive) || providerId.contains(QStringLiteral("talk"), Qt::CaseInsensitive)) { - return QStringLiteral("qrc:///client/theme/black/wizard-talk.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral("qrc:///client/theme/white/wizard-talk.svg") : QStringLiteral("qrc:///client/theme/black/wizard-talk.svg"); } else if (providerId.contains(QStringLiteral("file"), Qt::CaseInsensitive)) { - return QStringLiteral("qrc:///client/theme/black/edit.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral("qrc:///client/theme/white/edit.svg") : QStringLiteral("qrc:///client/theme/black/edit.svg"); } else if (providerId.contains(QStringLiteral("deck"), Qt::CaseInsensitive)) { - return QStringLiteral("qrc:///client/theme/black/deck.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral("qrc:///client/theme/white/deck.svg") : QStringLiteral("qrc:///client/theme/black/deck.svg"); } else if (providerId.contains(QStringLiteral("calendar"), Qt::CaseInsensitive)) { - return QStringLiteral("qrc:///client/theme/black/calendar.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral("qrc:///client/theme/white/calendar.svg") : QStringLiteral("qrc:///client/theme/black/calendar.svg"); } else if (providerId.contains(QStringLiteral("mail"), Qt::CaseInsensitive)) { - return QStringLiteral("qrc:///client/theme/black/email.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral("qrc:///client/theme/white/email.svg") : QStringLiteral("qrc:///client/theme/black/email.svg"); } else if (providerId.contains(QStringLiteral("comment"), Qt::CaseInsensitive)) { - return QStringLiteral("qrc:///client/theme/black/comment.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral("qrc:///client/theme/white/comment.svg") : QStringLiteral("qrc:///client/theme/black/comment.svg"); } return QStringLiteral("qrc:///client/theme/change.svg"); @@ -50,20 +51,20 @@ QString localIconPathFromIconPrefix(const QString &iconNameWithPrefix) { if (iconNameWithPrefix.contains(QStringLiteral("message"), Qt::CaseInsensitive) || iconNameWithPrefix.contains(QStringLiteral("talk"), Qt::CaseInsensitive)) { - return QStringLiteral(":/client/theme/black/wizard-talk.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral(":/client/theme/white/wizard-talk.svg") : QStringLiteral(":/client/theme/black/wizard-talk.svg"); } else if (iconNameWithPrefix.contains(QStringLiteral("folder"), Qt::CaseInsensitive)) { - return QStringLiteral(":/client/theme/black/folder.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral(":/client/theme/white/folder.svg") : QStringLiteral(":/client/theme/black/folder.svg"); } else if (iconNameWithPrefix.contains(QStringLiteral("deck"), Qt::CaseInsensitive)) { - return QStringLiteral(":/client/theme/black/deck.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral(":/client/theme/white/deck.svg") : QStringLiteral(":/client/theme/black/deck.svg"); } else if (iconNameWithPrefix.contains(QStringLiteral("contacts"), Qt::CaseInsensitive)) { - return QStringLiteral(":/client/theme/black/wizard-groupware.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral(":/client/theme/white/wizard-groupware.svg") : QStringLiteral(":/client/theme/black/wizard-groupware.svg"); } else if (iconNameWithPrefix.contains(QStringLiteral("calendar"), Qt::CaseInsensitive)) { - return QStringLiteral(":/client/theme/black/calendar.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral(":/client/theme/white/calendar.svg") : QStringLiteral(":/client/theme/black/calendar.svg"); } else if (iconNameWithPrefix.contains(QStringLiteral("mail"), Qt::CaseInsensitive)) { - return QStringLiteral(":/client/theme/black/email.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral(":/client/theme/white/email.svg") : QStringLiteral(":/client/theme/black/email.svg"); } - return QStringLiteral(":/client/theme/change.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral(":/client/theme/white/change.svg") : QStringLiteral(":/client/theme/change.svg"); } QString iconUrlForDefaultIconName(const QString &defaultIconName) @@ -78,17 +79,18 @@ QString iconUrlForDefaultIconName(const QString &defaultIconName) const auto parts = defaultIconName.split(QLatin1Char('-')); if (parts.size() > 1) { + const QString blackOrWhite = OCC::Systray::instance()->darkMode() ? QStringLiteral(":/client/theme/white/") : QStringLiteral(":/client/theme/black/"); + const QString blackIconFilePath = blackOrWhite + parts[1] + QStringLiteral(".svg"); + + if (QFile::exists(blackIconFilePath)) { + return blackIconFilePath; + } + const QString iconFilePath = QStringLiteral(":/client/theme/") + parts[1] + QStringLiteral(".svg"); if (QFile::exists(iconFilePath)) { return iconFilePath; } - - const QString blackIconFilePath = QStringLiteral(":/client/theme/black/") + parts[1] + QStringLiteral(".svg"); - - if (QFile::exists(blackIconFilePath)) { - return blackIconFilePath; - } } const auto iconNameFromIconPrefix = localIconPathFromIconPrefix(defaultIconName); @@ -98,7 +100,7 @@ QString iconUrlForDefaultIconName(const QString &defaultIconName) } } - return QStringLiteral(":/client/theme/change.svg"); + return OCC::Systray::instance()->darkMode() ? QStringLiteral(":/client/theme/white/change.svg") : QStringLiteral(":/client/theme/change.svg"); } QString generateUrlForThumbnail(const QString &thumbnailUrl, const QUrl &serverUrl) @@ -123,57 +125,59 @@ QString generateUrlForThumbnail(const QString &thumbnailUrl, const QUrl &serverU return thumbnailUrlCopy; } -QString generateUrlForIcon(const QString &fallackIcon, const QUrl &serverUrl) +QString generateUrlForIcon(const QString &fallbackIcon, const QUrl &serverUrl) { auto serverUrlCopy = serverUrl; - auto fallackIconCopy = fallackIcon; + auto fallbackIconCopy = fallbackIcon; - if (fallackIconCopy.startsWith(QLatin1Char('/')) || fallackIconCopy.startsWith(QLatin1Char('\\'))) { + if (fallbackIconCopy.startsWith(QLatin1Char('/')) || fallbackIconCopy.startsWith(QLatin1Char('\\'))) { // relative image resource URL, just needs some concatenation with current server URL // some icons may contain parameters after (?) - const QStringList fallackIconPathSplitted = - fallackIconCopy.contains(QLatin1Char('?')) ? fallackIconCopy.split(QLatin1Char('?')) : QStringList{fallackIconCopy}; - Q_ASSERT(!fallackIconPathSplitted.isEmpty()); - serverUrlCopy.setPath(fallackIconPathSplitted[0]); - fallackIconCopy = serverUrlCopy.toString(); - if (fallackIconPathSplitted.size() > 1) { - fallackIconCopy += QLatin1Char('?') + fallackIconPathSplitted[1]; + const QStringList fallbackIconPathSplitted = + fallbackIconCopy.contains(QLatin1Char('?')) ? fallbackIconCopy.split(QLatin1Char('?')) : QStringList{fallbackIconCopy}; + Q_ASSERT(!fallbackIconPathSplitted.isEmpty()); + serverUrlCopy.setPath(fallbackIconPathSplitted[0]); + fallbackIconCopy = serverUrlCopy.toString(); + if (fallbackIconPathSplitted.size() > 1) { + fallbackIconCopy += QLatin1Char('?') + fallbackIconPathSplitted[1]; } - } else if (!fallackIconCopy.isEmpty()) { + } else if (!fallbackIconCopy.isEmpty()) { // could be one of names for standard icons (e.g. icon-mail) - const auto defaultIconUrl = iconUrlForDefaultIconName(fallackIconCopy); + const auto defaultIconUrl = iconUrlForDefaultIconName(fallbackIconCopy); if (!defaultIconUrl.isEmpty()) { - fallackIconCopy = defaultIconUrl; + fallbackIconCopy = defaultIconUrl; } } - return fallackIconCopy; + return fallbackIconCopy; } -QString iconsFromThumbnailAndFallbackIcon(const QString &thumbnailUrl, const QString &fallackIcon, const QUrl &serverUrl) +QString iconsFromThumbnailAndFallbackIcon(const QString &thumbnailUrl, const QString &fallbackIcon, const QUrl &serverUrl) { - if (thumbnailUrl.isEmpty() && fallackIcon.isEmpty()) { + if (thumbnailUrl.isEmpty() && fallbackIcon.isEmpty()) { return {}; } if (serverUrl.isEmpty()) { - const QStringList listImages = {thumbnailUrl, fallackIcon}; + const QStringList listImages = {thumbnailUrl, fallbackIcon}; return listImages.join(QLatin1Char(';')); } const auto urlForThumbnail = generateUrlForThumbnail(thumbnailUrl, serverUrl); - const auto urlForFallackIcon = generateUrlForIcon(fallackIcon, serverUrl); + const auto urlForFallbackIcon = generateUrlForIcon(fallbackIcon, serverUrl); - if (urlForThumbnail.isEmpty() && !urlForFallackIcon.isEmpty()) { - return urlForFallackIcon; + qDebug() << "SEARCH" << urlForThumbnail << urlForFallbackIcon; + + if (urlForThumbnail.isEmpty() && !urlForFallbackIcon.isEmpty()) { + return urlForFallbackIcon; } - if (!urlForThumbnail.isEmpty() && urlForFallackIcon.isEmpty()) { + if (!urlForThumbnail.isEmpty() && urlForFallbackIcon.isEmpty()) { return urlForThumbnail; } - const QStringList listImages{urlForThumbnail, urlForFallackIcon}; + const QStringList listImages{urlForThumbnail, urlForFallbackIcon}; return listImages.join(QLatin1Char(';')); } diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index 1ebee172ac..8916cba2f9 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -899,4 +899,16 @@ QColor Theme::errorBoxBorderColor() const return QColor{"black"}; } +QPalette Theme::systemPalette() +{ + if(!_guiAppInstance) { + const auto ptr = qobject_cast(QGuiApplication::instance()); + if(ptr) { + _guiAppInstance.reset(ptr); + connect(ptr, &QGuiApplication::paletteChanged, this, &Theme::systemPaletteChanged); + } + } + return QGuiApplication::palette(); +} + } // end namespace client diff --git a/src/libsync/theme.h b/src/libsync/theme.h index 11568bdf03..d6c38aacb0 100644 --- a/src/libsync/theme.h +++ b/src/libsync/theme.h @@ -17,6 +17,8 @@ #include #include +#include +#include #include "syncresult.h" class QString; @@ -24,7 +26,6 @@ class QObject; class QPixmap; class QColor; class QPaintDevice; -class QPalette; namespace OCC { @@ -66,6 +67,8 @@ class OWNCLOUDSYNC_EXPORT Theme : public QObject Q_PROPERTY(QColor errorBoxTextColor READ errorBoxTextColor CONSTANT) Q_PROPERTY(QColor errorBoxBackgroundColor READ errorBoxBackgroundColor CONSTANT) Q_PROPERTY(QColor errorBoxBorderColor READ errorBoxBorderColor CONSTANT) + + Q_PROPERTY(QPalette systemPalette READ systemPalette NOTIFY systemPaletteChanged) public: enum CustomMediaType { oCSetupTop, // ownCloud connect page @@ -590,6 +593,8 @@ public: static constexpr const char *themePrefix = ":/client/theme/"; + QPalette systemPalette(); + protected: #ifndef TOKEN_AUTH_ONLY QIcon themeIcon(const QString &name, bool sysTray = false) const; @@ -606,6 +611,7 @@ protected: signals: void systrayUseMonoIconsChanged(bool); + void systemPaletteChanged(const QPalette &palette); private: Theme(Theme const &); @@ -613,6 +619,7 @@ private: static Theme *_instance; bool _mono = false; + QScopedPointer _guiAppInstance; #ifndef TOKEN_AUTH_ONLY mutable QHash _iconCache; #endif diff --git a/theme.qrc.in b/theme.qrc.in index e66e79bc20..3823b8da15 100644 --- a/theme.qrc.in +++ b/theme.qrc.in @@ -92,6 +92,7 @@ theme/colored/folder@2x.png theme/black/control-next.svg theme/black/control-prev.svg + theme/black/settings.svg theme/black/state-error.svg theme/black/state-error-16.png theme/black/state-offline.svg @@ -112,10 +113,21 @@ theme/black/state-warning-64.png theme/black/state-warning-128.png theme/black/state-warning-256.png + theme/white/bell.svg + theme/white/calendar.svg + theme/white/change.svg + theme/white/close.svg + theme/white/confirm.svg theme/white/control-next.svg theme/white/control-prev.svg + theme/white/comment.svg + theme/white/deck.svg + theme/white/edit.svg + theme/white/email.svg + theme/white/settings.svg theme/white/state-error.svg theme/white/state-error-16.png + theme/white/state-info.svg theme/white/state-offline.svg theme/white/state-offline-16.png theme/white/state-offline-32.png @@ -136,6 +148,7 @@ theme/white/state-warning-256.png theme/white/wizard-files.png theme/white/wizard-files@2x.png + theme/white/wizard-groupware.svg theme/white/wizard-groupware.png theme/white/wizard-groupware@2x.png theme/white/wizard-nextcloud.png @@ -183,6 +196,8 @@ theme/black/deck.svg theme/black/state-info.svg theme/close.svg + theme/black/close.svg + theme/white/close.svg theme/files.svg theme/public.svg theme/settings.svg diff --git a/theme/Style/Style.qml b/theme/Style/Style.qml index d25f7c6f48..132ff7a50b 100644 --- a/theme/Style/Style.qml +++ b/theme/Style/Style.qml @@ -8,15 +8,18 @@ QtObject { readonly property int pixelSize: fontMetrics.font.pixelSize // Colors - property color ncBlue: Theme.wizardHeaderBackgroundColor - property color ncTextColor: Theme.wizardHeaderTitleColor - property color lightHover: "#f7f7f7" - property color menuBorder: "#bdbdbd" + readonly property color ncBlue: Theme.wizardHeaderBackgroundColor + readonly property color ncTextColor: Theme.systemPalette.windowText + readonly property color ncSecondaryTextColor: "#808080" + readonly property color ncHeaderTextColor: "white" + readonly property color lightHover: Theme.systemPalette.highlight + readonly property color menuBorder: Systray.darkMode ? Qt.lighter(backgroundColor, 3) : Qt.darker(backgroundColor, 1.5) + readonly property color backgroundColor: Theme.systemPalette.base // ErrorBox colors - property color errorBoxTextColor: Theme.errorBoxTextColor - property color errorBoxBackgroundColor: Theme.errorBoxBackgroundColor - property color errorBoxBorderColor: Theme.errorBoxBorderColor + readonly property color errorBoxTextColor: Theme.errorBoxTextColor + readonly property color errorBoxBackgroundColor: Theme.errorBoxBackgroundColor + readonly property color errorBoxBorderColor: Theme.errorBoxBorderColor // Fonts // We are using pixel size because this is cross platform comparable, point size isn't @@ -79,8 +82,6 @@ QtObject { readonly property int unifiedSearchResulIconLeftMargin: 12 readonly property int unifiedSearchResulTitleFontSize: topLinePixelSize readonly property int unifiedSearchResulSublineFontSize: subLinePixelSize - readonly property string unifiedSearchResulTitleColor: "black" - readonly property string unifiedSearchResulSublineColor: "grey" readonly property var fontMetrics: FontMetrics {} diff --git a/theme/black/change.svg b/theme/black/change.svg new file mode 100644 index 0000000000..12071422b7 --- /dev/null +++ b/theme/black/change.svg @@ -0,0 +1 @@ + diff --git a/theme/black/close.svg b/theme/black/close.svg new file mode 100644 index 0000000000..30de70b7c8 --- /dev/null +++ b/theme/black/close.svg @@ -0,0 +1 @@ + diff --git a/theme/black/confirm.svg b/theme/black/confirm.svg new file mode 100644 index 0000000000..42e302c4a4 --- /dev/null +++ b/theme/black/confirm.svg @@ -0,0 +1 @@ + diff --git a/theme/black/settings.svg b/theme/black/settings.svg new file mode 100644 index 0000000000..f53024e884 --- /dev/null +++ b/theme/black/settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/theme/white/activity.svg b/theme/white/activity.svg new file mode 100644 index 0000000000..a33ba094df --- /dev/null +++ b/theme/white/activity.svg @@ -0,0 +1,2 @@ + + diff --git a/theme/white/bell.svg b/theme/white/bell.svg new file mode 100644 index 0000000000..e26a3fd7d0 --- /dev/null +++ b/theme/white/bell.svg @@ -0,0 +1,39 @@ + + + + + + diff --git a/theme/white/calendar.svg b/theme/white/calendar.svg new file mode 100644 index 0000000000..68249fa97d --- /dev/null +++ b/theme/white/calendar.svg @@ -0,0 +1 @@ + diff --git a/theme/white/change.svg b/theme/white/change.svg new file mode 100644 index 0000000000..4c6f3f1080 --- /dev/null +++ b/theme/white/change.svg @@ -0,0 +1 @@ + diff --git a/theme/white/close.svg b/theme/white/close.svg new file mode 100644 index 0000000000..b2f80dc5df --- /dev/null +++ b/theme/white/close.svg @@ -0,0 +1 @@ + diff --git a/theme/white/comment.svg b/theme/white/comment.svg new file mode 100644 index 0000000000..76edac5a33 --- /dev/null +++ b/theme/white/comment.svg @@ -0,0 +1 @@ + diff --git a/theme/white/confirm.svg b/theme/white/confirm.svg new file mode 100644 index 0000000000..98a41adefe --- /dev/null +++ b/theme/white/confirm.svg @@ -0,0 +1 @@ + diff --git a/theme/white/deck.svg b/theme/white/deck.svg new file mode 100644 index 0000000000..232d9b932d --- /dev/null +++ b/theme/white/deck.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/theme/white/edit.svg b/theme/white/edit.svg new file mode 100644 index 0000000000..4ea4ff3183 --- /dev/null +++ b/theme/white/edit.svg @@ -0,0 +1,47 @@ + + + + + + + + + + diff --git a/theme/white/email.svg b/theme/white/email.svg new file mode 100644 index 0000000000..0be0af3177 --- /dev/null +++ b/theme/white/email.svg @@ -0,0 +1 @@ + diff --git a/theme/white/settings.svg b/theme/white/settings.svg new file mode 100644 index 0000000000..230b9326bc --- /dev/null +++ b/theme/white/settings.svg @@ -0,0 +1 @@ + diff --git a/theme/white/state-info.svg b/theme/white/state-info.svg new file mode 100644 index 0000000000..d644e9bada --- /dev/null +++ b/theme/white/state-info.svg @@ -0,0 +1 @@ +