/// Current ratio between physical pixels and device-independent pixels
double pixelRatio() const {
#if QT_VERSION >= 0x050000
- return devicePixelRatio();
+ return qt_scale_factor * devicePixelRatio();
#else
return 1.0;
#endif
QSize iconSize(docstring const & icon_size)
{
- int size;
+ unsigned int size;
if (icon_size == "small")
size = smallIconSize;
else if (icon_size == "normal")
static string icon_size;
- int size = qsize.width();
+ unsigned int size = qsize.width();
if (size < smallIconSize)
size = smallIconSize;
double GuiView::pixelRatio() const
{
#if QT_VERSION >= 0x050000
- return devicePixelRatio();
+ return qt_scale_factor * devicePixelRatio();
#else
return 1.0;
#endif
void GuiView::structureChanged()
{
+ // This is called from the Buffer, which has no way to ensure that cursors
+ // in BufferView remain valid.
+ if (documentBufferView())
+ documentBufferView()->cursor().sanitize();
// FIXME: This is slightly expensive, though less than the tocBackend update
// (#9880). This also resets the view in the Toc Widget (#6675).
d.toc_models_.reset(documentBufferView());
}
-void GuiView::toolBarPopup(const QPoint & pos)
+void GuiView::toolBarPopup(const QPoint & /*pos*/)
{
QMenu * menu = new QMenu;
menu = guiApp->menus().menu(toqstr("context-toolbars"), * this);