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
|
|
|
|
|
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)
|
|
|
|
readonly property color menuBorder: ncSecondaryTextColor
|
2022-02-04 05:39:38 +03:00
|
|
|
readonly property color backgroundColor: Theme.systemPalette.base
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2021-09-09 14:33:57 +03:00
|
|
|
// ErrorBox colors
|
2022-02-04 05:39:38 +03:00
|
|
|
readonly property color errorBoxTextColor: Theme.errorBoxTextColor
|
|
|
|
readonly property color errorBoxBackgroundColor: Theme.errorBoxBackgroundColor
|
|
|
|
readonly property color errorBoxBorderColor: Theme.errorBoxBorderColor
|
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
|
|
|
|
property int trayWindowBorderWidth: 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
|
|
|
|
property int trayListItemIconSize: accountAvatarSize
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
property int currentAccountButtonWidth: 220
|
|
|
|
property int currentAccountButtonRadius: 2
|
|
|
|
property int currentAccountLabelWidth: 128
|
|
|
|
|
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
|
|
|
|
|
|
|
property int activityItemActionPrimaryButtonMinWidth: 100
|
|
|
|
property int activityItemActionSecondaryButtonMinWidth: 80
|
|
|
|
|
|
|
|
property int roundButtonBackgroundVerticalMargins: 10
|
|
|
|
property int roundedButtonBackgroundVerticalMargins: 5
|
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
|
|
|
|
readonly property int unifiedSearchResulIconWidth: 24
|
|
|
|
readonly property int unifiedSearchResulIconLeftMargin: 12
|
|
|
|
readonly property int unifiedSearchResulTitleFontSize: topLinePixelSize
|
|
|
|
readonly property int unifiedSearchResulSublineFontSize: subLinePixelSize
|
2021-10-14 14:07:27 +03:00
|
|
|
|
2021-10-19 14:33:32 +03:00
|
|
|
readonly property var fontMetrics: FontMetrics {}
|
|
|
|
|
2021-10-14 14:07:27 +03:00
|
|
|
function variableSize(size) {
|
|
|
|
return size * (1 + Math.min(pixelSize / 100, 1));
|
|
|
|
}
|
2020-01-19 22:13:12 +03:00
|
|
|
}
|