diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/mailviewer/qml/HtmlContent.qml | 5 | ||||
-rw-r--r-- | components/mailviewer/qml/MailDataModel.qml | 8 | ||||
-rw-r--r-- | components/mailviewer/qml/MailViewer.qml | 1 | ||||
-rw-r--r-- | components/mailviewer/qml/TextContent.qml | 10 |
4 files changed, 23 insertions, 1 deletions
diff --git a/components/mailviewer/qml/HtmlContent.qml b/components/mailviewer/qml/HtmlContent.qml index f0249a01..c775a3ca 100644 --- a/components/mailviewer/qml/HtmlContent.qml +++ b/components/mailviewer/qml/HtmlContent.qml | |||
@@ -27,7 +27,10 @@ Item { | |||
27 | property string content | 27 | property string content |
28 | //We have to give it a minimum size so the html content starts to expand | 28 | //We have to give it a minimum size so the html content starts to expand |
29 | property int contentHeight: 10; | 29 | property int contentHeight: 10; |
30 | 30 | property string searchString | |
31 | onSearchStringChanged: { | ||
32 | htmlView.findText(searchString) | ||
33 | } | ||
31 | 34 | ||
32 | WebEngineView { | 35 | WebEngineView { |
33 | id: htmlView | 36 | id: htmlView |
diff --git a/components/mailviewer/qml/MailDataModel.qml b/components/mailviewer/qml/MailDataModel.qml index d960b2ac..fdc3ce22 100644 --- a/components/mailviewer/qml/MailDataModel.qml +++ b/components/mailviewer/qml/MailDataModel.qml | |||
@@ -23,6 +23,8 @@ import org.kube.framework 1.0 as Kube | |||
23 | DelegateModel { | 23 | DelegateModel { |
24 | id: root | 24 | id: root |
25 | 25 | ||
26 | property string searchString: "" | ||
27 | |||
26 | delegate: Item { | 28 | delegate: Item { |
27 | id: partColumn | 29 | id: partColumn |
28 | 30 | ||
@@ -124,6 +126,12 @@ DelegateModel { | |||
124 | } | 126 | } |
125 | height: item ? item.contentHeight : 0 | 127 | height: item ? item.contentHeight : 0 |
126 | width: parent.width | 128 | width: parent.width |
129 | Binding { | ||
130 | target: partLoader.item | ||
131 | property: "searchString" | ||
132 | value: root.searchString | ||
133 | when: partLoader.status == Loader.Ready | ||
134 | } | ||
127 | } | 135 | } |
128 | Component.onCompleted: { | 136 | Component.onCompleted: { |
129 | switch (model.type) { | 137 | switch (model.type) { |
diff --git a/components/mailviewer/qml/MailViewer.qml b/components/mailviewer/qml/MailViewer.qml index 9031ec17..faf3bc61 100644 --- a/components/mailviewer/qml/MailViewer.qml +++ b/components/mailviewer/qml/MailViewer.qml | |||
@@ -22,6 +22,7 @@ Item { | |||
22 | id: root | 22 | id: root |
23 | property alias rootIndex: visualModel.rootIndex | 23 | property alias rootIndex: visualModel.rootIndex |
24 | property alias model: visualModel.model | 24 | property alias model: visualModel.model |
25 | property alias searchString: visualModel.searchString | ||
25 | height: partListView.height | 26 | height: partListView.height |
26 | 27 | ||
27 | MailDataModel { | 28 | MailDataModel { |
diff --git a/components/mailviewer/qml/TextContent.qml b/components/mailviewer/qml/TextContent.qml index 316786ef..95e196b4 100644 --- a/components/mailviewer/qml/TextContent.qml +++ b/components/mailviewer/qml/TextContent.qml | |||
@@ -27,8 +27,14 @@ Item { | |||
27 | property bool embedded: true | 27 | property bool embedded: true |
28 | property string type | 28 | property string type |
29 | 29 | ||
30 | property string searchString | ||
30 | property int contentHeight: textEdit.height | 31 | property int contentHeight: textEdit.height |
31 | 32 | ||
33 | onSearchStringChanged: { | ||
34 | //This is a workaround because otherwise the view will not take the ViewHighlighter changes into account. | ||
35 | textEdit.text = root.content | ||
36 | } | ||
37 | |||
32 | TextEdit { | 38 | TextEdit { |
33 | id: textEdit | 39 | id: textEdit |
34 | 40 | ||
@@ -56,5 +62,9 @@ Item { | |||
56 | acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text | 62 | acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text |
57 | cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor | 63 | cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor |
58 | } | 64 | } |
65 | Kube.ViewHighlighter { | ||
66 | textDocument: textEdit.textDocument | ||
67 | searchString: root.searchString | ||
68 | } | ||
59 | } | 69 | } |
60 | } | 70 | } |