Bugfixing

This commit is contained in:
Jakub Melka 2020-05-24 16:56:02 +02:00
parent ba188426c2
commit 81f27e87ac
2 changed files with 20 additions and 4 deletions

View File

@ -1444,6 +1444,19 @@ void PDFFormManager::mouseMoveEvent(QWidget* widget, QMouseEvent* event)
{
event->accept();
}
if (hasFormFieldWidgetText(info.editor->getWidgetAnnotation()))
{
m_mouseCursor = QCursor(Qt::IBeamCursor);
}
else
{
m_mouseCursor = QCursor(Qt::ArrowCursor);
}
}
else
{
m_mouseCursor = std::nullopt;
}
}
@ -1586,8 +1599,7 @@ PDFFormManager::MouseEventInfo PDFFormManager::getMouseEventInfo(QWidget* widget
const std::optional<QCursor>& PDFFormManager::getCursor() const
{
static const std::optional<QCursor> dummy;
return dummy;
return m_mouseCursor;
}
void PDFFormManager::clearEditors()
@ -1988,11 +2000,14 @@ PDFFormFieldComboBoxEditor::PDFFormFieldComboBoxEditor(PDFFormManager* formManag
initializeTextEdit(&m_textEdit);
QFontMetricsF fontMetrics(m_textEdit.getFont());
const qreal lineSpacing = fontMetrics.lineSpacing();
const int listBoxItems = qMin(7, int(parentField->getOptions().size()));
QRectF comboBoxRectangle = m_formManager->getWidgetRectangle(m_formWidget);
QRectF listBoxPopupRectangle = comboBoxRectangle;
listBoxPopupRectangle.translate(0, -comboBoxRectangle.height() * (listBoxItems));
listBoxPopupRectangle.setHeight(comboBoxRectangle.height() * listBoxItems);
listBoxPopupRectangle.translate(0, -lineSpacing * (listBoxItems));
listBoxPopupRectangle.setHeight(lineSpacing * listBoxItems);
m_listBoxPopupRectangle = listBoxPopupRectangle;
m_dropDownButtonRectangle = comboBoxRectangle;
m_dropDownButtonRectangle.setLeft(m_dropDownButtonRectangle.right() - m_dropDownButtonRectangle.height());

View File

@ -691,6 +691,7 @@ private:
std::vector<PDFFormFieldWidgetEditor*> m_widgetEditors;
PDFFormFieldWidgetEditor* m_focusedEditor;
MouseGrabInfo m_mouseGrabInfo;
std::optional<QCursor> m_mouseCursor;
};
} // namespace pdf