Style.qml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 currentUserHeaderColor: UserModel.currentUser ? UserModel.currentUser.headerColor : ncBlue
  17. readonly property color currentUserHeaderTextColor: UserModel.currentUser ? UserModel.currentUser.headerTextColor : ncHeaderTextColor
  18. readonly property color adjustedCurrentUserHeaderColor: Theme.darkMode ? Qt.lighter(currentUserHeaderColor, 2)
  19. : Qt.darker(currentUserHeaderColor, 1.5)
  20. // ErrorBox colors
  21. readonly property color errorBoxBackgroundColor: Qt.rgba(0.89, 0.18, 0.18, 1)
  22. readonly property int errorBoxStripeWidth: 4
  23. // Fonts
  24. // We are using pixel size because this is cross platform comparable, point size isn't
  25. readonly property int topLinePixelSize: pixelSize
  26. readonly property int subLinePixelSize: topLinePixelSize - 2
  27. // Dimensions and sizes
  28. property int trayWindowWidth: variableSize(400)
  29. property int trayWindowHeight: variableSize(510)
  30. property int trayWindowRadius: 10
  31. property int trayWindowBorderWidth: variableSize(1)
  32. property int trayWindowHeaderHeight: variableSize(60)
  33. property int trayHorizontalMargin: 10
  34. property int trayModalWidth: 380
  35. property int trayModalHeight: 490
  36. property int trayListItemIconSize: accountAvatarSize
  37. property int trayDrawerMargin: trayWindowHeaderHeight
  38. property real thumbnailImageSizeReduction: 0.2 // We reserve some space within the thumbnail "item", here about 20%.
  39. // This is because we need to also add the added/modified icon and we
  40. // want them to fit within the general icon size. We also need to know
  41. // this amount to properly center the sync status icon to the thumbnail
  42. // images, which will work so long as the thumbnails are left aligned
  43. property int standardSpacing: 10
  44. property int smallSpacing: 5
  45. property int iconButtonWidth: 36
  46. property int standardPrimaryButtonHeight: 40
  47. property int minActivityHeight: variableSize(40)
  48. property int currentAccountButtonWidth: 220
  49. property int currentAccountButtonRadius: 2
  50. property int currentAccountLabelWidth: 128
  51. property int normalBorderWidth: 1
  52. property int thickBorderWidth: 2
  53. property int veryRoundedButtonRadius: 100
  54. property int mediumRoundedButtonRadius: 8
  55. property int slightlyRoundedButtonRadius: 5
  56. property double hoverOpacity: 0.7
  57. property url stateOnlineImageSource: Theme.stateOnlineImageSource
  58. property url stateOfflineImageSource: Theme.stateOfflineImageSource
  59. property int accountAvatarSize: (trayWindowHeaderHeight - 16)
  60. property int accountAvatarStateIndicatorSize: 16
  61. property int folderStateIndicatorSize: 16
  62. property int accountLabelWidth: 128
  63. property int accountDropDownCaretSize: 20
  64. property int accountDropDownCaretMargin: 8
  65. property int addAccountButtonHeight: 50
  66. property int headerButtonIconSize: 32
  67. property int activityLabelBaseWidth: 240
  68. property int talkReplyTextFieldPreferredHeight: 34
  69. property int talkReplyTextFieldPreferredWidth: 250
  70. property int activityItemActionPrimaryButtonMinWidth: 100
  71. property int activityItemActionSecondaryButtonMinWidth: 80
  72. property int callNotificationPrimaryButtonMinWidth: 100
  73. property int callNotificationPrimaryButtonMinHeight: 40
  74. property int roundButtonBackgroundVerticalMargins: 10
  75. property int roundedButtonBackgroundVerticalMargins: 5
  76. property int userStatusEmojiSize: 8
  77. property int userStatusSpacing: trayHorizontalMargin
  78. property int userStatusAnchorsMargin: 2
  79. property int accountServerAnchorsMargin: 10
  80. property int accountLabelsSpacing: 4
  81. property int accountLabelsAnchorsMargin: 7
  82. property int accountLabelsLayoutMargin: 12
  83. property int accountLabelsLayoutTopMargin: 10
  84. // Visual behaviour
  85. property bool hoverEffectsEnabled: true
  86. // unified search constants
  87. readonly property int unifiedSearchItemHeight: trayWindowHeaderHeight
  88. readonly property int unifiedSearchResultTextLeftMargin: 18
  89. readonly property int unifiedSearchResultTextRightMargin: 16
  90. readonly property int unifiedSearchResultIconWidth: trayListItemIconSize * (1 - thumbnailImageSizeReduction)
  91. readonly property int unifiedSearchResultSmallIconWidth: trayListItemIconSize * (1 - thumbnailImageSizeReduction * 2)
  92. readonly property int unifiedSearchResultIconLeftMargin: 12
  93. readonly property int unifiedSearchResultTitleFontSize: topLinePixelSize
  94. readonly property int unifiedSearchResultSublineFontSize: subLinePixelSize
  95. readonly property int unifiedSearchResultSectionItemLeftPadding: 16
  96. readonly property int unifiedSearchResultSectionItemVerticalPadding: 8
  97. readonly property int unifiedSearchResultNothingFoundHorizontalMargin: 10
  98. readonly property int radioButtonCustomMarginLeftInner: 4
  99. readonly property int radioButtonCustomMarginLeftOuter: 5
  100. readonly property int radioButtonCustomRadius: 9
  101. readonly property int radioButtonIndicatorSize: 16
  102. readonly property var fontMetrics: FontMetrics {}
  103. readonly property int activityContentSpace: 4
  104. function variableSize(size) {
  105. return size * (1 + Math.min(pixelSize / 100, 1));
  106. }
  107. }