Commit c65539e2 authored by Laurent Montel's avatar Laurent Montel 😁

Return hasSelection in html page too

parent e91d5b84
......@@ -111,6 +111,11 @@ void SieveEditorHelpHtmlWidget::copy()
mWebView->triggerPageAction(QWebEnginePage::Copy);
}
bool SieveEditorHelpHtmlWidget::hasSelection() const
{
return mWebView->hasSelection();
}
void SieveEditorHelpHtmlWidget::zoomOut()
{
if (mZoomFactor <= 10) {
......
......@@ -43,6 +43,8 @@ public:
void zoomIn();
void copy();
bool hasSelection() const;
Q_SIGNALS:
void titleChanged(KSieveUi::SieveEditorHelpHtmlWidget *widget, const QString &title);
void progressIndicatorPixmapChanged(KSieveUi::SieveEditorHelpHtmlWidget *widget, const QPixmap &);
......
......@@ -308,7 +308,13 @@ bool SieveEditorTextModeWidget::isRedoAvailable() const
bool SieveEditorTextModeWidget::hasSelection() const
{
return mTextEdit->textCursor().hasSelection();
QWidget *w = mTabWidget->currentWidget();
if (w == mTextEdit) {
return mTextEdit->textCursor().hasSelection();
} else if (SieveEditorHelpHtmlWidget *page = qobject_cast<SieveEditorHelpHtmlWidget *>(w)) {
return page->hasSelection();
}
return false;
}
void SieveEditorTextModeWidget::zoomIn()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment