UnifiedSearchResultFetchMoreTrigger.qml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (C) 2021 by Oleksandr Zolotov <alex@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 QtQml 2.15
  15. import QtQuick 2.15
  16. import QtQuick.Controls 2.15
  17. import QtQuick.Layouts 1.15
  18. import Style 1.0
  19. ColumnLayout {
  20. id: unifiedSearchResultItemFetchMore
  21. property bool isFetchMoreInProgress: false
  22. property bool isWithinViewPort: false
  23. property int fontSize: Style.unifiedSearchResultTitleFontSize
  24. property string textColor: Style.ncSecondaryTextColor
  25. Accessible.role: Accessible.ListItem
  26. Accessible.name: unifiedSearchResultItemFetchMoreText.text
  27. Accessible.onPressAction: unifiedSearchResultMouseArea.clicked()
  28. EnforcedPlainTextLabel {
  29. id: unifiedSearchResultItemFetchMoreText
  30. Layout.fillWidth: true
  31. Layout.fillHeight: true
  32. Layout.leftMargin: Style.trayHorizontalMargin
  33. Layout.rightMargin: Style.trayHorizontalMargin
  34. horizontalAlignment: Text.AlignHCenter
  35. verticalAlignment: Text.AlignVCenter
  36. text: qsTr("Load more results")
  37. wrapMode: Text.Wrap
  38. font.pixelSize: unifiedSearchResultItemFetchMore.fontSize
  39. color: unifiedSearchResultItemFetchMore.textColor
  40. visible: !unifiedSearchResultItemFetchMore.isFetchMoreInProgress
  41. }
  42. BusyIndicator {
  43. id: unifiedSearchResultItemFetchMoreIconInProgress
  44. Layout.preferredWidth: parent.height * 0.70
  45. Layout.preferredHeight: parent.height * 0.70
  46. Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
  47. running: visible
  48. visible: unifiedSearchResultItemFetchMore.isFetchMoreInProgress && unifiedSearchResultItemFetchMore.isWithinViewPort
  49. }
  50. }