Skip to content

Commit

Permalink
Gui: add dock overlay option to ignore navi cube
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed May 19, 2020
1 parent e02e861 commit 8857204
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
20 changes: 19 additions & 1 deletion src/Gui/CommandView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4085,7 +4085,7 @@ VIEW_CMD_DEF(DockOverlayActivateOnHover, DockOverlayActivateOnHover)
}

//===========================================================================
// Std_DockOverlayClickThrough
// Std_DockOverlayMouseThrough
//===========================================================================

VIEW_CMD_DEF(DockOverlayMouseThrough, DockOverlayMouseThrough)
Expand All @@ -4098,6 +4098,23 @@ VIEW_CMD_DEF(DockOverlayMouseThrough, DockOverlayMouseThrough)
eType = 0;
}

//===========================================================================
// Std_DockOverlayCheckNaviCube
//===========================================================================

VIEW_CMD_DEF(DockOverlayCheckNaviCube, DockOverlayCheckNaviCube)
{
sGroup = QT_TR_NOOP("Standard-View");
sMenuText = QT_TR_NOOP("Make space for NaviCube");
sToolTipText = QT_TR_NOOP("Adjust overlay size to make space for Navigation Cube\n"
"Note that it only respects the cube position setting in\n"
"the preference dialog, and will not work for custom\n"
"position obtained through dragging the cube.");
sWhatsThis = "Std_DockOverlayCheckNaviCube";
sStatusTip = sToolTipText;
eType = 0;
}

class StdCmdDockOverlay : public GroupCommand
{
public:
Expand Down Expand Up @@ -4127,6 +4144,7 @@ class StdCmdDockOverlay : public GroupCommand
addCommand(new StdCmdDockOverlayExtraState());
addCommand(new StdCmdDockOverlayActivateOnHover());
addCommand(new StdCmdDockOverlayMouseThrough());
addCommand(new StdCmdDockOverlayCheckNaviCube());
};
virtual const char* className() const {return "StdCmdDockOverlay";}
};
Expand Down
3 changes: 2 additions & 1 deletion src/Gui/DockWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,8 @@ struct DockWindowManagerP
h -= tabbar->height();

int naviCubeSize = ViewParams::getNaviWidgetSize()+10;
int naviCorner = ViewParams::getCornerNaviCube();
int naviCorner = ViewParams::getDockOverlayCheckNaviCube() ?
ViewParams::getCornerNaviCube() : -1;

QRect rectBottom(0,0,0,0);
if(_bottom.geometry(rectBottom)) {
Expand Down
1 change: 1 addition & 0 deletions src/Gui/ViewParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class GuiExport ViewParams: public ParameterGrp::ObserverType {
FC_VIEW_PARAM(DockOverlayRevealDelay,int,Int,2000) \
FC_VIEW_PARAM(DockOverlayActivateOnHover,bool,Bool,true) \
FC_VIEW_PARAM(DockOverlayMouseThrough,bool,Bool,true) \
FC_VIEW_PARAM(DockOverlayCheckNaviCube,bool,Bool,true) \
FC_VIEW_PARAM(EditingTransparency,double,Float,0.5) \
FC_VIEW_PARAM(EditingAutoTransparent,bool,Bool,true) \
FC_VIEW_PARAM(HiddenLineTransparency,double,Float,0.4) \
Expand Down

0 comments on commit 8857204

Please sign in to comment.