#include "Undo.h"
#include "version.h"
-#include "graphics/GraphicsImage.h"
-#include "graphics/GraphicsLoader.h"
-
#include "support/convert.h"
#include "support/debug.h"
#include "support/lassert.h"
case Qt::LeftButton:
b = mouse_button::button1;
break;
- case Qt::MidButton:
+ case Qt::MiddleButton:
b = mouse_button::button2;
break;
case Qt::RightButton:
mouse_button::state b = mouse_button::none;
if (state & Qt::LeftButton)
b |= mouse_button::button1;
- if (state & Qt::MidButton)
+ if (state & Qt::MiddleButton)
b |= mouse_button::button2;
if (state & Qt::RightButton)
b |= mouse_button::button3;
GuiWorkArea::Private::Private(GuiWorkArea * parent)
-: p(parent), buffer_view_(nullptr), lyx_view_(nullptr),
- caret_visible_(false), need_resize_(false), preedit_lines_(1),
- last_pixel_ratio_(1.0), completer_(new GuiCompleter(p, p)),
- dialog_mode_(false), shell_escape_(false), read_only_(false),
- clean_(true), externally_modified_(false), needs_caret_geometry_update_(true)
-{
-/* Qt on macOS and Wayland does not respect the
- * Qt::WA_OpaquePaintEvent attribute and resets the widget backing
- * store at each update. Therefore, we use our own backing store in
- * these two cases. */
-#if QT_VERSION >= 0x050000
+ : p(parent), completer_(new GuiCompleter(p, p))
+{
+ /* Qt on macOS and Wayland does not respect the
+ * Qt::WA_OpaquePaintEvent attribute and resets the widget backing
+ * store at each update. Therefore, we use our own backing store
+ * in these two cases.
+ */
use_backingstore_ = guiApp->platformName() == "cocoa"
|| guiApp->platformName().contains("wayland");
-#else
-# ifdef Q_OS_MAC
- use_backingstore_ = true;
-# else
- use_backingstore_ = false;
-# endif
-#endif
int const time = QApplication::cursorFlashTime() / 2;
if (time > 0) {
void TabWorkArea::mousePressEvent(QMouseEvent *me)
{
- if (me->button() == Qt::MidButton)
+ if (me->button() == Qt::MiddleButton)
midpressed_tab_ = tabBar()->tabAt(me->pos());
else
QTabWidget::mousePressEvent(me);
void TabWorkArea::mouseReleaseEvent(QMouseEvent *me)
{
- if (me->button() == Qt::MidButton) {
+ if (me->button() == Qt::MiddleButton) {
int const midreleased_tab = tabBar()->tabAt(me->pos());
if (midpressed_tab_ == midreleased_tab && posIsTab(me->pos()))
closeTab(midreleased_tab);