Style.qml 5.3 KB

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