Style.qml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. pragma Singleton
  2. import QtQuick 2.15
  3. import com.nextcloud.desktopclient 1.0
  4. QtObject {
  5. readonly property int pixelSize: fontMetrics.font.pixelSize
  6. readonly property bool darkMode: Theme.darkMode
  7. // Colors
  8. readonly property color ncBlue: Theme.wizardHeaderBackgroundColor
  9. readonly property color ncTextColor: Theme.systemPalette.windowText
  10. readonly property color ncSecondaryTextColor: "#808080"
  11. readonly property color ncHeaderTextColor: "white"
  12. readonly property color lightHover: Theme.darkMode ? Qt.lighter(backgroundColor, 2) : Qt.darker(backgroundColor, 1.05)
  13. readonly property color menuBorder: Theme.darkMode ? Qt.lighter(backgroundColor, 2.5) : Qt.darker(backgroundColor, 1.5)
  14. readonly property color backgroundColor: Theme.systemPalette.base
  15. readonly property color buttonBackgroundColor: Theme.systemPalette.button
  16. readonly property color positiveColor: Qt.rgba(0.38, 0.74, 0.38, 1)
  17. readonly property color currentUserHeaderColor: UserModel.currentUser ? UserModel.currentUser.headerColor : ncBlue
  18. readonly property color currentUserHeaderTextColor: UserModel.currentUser ? UserModel.currentUser.headerTextColor : ncHeaderTextColor
  19. readonly property color adjustedCurrentUserHeaderColor: Theme.darkMode ? Qt.lighter(currentUserHeaderColor, 2)
  20. : Qt.darker(currentUserHeaderColor, 1.5)
  21. // ErrorBox colors
  22. readonly property color errorBoxBackgroundColor: Qt.rgba(0.89, 0.18, 0.18, 1)
  23. readonly property int errorBoxStripeWidth: 4
  24. // Fonts
  25. // We are using pixel size because this is cross platform comparable, point size isn't
  26. readonly property int topLinePixelSize: pixelSize
  27. readonly property int subLinePixelSize: topLinePixelSize - 2
  28. // Dimensions and sizes
  29. property int trayWindowWidth: variableSize(400)
  30. property int trayWindowHeight: variableSize(510)
  31. property int trayWindowRadius: 10
  32. property int trayWindowBorderWidth: variableSize(1)
  33. property int trayWindowHeaderHeight: variableSize(60)
  34. property int trayHorizontalMargin: 10
  35. property int trayModalWidth: 380
  36. property int trayModalHeight: 490
  37. property int trayListItemIconSize: accountAvatarSize
  38. property int trayDrawerMargin: trayWindowHeaderHeight
  39. property real thumbnailImageSizeReduction: 0.2 // We reserve some space within the thumbnail "item", here about 20%.
  40. // This is because we need to also add the added/modified icon and we
  41. // want them to fit within the general icon size. We also need to know
  42. // this amount to properly center the sync status icon to the thumbnail
  43. // images, which will work so long as the thumbnails are left aligned
  44. property int standardSpacing: 10
  45. property int smallSpacing: 5
  46. property int extraSmallSpacing: 2
  47. property int iconButtonWidth: 36
  48. property int standardPrimaryButtonHeight: 40
  49. property int minActivityHeight: variableSize(40)
  50. property int currentAccountButtonWidth: 220
  51. property int currentAccountButtonRadius: 2
  52. property int currentAccountLabelWidth: 128
  53. property int normalBorderWidth: 1
  54. property int thickBorderWidth: 2
  55. property int veryRoundedButtonRadius: 100
  56. property int mediumRoundedButtonRadius: 8
  57. property int slightlyRoundedButtonRadius: 5
  58. property double hoverOpacity: 0.7
  59. property url stateOnlineImageSource: Theme.stateOnlineImageSource
  60. property url stateOfflineImageSource: Theme.stateOfflineImageSource
  61. property int accountAvatarSize: (trayWindowHeaderHeight - 16)
  62. property int accountAvatarStateIndicatorSize: 16
  63. property int folderStateIndicatorSize: 16
  64. property int accountLabelWidth: 128
  65. property int accountDropDownCaretSize: 20
  66. property int accountDropDownCaretMargin: 8
  67. property int addAccountButtonHeight: 50
  68. property int headerButtonIconSize: 32
  69. property int activityLabelBaseWidth: 240
  70. property int talkReplyTextFieldPreferredHeight: 34
  71. property int talkReplyTextFieldPreferredWidth: 250
  72. property int activityItemActionPrimaryButtonMinWidth: 100
  73. property int activityItemActionSecondaryButtonMinWidth: 80
  74. property int callNotificationPrimaryButtonMinWidth: 100
  75. property int callNotificationPrimaryButtonMinHeight: 40
  76. property int roundButtonBackgroundVerticalMargins: 10
  77. property int roundedButtonBackgroundVerticalMargins: 5
  78. property int userStatusEmojiSize: 8
  79. property int userStatusSpacing: trayHorizontalMargin
  80. property int userStatusAnchorsMargin: 2
  81. property int accountServerAnchorsMargin: 10
  82. property int accountLabelsSpacing: 4
  83. property int accountLabelsAnchorsMargin: 7
  84. property int accountLabelsLayoutMargin: 12
  85. property int accountLabelsLayoutTopMargin: 10
  86. // Visual behaviour
  87. property bool hoverEffectsEnabled: true
  88. // unified search constants
  89. readonly property int unifiedSearchItemHeight: trayWindowHeaderHeight
  90. readonly property int unifiedSearchResultTextLeftMargin: 18
  91. readonly property int unifiedSearchResultTextRightMargin: 16
  92. readonly property int unifiedSearchResultIconWidth: trayListItemIconSize * (1 - thumbnailImageSizeReduction)
  93. readonly property int unifiedSearchResultSmallIconWidth: trayListItemIconSize * (1 - thumbnailImageSizeReduction * 2)
  94. readonly property int unifiedSearchResultIconLeftMargin: 12
  95. readonly property int unifiedSearchResultTitleFontSize: topLinePixelSize
  96. readonly property int unifiedSearchResultSublineFontSize: subLinePixelSize
  97. readonly property int unifiedSearchResultSectionItemLeftPadding: 16
  98. readonly property int unifiedSearchResultSectionItemVerticalPadding: 8
  99. readonly property int unifiedSearchResultNothingFoundHorizontalMargin: 10
  100. readonly property int radioButtonCustomMarginLeftInner: 4
  101. readonly property int radioButtonCustomMarginLeftOuter: 5
  102. readonly property int radioButtonCustomRadius: 9
  103. readonly property int radioButtonIndicatorSize: 16
  104. readonly property var fontMetrics: FontMetrics {}
  105. readonly property int bigFontPixelSizeResolveConflictsDialog: 20
  106. readonly property int fontPixelSizeResolveConflictsDialog: 15
  107. readonly property int minimumWidthResolveConflictsDialog: 600
  108. readonly property int minimumHeightResolveConflictsDialog: 800
  109. readonly property int activityContentSpace: 4
  110. readonly property double smallIconScaleFactor: 0.6
  111. readonly property double trayFolderListButtonWidthScaleFactor: 1.75
  112. readonly property int trayFolderStatusIndicatorSizeOffset: 2
  113. readonly property double trayFolderStatusIndicatorRadiusFactor: 0.5
  114. readonly property double trayFolderStatusIndicatorMouseHoverOpacityFactor: 0.2
  115. readonly property double trayWindowMenuWidthFactor: 0.35
  116. readonly property int trayWindowMenuOffsetX: -2
  117. readonly property int trayWindowMenuOffsetY: 2
  118. readonly property int trayWindowMenuEntriesMargin: 6
  119. // animation durations
  120. readonly property int shortAnimationDuration: 200
  121. readonly property int veryLongAnimationDuration: 3000
  122. function variableSize(size) {
  123. return size * (1 + Math.min(pixelSize / 100, 1));
  124. }
  125. }