PdfStyle.qml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright (C) 2022 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. import QtQuick
  4. /*!
  5. \qmltype PdfStyle
  6. \inqmlmodule QtQuick.Pdf
  7. \brief A styling interface for the PDF viewer components.
  8. PdfStyle provides properties to modify the appearance of PdfMultiPageView,
  9. PdfScrollablePageView, and PdfPageView.
  10. Default styles are provided to match the
  11. \l {Styling Qt Quick Controls}{styles in Qt Quick Controls}.
  12. \l {Using File Selectors with Qt Quick Controls}{File selectors}
  13. are used to load the PDF style corresponding to the Controls style in use.
  14. Custom styles are possible, using different \l {QFileSelector}{file selectors}.
  15. */
  16. QtObject {
  17. /*! \internal
  18. \qmlproperty SystemPalette PdfStyle::palette
  19. */
  20. property SystemPalette palette: SystemPalette { }
  21. /*! \internal
  22. \qmlmethod color PdfStyle::withAlpha()
  23. */
  24. function withAlpha(color, alpha) {
  25. return Qt.hsla(color.hslHue, color.hslSaturation, color.hslLightness, alpha)
  26. }
  27. /*!
  28. \qmlproperty color PdfStyle::selectionColor
  29. The color of translucent rectangles that are overlaid on
  30. \l {PdfMultiPageView::selectedText}{selected text}.
  31. \sa PdfSelection
  32. */
  33. property color selectionColor: withAlpha(palette.highlight, 0.5)
  34. /*!
  35. \qmlproperty color PdfStyle::pageSearchResultsColor
  36. The color of translucent rectangles that are overlaid on text that
  37. matches the \l {PdfMultiPageView::searchString}{search string}.
  38. \sa PdfSearchModel
  39. */
  40. property color pageSearchResultsColor: "#80B0C4DE"
  41. /*!
  42. \qmlproperty color PdfStyle::currentSearchResultStrokeColor
  43. The color of the box outline around the
  44. \l {PdfSearchModel::currentResult}{current search result}.
  45. \sa PdfMultiPageView::searchBack(), PdfMultiPageView::searchForward(), PdfSearchModel::currentResult
  46. */
  47. property color currentSearchResultStrokeColor: "cyan"
  48. /*!
  49. \qmlproperty real PdfStyle::currentSearchResultStrokeWidth
  50. The line width of the box outline around the
  51. \l {PdfSearchModel::currentResult}{current search result}.
  52. \sa PdfMultiPageView::searchBack(), PdfMultiPageView::searchForward(), PdfSearchModel::currentResult
  53. */
  54. property real currentSearchResultStrokeWidth: 2
  55. }