Commit cbdb7372 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix label position

parent 7a462117
......@@ -248,12 +248,14 @@ void MailWebEngineAccessKey::makeAccessKeyLabel(QChar accessKey, const MessageVi
label->setAutoFillBackground(true);
label->setFrameStyle(QFrame::Box | QFrame::Plain);
QPoint point = element.boundingRect().center();
qDebug()<<" point label"<<point;
#if 0
point -= d->mWebView->page()->mainFrame()->scrollPosition();
#endif
label->move(point);
label->show();
point.setX(point.x() - label->width() / 2);
qDebug() << "new point "<<point;
label->move(point);
d->mAccessKeyLabels.append(label);
d->mAccessKeyNodes.insertMulti(accessKey, element);
......
......@@ -43,6 +43,7 @@ void MailWebEngineAccessKeyAnchor::initialize(const QVariant &result)
mTarget = map.value(QStringLiteral("target")).toString();
mTagName = map.value(QStringLiteral("tagName")).toString();
mInnerText = map.value(QStringLiteral("text")).toString();
qDebug()<<" mInnerText"<<mInnerText<< "bounding"<<mBoundingRect;
}
}
......
......@@ -28,7 +28,7 @@ QString MessageViewer::MailWebEngineAccessKeyUtils::script()
" text: matches[i].innerText,"
" tagName: matches[i].tagName,"
" src: matches[i].href,"
" boundingRect: [r.top, r.left, r.right - r.left, r.bottom - r.top],"
" boundingRect: [r.left, r.top, r.right - r.left, r.bottom - r.top],"
" accessKey: matches[i].getAttribute('accesskey'),"
" target: matches[i].getAttribute('target')"
" });"
......
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