Skip to content

Commit

Permalink
Limit screen edge pushing to fullscreen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
gzotti committed Dec 23, 2024
1 parent 4089c5f commit a0c0c4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/core/StelMovementMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

#include "StelMovementMgr.hpp"
#include "StelMainView.hpp"
#include "StelObjectMgr.hpp"
#include "StelModuleMgr.hpp"
#include "StelApp.hpp"
Expand Down Expand Up @@ -316,8 +317,8 @@ Vec3d StelMovementMgr::getViewUpVectorJ2000() const

bool StelMovementMgr::handleMouseMoves(int x, int y, Qt::MouseButtons)
{
// Turn if the mouse is at the edge of the screen unless config asks otherwise
if (flagEnableMoveAtScreenEdge)
// Turn if the mouse is at the edge of the screen unless config asks otherwise (this is too awkward in windowed mode)
if (flagEnableMoveAtScreenEdge && StelMainView::getInstance().isFullScreen())
{
if (x <= 1)
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/StelMovementMgr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public slots:
//! PROPERTY GETTER/SETTER
//! Get whether being at the edge of the screen activates movement
bool getFlagEnableMoveAtScreenEdge() const {return flagEnableMoveAtScreenEdge;}
//! Set whether being at the edge of the screen activates movement
//! Set whether being at the edge of the screen activates movement. The actual motion is only performed in fullscreen mode.
void setFlagEnableMoveAtScreenEdge(bool b) {flagEnableMoveAtScreenEdge=b; StelApp::immediateSave("navigation/flag_enable_move_at_screen_edge", b); emit flagEnableMoveAtScreenEdgeChanged(b);}

//! PROPERTY GETTER/SETTER
Expand Down
2 changes: 1 addition & 1 deletion src/gui/configurationDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2210,7 +2210,7 @@
<item row="6" column="1">
<widget class="QCheckBox" name="pushScreenEdgeCheckBox">
<property name="toolTip">
<string>Allow mouse to move view when at screen edge</string>
<string>Allow mouse to move view when at screen edge (Fullscreen only)</string>
</property>
<property name="text">
<string>Mouse push screen edge</string>
Expand Down

0 comments on commit a0c0c4b

Please sign in to comment.