mirror of
https://github.com/lubosz/overte.git
synced 2025-04-05 19:57:01 +02:00
fix Developer > UI > Show Overlays + snap UI not hiding
This commit is contained in:
parent
a1089b5b50
commit
214c9c4ef7
5 changed files with 17 additions and 22 deletions
|
@ -388,13 +388,18 @@ Menu::Menu() {
|
|||
|
||||
// Developer > UI >>>
|
||||
MenuWrapper* uiOptionsMenu = developerMenu->addMenu("UI");
|
||||
|
||||
// Developer > UI > Show Overlays
|
||||
action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::Overlays, 0, true);
|
||||
|
||||
connect(action, &QAction::triggered, [action] {
|
||||
qApp->getApplicationOverlay().setEnabled(action->isChecked());
|
||||
});
|
||||
|
||||
// Developer > UI > Desktop Tablet Becomes Toolbar
|
||||
action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::DesktopTabletToToolbar, 0,
|
||||
qApp->getDesktopTabletBecomesToolbarSetting());
|
||||
|
||||
// Developer > UI > Show Overlays
|
||||
addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::Overlays, 0, true);
|
||||
|
||||
// Developer > UI > Desktop Tablet Becomes Toolbar
|
||||
connect(action, &QAction::triggered, [action] {
|
||||
qApp->setDesktopTabletBecomesToolbarSetting(action->isChecked());
|
||||
});
|
||||
|
|
|
@ -281,7 +281,7 @@ void GraphicsEngine::render_performFrame() {
|
|||
|
||||
{
|
||||
PROFILE_RANGE(render, "/runRenderFrame");
|
||||
renderArgs._hudOperator = displayPlugin->getHUDOperator();
|
||||
renderArgs._hudOperator = qApp->getApplicationOverlay().enabled() ? displayPlugin->getHUDOperator() : nullptr;
|
||||
renderArgs._hudTexture = qApp->getApplicationOverlay().getOverlayTexture();
|
||||
renderArgs._takingSnapshot = qApp->takeSnapshotOperators(snapshotOperators);
|
||||
renderArgs._blitFramebuffer = finalFramebuffer;
|
||||
|
|
|
@ -27,18 +27,17 @@ public:
|
|||
|
||||
void renderOverlay(RenderArgs* renderArgs);
|
||||
|
||||
gpu::TexturePointer getOverlayTexture();
|
||||
gpu::TexturePointer getOverlayTexture();
|
||||
|
||||
bool enabled() const { return _enabled; }
|
||||
void setEnabled(bool enabled) { _enabled = enabled; }
|
||||
|
||||
private:
|
||||
void renderStatsAndLogs(RenderArgs* renderArgs);
|
||||
void renderDomainConnectionStatusBorder(RenderArgs* renderArgs);
|
||||
void renderQmlUi(RenderArgs* renderArgs);
|
||||
void renderOverlays(RenderArgs* renderArgs);
|
||||
void buildFramebufferObject();
|
||||
|
||||
float _alpha{ 1.0f };
|
||||
float _trailingAudioLoudness{ 0.0f };
|
||||
|
||||
int _domainStatusBorder;
|
||||
int _magnifierBorder;
|
||||
|
||||
|
@ -47,6 +46,8 @@ private:
|
|||
gpu::TexturePointer _overlayColorTexture;
|
||||
gpu::FramebufferPointer _overlayFramebuffer;
|
||||
int _qmlGeometryId { 0 };
|
||||
|
||||
bool _enabled { true };
|
||||
};
|
||||
|
||||
#endif // hifi_ApplicationOverlay_h
|
||||
|
|
|
@ -153,14 +153,6 @@ void Overlays::render(RenderArgs* renderArgs) {
|
|||
}
|
||||
}
|
||||
|
||||
void Overlays::disable() {
|
||||
_enabled = false;
|
||||
}
|
||||
|
||||
void Overlays::enable() {
|
||||
_enabled = true;
|
||||
}
|
||||
|
||||
Overlay::Pointer Overlays::take2DOverlay(const QUuid& id) {
|
||||
if (_shuttingDown) {
|
||||
return nullptr;
|
||||
|
@ -378,7 +370,7 @@ QObject* Overlays::getOverlayObject(const QUuid& id) {
|
|||
}
|
||||
|
||||
QUuid Overlays::getOverlayAtPoint(const glm::vec2& point) {
|
||||
if (_shuttingDown || !_enabled) {
|
||||
if (_shuttingDown) {
|
||||
return UNKNOWN_ENTITY_ID;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,8 +99,6 @@ public:
|
|||
void init();
|
||||
void update(float deltatime);
|
||||
void render(RenderArgs* renderArgs);
|
||||
void disable();
|
||||
void enable();
|
||||
|
||||
Overlay::Pointer take2DOverlay(const QUuid& id);
|
||||
Overlay::Pointer get2DOverlay(const QUuid& id) const;
|
||||
|
@ -683,7 +681,6 @@ private:
|
|||
|
||||
unsigned int _stackOrder { 1 };
|
||||
|
||||
bool _enabled { true };
|
||||
std::atomic<bool> _shuttingDown { false };
|
||||
|
||||
PointerEvent calculateOverlayPointerEvent(const QUuid& id, const PickRay& ray, const RayToOverlayIntersectionResult& rayPickResult,
|
||||
|
|
Loading…
Reference in a new issue