mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Form editors (first part)
This commit is contained in:
@ -985,7 +985,8 @@ void PDFAnnotationManager::drawWidgetAnnotationHighlight(QRectF annotationRectan
|
||||
{
|
||||
// Is it a form field?
|
||||
const PDFFormManager::FormAppearanceFlags flags = m_formManager->getAppearanceFlags();
|
||||
if (flags.testFlag(PDFFormManager::HighlightFields) || flags.testFlag(PDFFormManager::HighlightRequiredFields))
|
||||
const bool isFocused = m_formManager->isFocused(annotation->getSelfReference());
|
||||
if (isFocused || flags.testFlag(PDFFormManager::HighlightFields) || flags.testFlag(PDFFormManager::HighlightRequiredFields))
|
||||
{
|
||||
const PDFFormField* formField = m_formManager->getFormFieldForWidget(annotation->getSelfReference());
|
||||
if (!formField)
|
||||
@ -1002,6 +1003,10 @@ void PDFAnnotationManager::drawWidgetAnnotationHighlight(QRectF annotationRectan
|
||||
{
|
||||
color = Qt::red;
|
||||
}
|
||||
if (isFocused)
|
||||
{
|
||||
color = Qt::yellow;
|
||||
}
|
||||
|
||||
if (color.isValid())
|
||||
{
|
||||
@ -1453,7 +1458,14 @@ void PDFWidgetAnnotationManager::updateFromMouseEvent(QMouseEvent* event)
|
||||
}
|
||||
if (annotationType == AnnotationType::Widget)
|
||||
{
|
||||
m_cursor = QCursor(Qt::ArrowCursor);
|
||||
if (m_formManager && m_formManager->hasFormFieldWidgetText(pageAnnotation.annotation->getSelfReference()))
|
||||
{
|
||||
m_cursor = QCursor(Qt::IBeamCursor);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_cursor = QCursor(Qt::ArrowCursor);
|
||||
}
|
||||
}
|
||||
|
||||
// Generate popup window
|
||||
|
Reference in New Issue
Block a user