Style.qml 7.7 KB

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