ShareeDelegate.qml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. * for more details.
  13. */
  14. import QtQuick 2.15
  15. import QtQuick.Window 2.15
  16. import QtQuick.Layouts 1.2
  17. import QtQuick.Controls 2.15
  18. import com.nextcloud.desktopclient 1.0
  19. import Style 1.0
  20. import "../tray"
  21. ItemDelegate {
  22. id: root
  23. text: model.display
  24. contentItem: RowLayout {
  25. height: visible ? implicitHeight : 0
  26. Loader {
  27. id: shareeIconLoader
  28. Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
  29. active: model.icon !== ""
  30. sourceComponent: Image {
  31. id: shareeIcon
  32. horizontalAlignment: Qt.AlignLeft
  33. verticalAlignment: Qt.AlignVCenter
  34. width: height
  35. height: shareeLabel.height
  36. smooth: true
  37. antialiasing: true
  38. mipmap: true
  39. fillMode: Image.PreserveAspectFit
  40. source: model.icon
  41. sourceSize: Qt.size(shareeIcon.height * 1.0, shareeIcon.height * 1.0)
  42. }
  43. }
  44. EnforcedPlainTextLabel {
  45. id: shareeLabel
  46. Layout.preferredHeight: unifiedSearchResultSkeletonItemDetails.iconWidth
  47. Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
  48. Layout.fillWidth: true
  49. horizontalAlignment: Text.AlignLeft
  50. verticalAlignment: Text.AlignVCenter
  51. text: model.display
  52. }
  53. }
  54. }