mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
Add settings to the options dialog to control the mouse behavior
This commit is contained in:
@ -625,7 +625,7 @@ void MainWindowViewer::createToolBars()
|
||||
|
||||
viewer->addAction(closeAction);
|
||||
|
||||
viewer->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
updateContextMenuPolicy();
|
||||
|
||||
// MacOSX app menus
|
||||
#ifdef Q_OS_MACOS
|
||||
@ -777,9 +777,25 @@ void MainWindowViewer::openComicFromRecentAction(QAction *action)
|
||||
|
||||
void MainWindowViewer::reloadOptions()
|
||||
{
|
||||
updateContextMenuPolicy();
|
||||
viewer->updateConfig(settings);
|
||||
}
|
||||
|
||||
void MainWindowViewer::updateContextMenuPolicy()
|
||||
{
|
||||
auto mouseMode = Configuration::getConfiguration().getMouseMode();
|
||||
switch (mouseMode) {
|
||||
|
||||
case Normal:
|
||||
case HotAreas:
|
||||
viewer->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
break;
|
||||
case LeftRightNavigation:
|
||||
viewer->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindowViewer::open()
|
||||
{
|
||||
QFileDialog openDialog;
|
||||
@ -970,9 +986,11 @@ void MainWindowViewer::disablePreviousNextComicActions()
|
||||
|
||||
void MainWindowViewer::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
toggleFullScreen();
|
||||
event->accept();
|
||||
if (Configuration::getConfiguration().getMouseMode() == MouseMode::Normal) {
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
toggleFullScreen();
|
||||
event->accept();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user