2020-01-19 22:13:12 +03:00
|
|
|
pragma Singleton
|
|
|
|
|
2021-10-14 14:07:27 +03:00
|
|
|
import QtQuick 2.15
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2020-10-21 14:46:51 +03:00
|
|
|
import com.nextcloud.desktopclient 1.0
|
|
|
|
|
2021-10-19 14:33:32 +03:00
|
|
|
QtObject {
|
2021-10-14 14:07:27 +03:00
|
|
|
readonly property int pixelSize: fontMetrics.font.pixelSize
|
2022-07-11 18:52:31 +03:00
|
|
|
readonly property bool darkMode: Theme.darkMode
|
2021-10-14 14:07:27 +03:00
|
|
|
|
2020-01-19 22:13:12 +03:00
|
|
|
// Colors
|
2022-02-04 05:39:38 +03:00
|
|
|
readonly property color ncBlue: Theme.wizardHeaderBackgroundColor
|
|
|
|
readonly property color ncTextColor: Theme.systemPalette.windowText
|
|
|
|
readonly property color ncSecondaryTextColor: "#808080"
|
|
|
|
readonly property color ncHeaderTextColor: "white"
|
2022-03-21 19:34:21 +03:00
|
|
|
readonly property color lightHover: Theme.darkMode ? Qt.lighter(backgroundColor, 2) : Qt.darker(backgroundColor, 1.05)
|
2022-06-08 03:30:22 +03:00
|
|
|
readonly property color menuBorder: Theme.darkMode ? Qt.lighter(backgroundColor, 2.5) : Qt.darker(backgroundColor, 1.5)
|
2022-02-04 05:39:38 +03:00
|
|
|
readonly property color backgroundColor: Theme.systemPalette.base
|
2022-06-08 03:30:22 +03:00
|
|
|
readonly property color buttonBackgroundColor: Theme.systemPalette.button
|
2023-05-10 06:22:37 +03:00
|
|
|
readonly property color positiveColor: Qt.rgba(0.38, 0.74, 0.38, 1)
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2022-10-20 14:41:25 +03:00
|
|
|
readonly property color currentUserHeaderColor: UserModel.currentUser ? UserModel.currentUser.headerColor : ncBlue
|
|
|
|
readonly property color currentUserHeaderTextColor: UserModel.currentUser ? UserModel.currentUser.headerTextColor : ncHeaderTextColor
|
|
|
|
readonly property color adjustedCurrentUserHeaderColor: Theme.darkMode ? Qt.lighter(currentUserHeaderColor, 2)
|
|
|
|
: Qt.darker(currentUserHeaderColor, 1.5)
|
|
|
|
|
2021-09-09 14:33:57 +03:00
|
|
|
// ErrorBox colors
|
2022-09-26 14:12:59 +03:00
|
|
|
readonly property color errorBoxBackgroundColor: Qt.rgba(0.89, 0.18, 0.18, 1)
|
|
|
|
readonly property int errorBoxStripeWidth: 4
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2020-01-19 22:13:12 +03:00
|
|
|
// Fonts
|
|
|
|
// We are using pixel size because this is cross platform comparable, point size isn't
|
2021-10-14 14:07:27 +03:00
|
|
|
readonly property int topLinePixelSize: pixelSize
|
|
|
|
readonly property int subLinePixelSize: topLinePixelSize - 2
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
// Dimensions and sizes
|
2021-10-14 14:07:27 +03:00
|
|
|
property int trayWindowWidth: variableSize(400)
|
|
|
|
property int trayWindowHeight: variableSize(510)
|
2020-01-19 22:13:12 +03:00
|
|
|
property int trayWindowRadius: 10
|
2022-04-22 01:32:01 +03:00
|
|
|
property int trayWindowBorderWidth: variableSize(1)
|
2021-10-14 14:07:27 +03:00
|
|
|
property int trayWindowHeaderHeight: variableSize(60)
|
2022-01-20 14:54:36 +03:00
|
|
|
property int trayHorizontalMargin: 10
|
2022-07-20 20:56:57 +03:00
|
|
|
property int trayModalWidth: 380
|
|
|
|
property int trayModalHeight: 490
|
2022-01-20 14:54:36 +03:00
|
|
|
property int trayListItemIconSize: accountAvatarSize
|
2022-11-09 16:07:51 +03:00
|
|
|
property int trayDrawerMargin: trayWindowHeaderHeight
|
2022-04-18 20:24:31 +03:00
|
|
|
property real thumbnailImageSizeReduction: 0.2 // We reserve some space within the thumbnail "item", here about 20%.
|
|
|
|
// This is because we need to also add the added/modified icon and we
|
|
|
|
// want them to fit within the general icon size. We also need to know
|
|
|
|
// this amount to properly center the sync status icon to the thumbnail
|
|
|
|
// images, which will work so long as the thumbnails are left aligned
|
|
|
|
|
|
|
|
property int standardSpacing: 10
|
2022-07-20 20:56:57 +03:00
|
|
|
property int smallSpacing: 5
|
2023-04-21 18:48:44 +03:00
|
|
|
property int extraSmallSpacing: 2
|
2022-04-18 20:24:31 +03:00
|
|
|
|
2022-09-15 19:18:12 +03:00
|
|
|
property int iconButtonWidth: 36
|
2022-11-18 20:18:02 +03:00
|
|
|
property int standardPrimaryButtonHeight: 40
|
2022-09-15 19:18:12 +03:00
|
|
|
|
2022-04-18 20:24:31 +03:00
|
|
|
property int minActivityHeight: variableSize(40)
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
property int currentAccountButtonWidth: 220
|
|
|
|
property int currentAccountButtonRadius: 2
|
|
|
|
property int currentAccountLabelWidth: 128
|
|
|
|
|
2022-06-08 03:30:22 +03:00
|
|
|
property int normalBorderWidth: 1
|
|
|
|
property int thickBorderWidth: 2
|
|
|
|
property int veryRoundedButtonRadius: 100
|
|
|
|
property int mediumRoundedButtonRadius: 8
|
|
|
|
property int slightlyRoundedButtonRadius: 5
|
|
|
|
property double hoverOpacity: 0.7
|
|
|
|
|
2020-11-23 08:45:26 +03:00
|
|
|
property url stateOnlineImageSource: Theme.stateOnlineImageSource
|
|
|
|
property url stateOfflineImageSource: Theme.stateOfflineImageSource
|
|
|
|
|
2020-01-19 22:13:12 +03:00
|
|
|
property int accountAvatarSize: (trayWindowHeaderHeight - 16)
|
|
|
|
property int accountAvatarStateIndicatorSize: 16
|
2021-03-16 22:24:11 +03:00
|
|
|
property int folderStateIndicatorSize: 16
|
2020-01-19 22:40:49 +03:00
|
|
|
property int accountLabelWidth: 128
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
property int accountDropDownCaretSize: 20
|
|
|
|
property int accountDropDownCaretMargin: 8
|
|
|
|
|
|
|
|
property int addAccountButtonHeight: 50
|
|
|
|
|
2020-06-15 20:05:21 +03:00
|
|
|
property int headerButtonIconSize: 32
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
property int activityLabelBaseWidth: 240
|
2022-01-04 17:28:26 +03:00
|
|
|
|
2022-05-19 18:01:54 +03:00
|
|
|
property int talkReplyTextFieldPreferredHeight: 34
|
|
|
|
property int talkReplyTextFieldPreferredWidth: 250
|
|
|
|
|
2022-01-04 17:28:26 +03:00
|
|
|
property int activityItemActionPrimaryButtonMinWidth: 100
|
|
|
|
property int activityItemActionSecondaryButtonMinWidth: 80
|
|
|
|
|
2022-04-22 01:32:01 +03:00
|
|
|
property int callNotificationPrimaryButtonMinWidth: 100
|
|
|
|
property int callNotificationPrimaryButtonMinHeight: 40
|
|
|
|
|
2022-01-04 17:28:26 +03:00
|
|
|
property int roundButtonBackgroundVerticalMargins: 10
|
|
|
|
property int roundedButtonBackgroundVerticalMargins: 5
|
2022-08-09 00:40:19 +03:00
|
|
|
|
2021-05-18 21:45:34 +03:00
|
|
|
property int userStatusEmojiSize: 8
|
2022-01-20 14:54:36 +03:00
|
|
|
property int userStatusSpacing: trayHorizontalMargin
|
2021-05-18 23:28:59 +03:00
|
|
|
property int userStatusAnchorsMargin: 2
|
|
|
|
property int accountServerAnchorsMargin: 10
|
|
|
|
property int accountLabelsSpacing: 4
|
|
|
|
property int accountLabelsAnchorsMargin: 7
|
2021-05-25 23:17:33 +03:00
|
|
|
property int accountLabelsLayoutMargin: 12
|
|
|
|
property int accountLabelsLayoutTopMargin: 10
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
// Visual behaviour
|
|
|
|
property bool hoverEffectsEnabled: true
|
2021-09-09 14:33:57 +03:00
|
|
|
|
|
|
|
// unified search constants
|
|
|
|
readonly property int unifiedSearchItemHeight: trayWindowHeaderHeight
|
|
|
|
readonly property int unifiedSearchResultTextLeftMargin: 18
|
|
|
|
readonly property int unifiedSearchResultTextRightMargin: 16
|
2022-08-09 00:40:19 +03:00
|
|
|
readonly property int unifiedSearchResultIconWidth: trayListItemIconSize * (1 - thumbnailImageSizeReduction)
|
|
|
|
readonly property int unifiedSearchResultSmallIconWidth: trayListItemIconSize * (1 - thumbnailImageSizeReduction * 2)
|
2022-07-11 19:56:35 +03:00
|
|
|
readonly property int unifiedSearchResultIconLeftMargin: 12
|
|
|
|
readonly property int unifiedSearchResultTitleFontSize: topLinePixelSize
|
|
|
|
readonly property int unifiedSearchResultSublineFontSize: subLinePixelSize
|
|
|
|
readonly property int unifiedSearchResultSectionItemLeftPadding: 16
|
|
|
|
readonly property int unifiedSearchResultSectionItemVerticalPadding: 8
|
|
|
|
readonly property int unifiedSearchResultNothingFoundHorizontalMargin: 10
|
2021-10-14 14:07:27 +03:00
|
|
|
|
2023-04-19 21:28:07 +03:00
|
|
|
readonly property int radioButtonCustomMarginLeftInner: 4
|
|
|
|
readonly property int radioButtonCustomMarginLeftOuter: 5
|
|
|
|
readonly property int radioButtonCustomRadius: 9
|
|
|
|
readonly property int radioButtonIndicatorSize: 16
|
|
|
|
|
2021-10-19 14:33:32 +03:00
|
|
|
readonly property var fontMetrics: FontMetrics {}
|
|
|
|
|
2022-05-19 14:05:30 +03:00
|
|
|
readonly property int activityContentSpace: 4
|
|
|
|
|
2023-04-21 18:48:44 +03:00
|
|
|
readonly property double smallIconScaleFactor: 0.6
|
|
|
|
|
|
|
|
readonly property double trayFolderListButtonWidthScaleFactor: 1.75
|
|
|
|
readonly property int trayFolderStatusIndicatorSizeOffset: 2
|
|
|
|
readonly property double trayFolderStatusIndicatorRadiusFactor: 0.5
|
|
|
|
readonly property double trayFolderStatusIndicatorMouseHoverOpacityFactor: 0.2
|
|
|
|
|
|
|
|
readonly property double trayWindowMenuWidthFactor: 0.35
|
|
|
|
|
|
|
|
readonly property int trayWindowMenuOffsetX: -2
|
|
|
|
readonly property int trayWindowMenuOffsetY: 2
|
|
|
|
|
|
|
|
readonly property int trayWindowMenuEntriesMargin: 6
|
|
|
|
|
2023-05-10 07:38:27 +03:00
|
|
|
// animation durations
|
|
|
|
readonly property int shortAnimationDuration: 200
|
|
|
|
readonly property int veryLongAnimationDuration: 3000
|
|
|
|
|
2021-10-14 14:07:27 +03:00
|
|
|
function variableSize(size) {
|
2022-08-09 00:40:19 +03:00
|
|
|
return size * (1 + Math.min(pixelSize / 100, 1));
|
2021-10-14 14:07:27 +03:00
|
|
|
}
|
2020-01-19 22:13:12 +03:00
|
|
|
}
|