Main toolbar consolidation and cleanup (#1167)
* Moving menu options around * Consolidation and moving of toolbar functioanlity * Fixed non-unity build missing header * Updated camera icon to the correct one * Addressed review feedback * Addressed review feedback * Moved icons to new folder structure/naming
This commit is contained in:
@@ -1,394 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "InfoBar.h"
|
||||
|
||||
// Editor
|
||||
#include "MainWindow.h"
|
||||
#include "DisplaySettings.h"
|
||||
#include "GameEngine.h"
|
||||
#include "Include/ITransformManipulator.h"
|
||||
#include "ActionManager.h"
|
||||
#include "Settings.h"
|
||||
#include "Include/IObjectManager.h"
|
||||
#include "MathConversion.h"
|
||||
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
#include <ui_InfoBar.h>
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
|
||||
#include <QLineEdit>
|
||||
|
||||
#include <AzQtComponents/Components/Style.h>
|
||||
|
||||
void BeautifyEulerAngles(Vec3& v)
|
||||
{
|
||||
if (v.x + v.y + v.z >= 360.0f)
|
||||
{
|
||||
v.x = 180.0f - v.x;
|
||||
v.y = 180.0f - v.y;
|
||||
v.z = 180.0f - v.z;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CInfoBar dialog
|
||||
CInfoBar::CInfoBar(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::CInfoBar)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_bSelectionChanged = false;
|
||||
m_bDragMode = false;
|
||||
m_prevMoveSpeed = 0;
|
||||
m_currValue = Vec3(-111, +222, -333); //this wasn't initialized. I don't know what a good value is
|
||||
m_oldMainVolume = 1.0f;
|
||||
|
||||
GetIEditor()->RegisterNotifyListener(this);
|
||||
|
||||
//audio request setup
|
||||
m_oMuteAudioRequest.pData = &m_oMuteAudioRequestData;
|
||||
m_oUnmuteAudioRequest.pData = &m_oUnmuteAudioRequestData;
|
||||
|
||||
OnInitDialog();
|
||||
|
||||
auto comboBoxTextChanged = static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::currentTextChanged);
|
||||
connect(ui->m_moveSpeed, comboBoxTextChanged, this, &CInfoBar::OnUpdateMoveSpeedText);
|
||||
connect(ui->m_moveSpeed->lineEdit(), &QLineEdit::returnPressed, this, &CInfoBar::OnSpeedComboBoxEnter);
|
||||
|
||||
// Hide some buttons from the expander menu
|
||||
AzQtComponents::Style::addClass(ui->m_physDoStepBtn, "expanderMenu_hide");
|
||||
AzQtComponents::Style::addClass(ui->m_physSingleStepBtn, "expanderMenu_hide");
|
||||
|
||||
connect(ui->m_physicsBtn, &QToolButton::clicked, this, &CInfoBar::OnBnClickedPhysics);
|
||||
connect(ui->m_physSingleStepBtn, &QToolButton::clicked, this, &CInfoBar::OnBnClickedSingleStepPhys);
|
||||
connect(ui->m_physDoStepBtn, &QToolButton::clicked, this, &CInfoBar::OnBnClickedDoStepPhys);
|
||||
connect(ui->m_syncPlayerBtn, &QToolButton::clicked, this, &CInfoBar::OnBnClickedSyncplayer);
|
||||
connect(ui->m_gotoPos, &QToolButton::clicked, this, &CInfoBar::OnBnClickedGotoPosition);
|
||||
connect(ui->m_muteBtn, &QToolButton::clicked, this, &CInfoBar::OnBnClickedMuteAudio);
|
||||
connect(ui->m_vrBtn, &QToolButton::clicked, this, &CInfoBar::OnBnClickedEnableVR);
|
||||
|
||||
connect(this, &CInfoBar::ActionTriggered, MainWindow::instance()->GetActionManager(), &ActionManager::ActionTriggered);
|
||||
|
||||
connect(ui->m_physicsBtn, &QAbstractButton::toggled, ui->m_physicsBtn, [this](bool checked) {
|
||||
ui->m_physicsBtn->setToolTip(checked ? tr("Stop Simulation (Ctrl+P)") : tr("Simulate (Ctrl+P)"));
|
||||
});
|
||||
connect(ui->m_physSingleStepBtn, &QAbstractButton::toggled, ui->m_physSingleStepBtn, [this](bool checked) {
|
||||
ui->m_physSingleStepBtn->setToolTip(checked ? tr("Disable Physics/AI Single-step Mode ('<' in Game Mode)") : tr("Enable Physics/AI Single-step Mode ('<' in Game Mode)"));
|
||||
});
|
||||
connect(ui->m_syncPlayerBtn, &QAbstractButton::toggled, ui->m_syncPlayerBtn, [this](bool checked) {
|
||||
ui->m_syncPlayerBtn->setToolTip(checked ? tr("Synchronize Player with Camera") : tr("Move Player and Camera Separately"));
|
||||
});
|
||||
connect(ui->m_muteBtn, &QAbstractButton::toggled, ui->m_muteBtn, [this](bool checked) {
|
||||
ui->m_muteBtn->setToolTip(checked ? tr("Un-mute Audio") : tr("Mute Audio"));
|
||||
});
|
||||
connect(ui->m_vrBtn, &QAbstractButton::toggled, ui->m_vrBtn, [this](bool checked) {
|
||||
ui->m_vrBtn->setToolTip(checked ? tr("Disable VR Preview") : tr("Enable VR Preview"));
|
||||
});
|
||||
|
||||
ui->m_moveSpeed->setValidator(new QDoubleValidator(m_minSpeed, m_maxSpeed, m_numDecimals, ui->m_moveSpeed));
|
||||
|
||||
// Save off the move speed here since setting up the combo box can cause it to update values in the background.
|
||||
float cameraMoveSpeed = gSettings.cameraMoveSpeed;
|
||||
|
||||
// Populate the presets in the ComboBox
|
||||
for (float presetValue : m_speedPresetValues)
|
||||
{
|
||||
ui->m_moveSpeed->addItem(QString().setNum(presetValue, 'f', m_numDecimals), presetValue);
|
||||
}
|
||||
|
||||
SetSpeedComboBox(cameraMoveSpeed);
|
||||
|
||||
ui->m_moveSpeed->setInsertPolicy(QComboBox::NoInsert);
|
||||
|
||||
using namespace AzToolsFramework::ComponentModeFramework;
|
||||
EditorComponentModeNotificationBus::Handler::BusConnect(AzToolsFramework::GetEntityContextId());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CInfoBar::~CInfoBar()
|
||||
{
|
||||
using namespace AzToolsFramework::ComponentModeFramework;
|
||||
EditorComponentModeNotificationBus::Handler::BusDisconnect();
|
||||
|
||||
GetIEditor()->UnregisterNotifyListener(this);
|
||||
|
||||
AZ::VR::VREventBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CInfoBar::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
{
|
||||
if (event == eNotify_OnIdleUpdate)
|
||||
{
|
||||
IdleUpdate();
|
||||
}
|
||||
else if (event == eNotify_OnBeginGameMode || event == eNotify_OnEndGameMode)
|
||||
{
|
||||
// Audio: determine muted state of audio
|
||||
//m_bMuted = gEnv->pAudioSystem->GetMainVolume() == 0.f;
|
||||
ui->m_muteBtn->setChecked(gSettings.bMuteAudio);
|
||||
}
|
||||
else if (event == eNotify_OnBeginLoad || event == eNotify_OnCloseScene)
|
||||
{
|
||||
// make sure AI/Physics is disabled on level load (CE-4229)
|
||||
if (GetIEditor()->GetGameEngine()->GetSimulationMode())
|
||||
{
|
||||
OnBnClickedPhysics();
|
||||
}
|
||||
|
||||
ui->m_physicsBtn->setEnabled(false);
|
||||
ui->m_physSingleStepBtn->setEnabled(false);
|
||||
ui->m_physDoStepBtn->setEnabled(false);
|
||||
}
|
||||
else if (event == eNotify_OnEndLoad || event == eNotify_OnEndNewScene)
|
||||
{
|
||||
ui->m_physicsBtn->setEnabled(true);
|
||||
ui->m_physSingleStepBtn->setEnabled(true);
|
||||
ui->m_physDoStepBtn->setEnabled(true);
|
||||
}
|
||||
else if (event == eNotify_OnSelectionChange)
|
||||
{
|
||||
m_bSelectionChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
void CInfoBar::IdleUpdate()
|
||||
{
|
||||
if (!m_idleUpdateEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool updateUI = false;
|
||||
// Update Width/Height of selection rectangle.
|
||||
AABB box;
|
||||
GetIEditor()->GetSelectedRegion(box);
|
||||
float width = box.max.x - box.min.x;
|
||||
float height = box.max.y - box.min.y;
|
||||
if (m_width != width || m_height != height)
|
||||
{
|
||||
m_width = width;
|
||||
m_height = height;
|
||||
updateUI = true;
|
||||
}
|
||||
|
||||
Vec3 marker = GetIEditor()->GetMarkerPosition();
|
||||
|
||||
int selectedEntitiesCount = 0;
|
||||
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(
|
||||
selectedEntitiesCount, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntitiesCount);
|
||||
if (selectedEntitiesCount != m_numSelected)
|
||||
{
|
||||
m_numSelected = selectedEntitiesCount;
|
||||
updateUI = true;
|
||||
}
|
||||
|
||||
QString str;
|
||||
if (updateUI)
|
||||
{
|
||||
if (m_numSelected == 0)
|
||||
{
|
||||
str = tr("None Selected");
|
||||
}
|
||||
else if (m_numSelected == 1)
|
||||
{
|
||||
str = tr("1 Object Selected");
|
||||
}
|
||||
else
|
||||
{
|
||||
str = tr("%1 Objects Selected").arg(m_numSelected);
|
||||
}
|
||||
|
||||
ui->m_statusText->setText(str);
|
||||
m_sLastText = str;
|
||||
}
|
||||
|
||||
if (gSettings.cameraMoveSpeed != m_prevMoveSpeed &&
|
||||
!ui->m_moveSpeed->lineEdit()->hasFocus())
|
||||
{
|
||||
m_prevMoveSpeed = gSettings.cameraMoveSpeed;
|
||||
SetSpeedComboBox(gSettings.cameraMoveSpeed);
|
||||
}
|
||||
|
||||
{
|
||||
bool bPhysics = GetIEditor()->GetGameEngine()->GetSimulationMode();
|
||||
if ((ui->m_physicsBtn->isChecked() && !bPhysics) ||
|
||||
(!ui->m_physicsBtn->isChecked() && bPhysics))
|
||||
{
|
||||
ui->m_physicsBtn->setChecked(bPhysics);
|
||||
}
|
||||
|
||||
// Unsupported for Phyics:: atm
|
||||
bool bSingleStep = false;
|
||||
if (ui->m_physSingleStepBtn->isChecked() != bSingleStep)
|
||||
{
|
||||
ui->m_physSingleStepBtn->setChecked(bSingleStep);
|
||||
}
|
||||
|
||||
bool bSyncPlayer = GetIEditor()->GetGameEngine()->IsSyncPlayerPosition();
|
||||
if ((!ui->m_syncPlayerBtn->isChecked() && !bSyncPlayer) ||
|
||||
(ui->m_syncPlayerBtn->isChecked() && bSyncPlayer))
|
||||
{
|
||||
ui->m_syncPlayerBtn->setChecked(!bSyncPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
// if our selection changed, or if our display values are out of date
|
||||
if (m_bSelectionChanged)
|
||||
{
|
||||
m_bSelectionChanged = false;
|
||||
}
|
||||
}
|
||||
|
||||
inline double Round(double fVal, double fStep)
|
||||
{
|
||||
if (fStep > 0.f)
|
||||
{
|
||||
fVal = int_round(fVal / fStep) * fStep;
|
||||
}
|
||||
return fVal;
|
||||
}
|
||||
|
||||
void CInfoBar::OnUpdateMoveSpeedText(const QString& text)
|
||||
{
|
||||
gSettings.cameraMoveSpeed = aznumeric_cast<float>(Round(text.toDouble(), m_speedStep));
|
||||
}
|
||||
|
||||
void CInfoBar::OnSpeedComboBoxEnter()
|
||||
{
|
||||
ui->m_moveSpeed->clearFocus();
|
||||
}
|
||||
|
||||
void CInfoBar::OnInitDialog()
|
||||
{
|
||||
QFontMetrics metrics({});
|
||||
int width = metrics.boundingRect("-9999.99").width() * m_fieldWidthMultiplier;
|
||||
|
||||
ui->m_moveSpeed->setFixedWidth(width);
|
||||
|
||||
ui->m_physicsBtn->setEnabled(false);
|
||||
ui->m_physSingleStepBtn->setEnabled(false);
|
||||
ui->m_physDoStepBtn->setEnabled(false);
|
||||
|
||||
ui->m_muteBtn->setChecked(gSettings.bMuteAudio);
|
||||
Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequest, gSettings.bMuteAudio ? m_oMuteAudioRequest : m_oUnmuteAudioRequest);
|
||||
|
||||
//This is here just in case this class hasn't been created before
|
||||
//a VR headset was initialized
|
||||
ui->m_vrBtn->setEnabled(false);
|
||||
if (AZ::VR::HMDDeviceRequestBus::GetTotalNumOfEventHandlers() != 0)
|
||||
{
|
||||
ui->m_vrBtn->setEnabled(true);
|
||||
}
|
||||
|
||||
AZ::VR::VREventBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
void CInfoBar::OnHMDInitialized()
|
||||
{
|
||||
ui->m_vrBtn->setEnabled(true);
|
||||
}
|
||||
|
||||
void CInfoBar::OnHMDShutdown()
|
||||
{
|
||||
ui->m_vrBtn->setEnabled(false);
|
||||
}
|
||||
|
||||
void CInfoBar::OnBnClickedTerrainCollision()
|
||||
{
|
||||
emit ActionTriggered(ID_TERRAIN_COLLISION);
|
||||
}
|
||||
|
||||
void CInfoBar::OnBnClickedPhysics()
|
||||
{
|
||||
if (!ui->m_physicsBtn->isEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool bPhysics = GetIEditor()->GetGameEngine()->GetSimulationMode();
|
||||
ui->m_physicsBtn->setChecked(bPhysics);
|
||||
emit ActionTriggered(ID_SWITCH_PHYSICS);
|
||||
|
||||
if (bPhysics && ui->m_physSingleStepBtn->isChecked())
|
||||
{
|
||||
OnBnClickedSingleStepPhys();
|
||||
}
|
||||
}
|
||||
|
||||
void CInfoBar::OnBnClickedSingleStepPhys()
|
||||
{
|
||||
}
|
||||
|
||||
void CInfoBar::OnBnClickedDoStepPhys()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CInfoBar::OnBnClickedSyncplayer()
|
||||
{
|
||||
emit ActionTriggered(ID_GAME_SYNCPLAYER);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CInfoBar::OnBnClickedGotoPosition()
|
||||
{
|
||||
emit ActionTriggered(ID_DISPLAY_GOTOPOSITION);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CInfoBar::OnBnClickedMuteAudio()
|
||||
{
|
||||
gSettings.bMuteAudio = !gSettings.bMuteAudio;
|
||||
|
||||
Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequest, gSettings.bMuteAudio ? m_oMuteAudioRequest : m_oUnmuteAudioRequest);
|
||||
|
||||
ui->m_muteBtn->setChecked(gSettings.bMuteAudio);
|
||||
}
|
||||
|
||||
void CInfoBar::OnBnClickedEnableVR()
|
||||
{
|
||||
gSettings.bEnableGameModeVR = !gSettings.bEnableGameModeVR;
|
||||
ui->m_vrBtn->setChecked(gSettings.bEnableGameModeVR);
|
||||
}
|
||||
|
||||
void CInfoBar::EnteredComponentMode(const AZStd::vector<AZ::Uuid>& /*componentModeTypes*/)
|
||||
{
|
||||
ui->m_physicsBtn->setDisabled(true);
|
||||
}
|
||||
|
||||
void CInfoBar::LeftComponentMode(const AZStd::vector<AZ::Uuid>& /*componentModeTypes*/)
|
||||
{
|
||||
ui->m_physicsBtn->setEnabled(true);
|
||||
}
|
||||
|
||||
void CInfoBar::SetSpeedComboBox(double value)
|
||||
{
|
||||
value = AZStd::clamp(Round(value, m_speedStep), m_minSpeed, m_maxSpeed);
|
||||
|
||||
int index = ui->m_moveSpeed->findData(value);
|
||||
if (index != -1)
|
||||
{
|
||||
ui->m_moveSpeed->setCurrentIndex(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->m_moveSpeed->lineEdit()->setText(QString().setNum(value, 'f', m_numDecimals));
|
||||
}
|
||||
}
|
||||
|
||||
#include <moc_InfoBar.cpp>
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_INFOBAR_H
|
||||
#define CRYINCLUDE_EDITOR_INFOBAR_H
|
||||
|
||||
#pragma once
|
||||
// InfoBar.h : header file
|
||||
//
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <AzToolsFramework/ComponentMode/EditorComponentModeBus.h>
|
||||
#include <IAudioSystem.h>
|
||||
#include <HMDBus.h>
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CInfoBar dialog
|
||||
|
||||
namespace Ui {
|
||||
class CInfoBar;
|
||||
}
|
||||
|
||||
class CInfoBar
|
||||
: public QWidget
|
||||
, public IEditorNotifyListener
|
||||
, public AZ::VR::VREventBus::Handler
|
||||
, private AzToolsFramework::ComponentModeFramework::EditorComponentModeNotificationBus::Handler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
// Construction
|
||||
public:
|
||||
CInfoBar(QWidget* parent = nullptr);
|
||||
~CInfoBar();
|
||||
|
||||
// Toggle the mute audio button
|
||||
void ToggleAudio() { OnBnClickedMuteAudio(); }
|
||||
void SetSpeedComboBox(double value);
|
||||
|
||||
Q_SIGNALS:
|
||||
void ActionTriggered(int command);
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
void IdleUpdate();
|
||||
virtual void OnEditorNotifyEvent(EEditorNotifyEvent event);
|
||||
|
||||
virtual void OnOK() {};
|
||||
virtual void OnCancel() {};
|
||||
|
||||
void OnBnClickedSyncplayer();
|
||||
void OnBnClickedGotoPosition();
|
||||
|
||||
void OnSpeedComboBoxEnter();
|
||||
void OnUpdateMoveSpeedText(const QString&);
|
||||
void OnBnClickedTerrainCollision();
|
||||
void OnBnClickedPhysics();
|
||||
void OnBnClickedSingleStepPhys();
|
||||
void OnBnClickedDoStepPhys();
|
||||
void OnBnClickedMuteAudio();
|
||||
void OnBnClickedEnableVR();
|
||||
void OnInitDialog();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// VR Event Bus Implementation
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void OnHMDInitialized() override;
|
||||
void OnHMDShutdown() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// EditorComponentModeNotificationBus
|
||||
void EnteredComponentMode(const AZStd::vector<AZ::Uuid>& componentModeTypes) override;
|
||||
void LeftComponentMode(const AZStd::vector<AZ::Uuid>& componentModeTypes) override;
|
||||
|
||||
float m_width, m_height;
|
||||
//int m_heightMapX,m_heightMapY;
|
||||
double m_fieldWidthMultiplier = 1.8;
|
||||
|
||||
int m_numSelected;
|
||||
float m_prevMoveSpeed;
|
||||
|
||||
// Speed combobox/lineEdit settings
|
||||
double m_minSpeed = 0.1;
|
||||
double m_maxSpeed = 100.0;
|
||||
double m_speedStep = 0.1;
|
||||
int m_numDecimals = 1;
|
||||
|
||||
// Speed presets
|
||||
float m_speedPresetValues[3] = { 0.1f, 1.0f, 10.0f };
|
||||
|
||||
bool m_bSelectionChanged;
|
||||
|
||||
bool m_bDragMode;
|
||||
QString m_sLastText;
|
||||
|
||||
Vec3 m_lastValue;
|
||||
Vec3 m_currValue;
|
||||
float m_oldMainVolume;
|
||||
|
||||
Audio::SAudioRequest m_oMuteAudioRequest;
|
||||
Audio::SAudioManagerRequestData<Audio::eAMRT_MUTE_ALL> m_oMuteAudioRequestData;
|
||||
Audio::SAudioRequest m_oUnmuteAudioRequest;
|
||||
Audio::SAudioManagerRequestData<Audio::eAMRT_UNMUTE_ALL> m_oUnmuteAudioRequestData;
|
||||
|
||||
QScopedPointer<Ui::CInfoBar> ui;
|
||||
|
||||
bool m_idleUpdateEnabled = true;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_INFOBAR_H
|
||||
@@ -1,333 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CInfoBar</class>
|
||||
<widget class="QWidget" name="CInfoBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1600</width>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">b</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_statusText">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>No Objects Selected</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_gotoPos">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Go to Position</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Go to Position</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InfoBar.qrc">
|
||||
<normaloff>:/InfoBar/GotoLocation-default.svg</normaloff>:/InfoBar/GotoLocation-default.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>1</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Speed</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="m_moveSpeed">
|
||||
<property name="toolTip">
|
||||
<string>Camera Movement Speed</string>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_syncPlayerBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Synchronize Player with Camera</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Synchronize Player with Camera</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InfoBar.qrc">
|
||||
<normaloff>:/InfoBar/NoPlayerSync-default.svg</normaloff>
|
||||
<activeon>:/InfoBar/NoPlayerSync-selected.svg</activeon>
|
||||
:/InfoBar/NoPlayerSync-default.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>1</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_physicsBtn">
|
||||
<property name="toolTip">
|
||||
<string>Simulate (Ctrl+P)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Simulate (Ctrl+P)</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InfoBar.qrc">
|
||||
<normaloff>:/InfoBar/PhysicsCol-default.svg</normaloff>:/InfoBar/PhysicsCol-default.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_physSingleStepBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Enable Physics/AI Single-step Mode ('<' in Game Mode)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable Physics/AI Single-step Mode ('<' in Game Mode)</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InfoBar.qrc">
|
||||
<normaloff>:/InfoBar/Pause-default.svg</normaloff>:/InfoBar/Pause-default.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_physDoStepBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Perform a Single Physics/AI Simulation Step ('>' in Game Mode)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Perform a Single Physics/AI Simulation Step ('>' in Game Mode)</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InfoBar.qrc">
|
||||
<normaloff>:/InfoBar/PausePlay-default.svg</normaloff>:/InfoBar/PausePlay-default.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>1</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_muteBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Mute Audio</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mute Audio</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InfoBar.qrc">
|
||||
<normaloff>:/InfoBar/Mute-default.svg</normaloff>:/InfoBar/Mute-default.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_vrBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Enable VR Preview</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable VR Preview</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InfoBar.qrc">
|
||||
<normaloff>:/InfoBar/VR-default.svg</normaloff>:/InfoBar/VR-default.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="InfoBar.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -94,134 +94,12 @@ void CLayoutSplitter::CreateLayoutView(int row, int col, int id)
|
||||
viewPane->SetId(id);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// InfoBarExpanderWatcher
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class InfoBarExpanderWatcher
|
||||
: public QObject
|
||||
{
|
||||
public:
|
||||
InfoBarExpanderWatcher(QObject* parent = nullptr)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
bool eventFilter(QObject* obj, QEvent* event) override
|
||||
{
|
||||
switch (event->type())
|
||||
{
|
||||
case QEvent::MouseButtonPress:
|
||||
case QEvent::MouseButtonRelease:
|
||||
case QEvent::MouseButtonDblClick:
|
||||
{
|
||||
if (qobject_cast<QToolButton*>(obj))
|
||||
{
|
||||
auto mouseEvent = static_cast<QMouseEvent*>(event);
|
||||
auto expansion = qobject_cast<QToolButton*>(obj);
|
||||
|
||||
expansion->setPopupMode(QToolButton::InstantPopup);
|
||||
auto menu = new QMenu(expansion);
|
||||
|
||||
auto toolbar = qobject_cast<QToolBar*>(expansion->parentWidget());
|
||||
|
||||
auto toolWidgets = toolbar->findChildren<QWidget*>();
|
||||
|
||||
if (toolWidgets.count() > 0)
|
||||
{
|
||||
for (auto toolWidget : toolWidgets)
|
||||
{
|
||||
if (AzQtComponents::Style::hasClass(toolWidget, "expanderMenu_hide"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (auto toolButton = qobject_cast<QToolButton*>(toolWidget))
|
||||
{
|
||||
if (!toolButton->isVisible())
|
||||
{
|
||||
// Skip some empty buttons
|
||||
if (toolButton->text().isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
QString plainText = QTextDocumentFragment::fromHtml(toolButton->text()).toPlainText();
|
||||
QAction* action = new QAction(plainText, menu);
|
||||
|
||||
if (!toolButton->isEnabled())
|
||||
{
|
||||
action->setEnabled(false);
|
||||
}
|
||||
|
||||
connect(action, &QAction::triggered, toolButton, &QToolButton::clicked);
|
||||
|
||||
if (toolButton->isCheckable())
|
||||
{
|
||||
action->setCheckable(true);
|
||||
}
|
||||
|
||||
action->setChecked(toolButton->isChecked());
|
||||
|
||||
menu->addAction(action);
|
||||
}
|
||||
}
|
||||
else if (auto toolCombo = qobject_cast<QComboBox*>(toolWidget))
|
||||
{
|
||||
// Add custom menu for Speed
|
||||
if (toolCombo->objectName() == "m_moveSpeed")
|
||||
{
|
||||
double currentValue = toolCombo->lineEdit()->text().toDouble();
|
||||
|
||||
QMenu* newMenu = menu->addMenu(QString("Speed: %1").arg(currentValue));
|
||||
|
||||
double presets[] = { 0.1, 1.0, 10.0 };
|
||||
for (double preset : presets)
|
||||
{
|
||||
QAction* presetAction = new QAction(newMenu);
|
||||
presetAction->setText(QString::number(preset));
|
||||
|
||||
connect(presetAction, &QAction::triggered, this, [preset, this]() {
|
||||
if (m_infoBar)
|
||||
{
|
||||
m_infoBar->SetSpeedComboBox(preset);
|
||||
}
|
||||
});
|
||||
|
||||
newMenu->addAction(presetAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu->exec(mouseEvent->globalPos());
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return QObject::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
void SetInfoBar(CInfoBar* infoBar)
|
||||
{
|
||||
m_infoBar = infoBar;
|
||||
}
|
||||
|
||||
private:
|
||||
CInfoBar* m_infoBar = nullptr;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// CLayoutWnd
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CLayoutWnd::CLayoutWnd(QSettings* settings, QWidget* parent)
|
||||
: AzQtComponents::ToolBarArea(parent)
|
||||
, m_settings(settings)
|
||||
, m_expanderWatcher(new InfoBarExpanderWatcher(this))
|
||||
{
|
||||
m_bMaximized = false;
|
||||
m_maximizedView = 0;
|
||||
@@ -230,23 +108,8 @@ CLayoutWnd::CLayoutWnd(QSettings* settings, QWidget* parent)
|
||||
m_maximizedViewId = 0;
|
||||
m_infoBarSize = QSize(0, 0);
|
||||
|
||||
m_infoBar = new CInfoBar(this);
|
||||
connect(qApp, &QApplication::focusChanged, this, &CLayoutWnd::OnFocusChanged);
|
||||
|
||||
m_expanderWatcher->SetInfoBar(m_infoBar);
|
||||
|
||||
m_infoToolBar = CreateToolBarFromWidget(m_infoBar,
|
||||
Qt::BottomToolBarArea,
|
||||
QStringLiteral("Info Panel"));
|
||||
m_infoToolBar->setMovable(false);
|
||||
m_infoToolBar->setObjectName("InfoBar");
|
||||
AzQtComponents::Style::addClass(m_infoToolBar, "DefaultSpacing");
|
||||
|
||||
if (QToolButton* expansion = AzQtComponents::ToolBar::getToolBarExpansionButton(m_infoToolBar))
|
||||
{
|
||||
expansion->installEventFilter(m_expanderWatcher);
|
||||
}
|
||||
|
||||
setContextMenuPolicy(Qt::NoContextMenu);
|
||||
}
|
||||
|
||||
@@ -415,7 +278,6 @@ void CLayoutWnd::CreateLayout(EViewLayout layout, bool bBindViewports, EViewport
|
||||
}
|
||||
|
||||
QRect rcView = rect();
|
||||
rcView.setBottom(rcView.bottom() - m_infoBar->height());
|
||||
|
||||
// Ensure we delete our old view immediately so it can relinquish its backing ViewportContext
|
||||
if (m_maximizedView)
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include "Viewport.h"
|
||||
#include "InfoBar.h"
|
||||
|
||||
#include <QSplitter>
|
||||
#include <QPointer>
|
||||
@@ -77,8 +76,6 @@ private:
|
||||
friend class CLayoutWnd;
|
||||
};
|
||||
|
||||
class InfoBarExpanderWatcher;
|
||||
|
||||
/** Main layout window.
|
||||
*/
|
||||
class CLayoutWnd
|
||||
@@ -116,8 +113,6 @@ public:
|
||||
//! Switch 2D viewports.
|
||||
void Cycle2DViewport();
|
||||
|
||||
CInfoBar& GetInfoBar() { return *m_infoBar; }
|
||||
|
||||
public slots:
|
||||
void ResetLayout();
|
||||
|
||||
@@ -162,11 +157,8 @@ private:
|
||||
// Id of maximized view pane.
|
||||
int m_maximizedViewId;
|
||||
|
||||
CInfoBar* m_infoBar;
|
||||
QToolBar* m_infoToolBar;
|
||||
QSize m_infoBarSize;
|
||||
QSettings* m_settings;
|
||||
InfoBarExpanderWatcher* m_expanderWatcher;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -297,68 +297,6 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
class SnapToWidget
|
||||
: public QWidget
|
||||
{
|
||||
public:
|
||||
typedef AZStd::function<void(double)> SetValueCallback;
|
||||
typedef AZStd::function<double()> GetValueCallback;
|
||||
|
||||
SnapToWidget(QAction* defaultAction, SetValueCallback setValueCallback, GetValueCallback getValueCallback)
|
||||
: m_setValueCallback(setValueCallback)
|
||||
, m_getValueCallback(getValueCallback)
|
||||
{
|
||||
QHBoxLayout* layout = new QHBoxLayout();
|
||||
setLayout(layout);
|
||||
|
||||
m_toolButton = new QToolButton();
|
||||
m_toolButton->setAutoRaise(true);
|
||||
m_toolButton->setCheckable(false);
|
||||
m_toolButton->setDefaultAction(defaultAction);
|
||||
|
||||
m_spinBox = new AzQtComponents::DoubleSpinBox();
|
||||
|
||||
layout->addWidget(m_toolButton);
|
||||
layout->addWidget(m_spinBox);
|
||||
|
||||
m_spinBox->setEnabled(defaultAction->isChecked());
|
||||
m_spinBox->setMinimum(1e-2f);
|
||||
|
||||
{
|
||||
QSignalBlocker signalBlocker(m_spinBox);
|
||||
m_spinBox->setValue(m_getValueCallback());
|
||||
}
|
||||
|
||||
QObject::connect(m_spinBox, QOverload<double>::of(&AzQtComponents::DoubleSpinBox::valueChanged), this, &SnapToWidget::OnValueChanged);
|
||||
QObject::connect(defaultAction, &QAction::changed, this, &SnapToWidget::OnActionChanged);
|
||||
}
|
||||
|
||||
void SetIcon(QIcon icon)
|
||||
{
|
||||
m_toolButton->setIcon(icon);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
void OnValueChanged(double value)
|
||||
{
|
||||
m_setValueCallback(value);
|
||||
}
|
||||
|
||||
void OnActionChanged()
|
||||
{
|
||||
m_spinBox->setEnabled(m_toolButton->isChecked());
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
QToolButton* m_toolButton = nullptr;
|
||||
AzQtComponents::DoubleSpinBox* m_spinBox = nullptr;
|
||||
|
||||
SetValueCallback m_setValueCallback;
|
||||
GetValueCallback m_getValueCallback;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// MainWindow
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1274,36 +1212,6 @@ void UndoRedoToolButton::Update(int count)
|
||||
setEnabled(count > 0);
|
||||
}
|
||||
|
||||
QWidget* MainWindow::CreateSnapToGridWidget()
|
||||
{
|
||||
SnapToWidget::SetValueCallback setCallback = [](double snapStep)
|
||||
{
|
||||
SandboxEditor::SetGridSnappingSize(snapStep);
|
||||
};
|
||||
|
||||
SnapToWidget::GetValueCallback getCallback = []()
|
||||
{
|
||||
return SandboxEditor::GridSnappingSize();
|
||||
};
|
||||
|
||||
return new SnapToWidget(m_actionManager->GetAction(ID_SNAP_TO_GRID), setCallback, getCallback);
|
||||
}
|
||||
|
||||
QWidget* MainWindow::CreateSnapToAngleWidget()
|
||||
{
|
||||
SnapToWidget::SetValueCallback setCallback = [](double snapAngle)
|
||||
{
|
||||
SandboxEditor::SetAngleSnappingSize(snapAngle);
|
||||
};
|
||||
|
||||
SnapToWidget::GetValueCallback getCallback = []()
|
||||
{
|
||||
return SandboxEditor::AngleSnappingSize();
|
||||
};
|
||||
|
||||
return new SnapToWidget(m_actionManager->GetAction(ID_SNAPANGLE), setCallback, getCallback);
|
||||
}
|
||||
|
||||
bool MainWindow::IsPreview() const
|
||||
{
|
||||
return GetIEditor()->IsInPreviewMode();
|
||||
@@ -2016,12 +1924,6 @@ QWidget* MainWindow::CreateToolbarWidget(int actionId)
|
||||
case ID_TOOLBAR_WIDGET_REDO:
|
||||
w = CreateUndoRedoButton(ID_REDO);
|
||||
break;
|
||||
case ID_TOOLBAR_WIDGET_SNAP_GRID:
|
||||
w = CreateSnapToGridWidget();
|
||||
break;
|
||||
case ID_TOOLBAR_WIDGET_SNAP_ANGLE:
|
||||
w = CreateSnapToAngleWidget();
|
||||
break;
|
||||
case ID_TOOLBAR_WIDGET_SPACER_RIGHT:
|
||||
w = CreateSpacerRightWidget();
|
||||
break;
|
||||
|
||||
@@ -202,8 +202,6 @@ private:
|
||||
// AzToolsFramework::SourceControlNotificationBus::Handler:
|
||||
void ConnectivityStateChanged(const AzToolsFramework::SourceControlState state) override;
|
||||
|
||||
QWidget* CreateSnapToGridWidget();
|
||||
QWidget* CreateSnapToAngleWidget();
|
||||
QWidget* CreateSpacerRightWidget();
|
||||
|
||||
QToolButton* CreateUndoRedoButton(int command);
|
||||
|
||||
@@ -144,20 +144,6 @@ EditorWindow QToolBar
|
||||
border-bottom: 2px solid #111111;
|
||||
}
|
||||
|
||||
/* InfoBar (Toolbar below the main viewport) */
|
||||
|
||||
QToolBar#InfoBar
|
||||
{
|
||||
qproperty-iconSize: 22px 18px;
|
||||
}
|
||||
|
||||
QToolBar#InfoBar AzQtComponents--VectorElement[Coordinate="X"] QLabel,
|
||||
QToolBar#InfoBar AzQtComponents--VectorElement[Coordinate="Y"] QLabel,
|
||||
QToolBar#InfoBar AzQtComponents--VectorElement[Coordinate="Z"] QLabel
|
||||
{
|
||||
background-color: #333333;
|
||||
}
|
||||
|
||||
DockWidgetTitleBar #DockWidgetContextMenu
|
||||
{
|
||||
qproperty-icon: url(:/Cards/img/UI20/Cards/menu_ico.svg);
|
||||
|
||||
@@ -582,19 +582,6 @@ AmazonToolbar ToolbarManager::GetEditModeToolbar() const
|
||||
{
|
||||
AmazonToolbar t = AmazonToolbar("EditMode", QObject::tr("Edit Mode Toolbar"));
|
||||
t.SetMainToolbar(true);
|
||||
t.AddAction(ID_TOOLBAR_WIDGET_UNDO, ORIGINAL_TOOLBAR_VERSION);
|
||||
t.AddAction(ID_TOOLBAR_WIDGET_REDO, ORIGINAL_TOOLBAR_VERSION);
|
||||
|
||||
t.AddAction(ID_TOOLBAR_SEPARATOR, ORIGINAL_TOOLBAR_VERSION);
|
||||
|
||||
t.AddAction(ID_EDITMODE_MOVE, ORIGINAL_TOOLBAR_VERSION);
|
||||
t.AddAction(ID_EDITMODE_ROTATE, ORIGINAL_TOOLBAR_VERSION);
|
||||
t.AddAction(ID_EDITMODE_SCALE, ORIGINAL_TOOLBAR_VERSION);
|
||||
|
||||
t.AddAction(ID_TOOLBAR_SEPARATOR, ORIGINAL_TOOLBAR_VERSION);
|
||||
t.AddAction(ID_TOOLBAR_WIDGET_SNAP_GRID, ORIGINAL_TOOLBAR_VERSION);
|
||||
t.AddAction(ID_TOOLBAR_WIDGET_SNAP_ANGLE, ORIGINAL_TOOLBAR_VERSION);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
// Qt
|
||||
#include <QInputDialog>
|
||||
|
||||
#include <AtomLyIntegration/AtomViewportDisplayInfo/AtomViewportInfoDisplayBus.h>
|
||||
|
||||
// CryCommon
|
||||
#include <CryCommon/SFunctor.h>
|
||||
|
||||
@@ -35,16 +37,20 @@
|
||||
#include "Objects/SelectionGroup.h"
|
||||
#include "UsedResources.h"
|
||||
#include "Include/IObjectManager.h"
|
||||
#include "ActionManager.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GameEngine.h"
|
||||
#include "MathConversion.h"
|
||||
#include "EditorViewportSettings.h"
|
||||
|
||||
#include <AtomLyIntegration/AtomViewportDisplayInfo/AtomViewportInfoDisplayBus.h>
|
||||
|
||||
#include <AzCore/std/algorithm.h>
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
#include "ui_ViewportTitleDlg.h"
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
#endif //!defined(Q_MOC_RUN)
|
||||
|
||||
|
||||
// CViewportTitleDlg dialog
|
||||
|
||||
inline namespace Helpers
|
||||
@@ -103,7 +109,9 @@ CViewportTitleDlg::CViewportTitleDlg(QWidget* pParent)
|
||||
layout->addWidget(container);
|
||||
container->setObjectName("ViewportTitleDlgContainer");
|
||||
|
||||
m_pViewPane = NULL;
|
||||
m_prevMoveSpeed = 0;
|
||||
|
||||
m_pViewPane = nullptr;
|
||||
GetIEditor()->RegisterNotifyListener(this);
|
||||
GetISystem()->GetISystemEventDispatcher()->RegisterListener(this);
|
||||
|
||||
@@ -111,21 +119,176 @@ CViewportTitleDlg::CViewportTitleDlg(QWidget* pParent)
|
||||
LoadCustomPresets("AspectRatioPresets", "AspectRatioPreset", m_customAspectRatioPresets);
|
||||
LoadCustomPresets("ResPresets", "ResPreset", m_customResPresets);
|
||||
|
||||
OnInitDialog();
|
||||
// audio request setup
|
||||
m_oMuteAudioRequest.pData = &m_oMuteAudioRequestData;
|
||||
m_oUnmuteAudioRequest.pData = &m_oUnmuteAudioRequestData;
|
||||
|
||||
connect(m_ui->m_fovLabel, &QWidget::customContextMenuRequested, this, &CViewportTitleDlg::PopUpFOVMenu);
|
||||
connect(m_ui->m_fovStaticCtrl, &QWidget::customContextMenuRequested, this, &CViewportTitleDlg::PopUpFOVMenu);
|
||||
connect(m_ui->m_ratioStaticCtrl, &QWidget::customContextMenuRequested, this, &CViewportTitleDlg::PopUpAspectMenu);
|
||||
connect(m_ui->m_ratioLabel, &QWidget::customContextMenuRequested, this, &CViewportTitleDlg::PopUpAspectMenu);
|
||||
connect(m_ui->m_sizeStaticCtrl, &QWidget::customContextMenuRequested, this, &CViewportTitleDlg::PopUpResolutionMenu);
|
||||
SetupCameraDropdownMenu();
|
||||
SetupResolutionDropdownMenu();
|
||||
SetupViewportInformationMenu();
|
||||
SetupOverflowMenu();
|
||||
|
||||
Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequest, gSettings.bMuteAudio ? m_oMuteAudioRequest : m_oUnmuteAudioRequest);
|
||||
|
||||
connect(this, &CViewportTitleDlg::ActionTriggered, MainWindow::instance()->GetActionManager(), &ActionManager::ActionTriggered);
|
||||
|
||||
AZ::VR::VREventBus::Handler::BusConnect();
|
||||
|
||||
OnInitDialog();
|
||||
}
|
||||
|
||||
CViewportTitleDlg::~CViewportTitleDlg()
|
||||
{
|
||||
AZ::VR::VREventBus::Handler::BusDisconnect();
|
||||
GetISystem()->GetISystemEventDispatcher()->RemoveListener(this);
|
||||
GetIEditor()->UnregisterNotifyListener(this);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetupCameraDropdownMenu()
|
||||
{
|
||||
// Setup the camera dropdown menu
|
||||
QMenu* cameraMenu = new QMenu(this);
|
||||
cameraMenu->addMenu(GetFovMenu());
|
||||
m_ui->m_cameraMenu->setMenu(cameraMenu);
|
||||
m_ui->m_cameraMenu->setPopupMode(QToolButton::InstantPopup);
|
||||
QAction* gotoPositionAction = new QAction("Go to position", cameraMenu);
|
||||
connect(gotoPositionAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedGotoPosition);
|
||||
cameraMenu->addAction(gotoPositionAction);
|
||||
m_syncPlayerToCameraAction = new QAction("Sync camera to player", cameraMenu);
|
||||
m_syncPlayerToCameraAction->setCheckable(true);
|
||||
connect(m_syncPlayerToCameraAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedSyncplayer);
|
||||
cameraMenu->addAction(m_syncPlayerToCameraAction);
|
||||
|
||||
cameraMenu->addSeparator();
|
||||
|
||||
auto cameraSpeedActionWidget = new QWidgetAction(cameraMenu);
|
||||
auto cameraSpeedContainer = new QWidget(cameraMenu);
|
||||
auto cameraSpeedLabel = new QLabel(tr("Camera Speed"), cameraMenu);
|
||||
m_cameraSpeed = new QComboBox(cameraMenu);
|
||||
m_cameraSpeed->setEditable(true);
|
||||
m_cameraSpeed->setValidator(new QDoubleValidator(m_minSpeed, m_maxSpeed, m_numDecimals, m_cameraSpeed));
|
||||
|
||||
QHBoxLayout* cameraSpeedLayout = new QHBoxLayout;
|
||||
cameraSpeedLayout->addWidget(cameraSpeedLabel);
|
||||
cameraSpeedLayout->addWidget(m_cameraSpeed);
|
||||
cameraSpeedContainer->setLayout(cameraSpeedLayout);
|
||||
cameraSpeedActionWidget->setDefaultWidget(cameraSpeedContainer);
|
||||
|
||||
// Save off the move speed here since setting up the combo box can cause it to update values in the background.
|
||||
float cameraMoveSpeed = gSettings.cameraMoveSpeed;
|
||||
|
||||
// Populate the presets in the ComboBox
|
||||
for (float presetValue : m_speedPresetValues)
|
||||
{
|
||||
m_cameraSpeed->addItem(QString().setNum(presetValue, 'f', m_numDecimals), presetValue);
|
||||
}
|
||||
|
||||
auto comboBoxTextChanged = static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentTextChanged);
|
||||
|
||||
SetSpeedComboBox(cameraMoveSpeed);
|
||||
m_cameraSpeed->setInsertPolicy(QComboBox::NoInsert);
|
||||
connect(m_cameraSpeed, comboBoxTextChanged, this, &CViewportTitleDlg::OnUpdateMoveSpeedText);
|
||||
connect(m_cameraSpeed->lineEdit(), &QLineEdit::returnPressed, this, &CViewportTitleDlg::OnSpeedComboBoxEnter);
|
||||
|
||||
cameraMenu->addAction(cameraSpeedActionWidget);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetupResolutionDropdownMenu()
|
||||
{
|
||||
// Setup the resolution dropdown menu
|
||||
QMenu* resolutionMenu = new QMenu(this);
|
||||
resolutionMenu->addMenu(GetAspectMenu());
|
||||
resolutionMenu->addMenu(GetResolutionMenu());
|
||||
m_ui->m_resolutionMenu->setMenu(resolutionMenu);
|
||||
m_ui->m_resolutionMenu->setPopupMode(QToolButton::InstantPopup);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetupViewportInformationMenu()
|
||||
{
|
||||
// Setup the debug information button
|
||||
m_ui->m_debugInformationMenu->setMenu(GetViewportInformationMenu());
|
||||
connect(m_ui->m_debugInformationMenu, &QToolButton::clicked, this, &CViewportTitleDlg::OnToggleDisplayInfo);
|
||||
m_ui->m_debugInformationMenu->setPopupMode(QToolButton::MenuButtonPopup);
|
||||
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetupOverflowMenu()
|
||||
{
|
||||
// Setup the overflow menu
|
||||
QMenu* overFlowMenu = new QMenu(this);
|
||||
m_debugHelpersAction = new QAction("Debug Helpers", overFlowMenu);
|
||||
m_debugHelpersAction->setCheckable(true);
|
||||
m_debugHelpersAction->setChecked(Helpers::IsHelpersShown());
|
||||
connect(m_debugHelpersAction, &QAction::triggered, this, &CViewportTitleDlg::OnToggleHelpers);
|
||||
overFlowMenu->addAction(m_debugHelpersAction);
|
||||
|
||||
m_audioMuteAction = new QAction("Mute Audio", overFlowMenu);
|
||||
connect(m_audioMuteAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedMuteAudio);
|
||||
overFlowMenu->addAction(m_audioMuteAction);
|
||||
|
||||
m_enableVRAction = new QAction("Enable VR Preview", overFlowMenu);
|
||||
connect(m_enableVRAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedEnableVR);
|
||||
overFlowMenu->addAction(m_enableVRAction);
|
||||
|
||||
overFlowMenu->addSeparator();
|
||||
|
||||
m_enableGridSnappingAction = new QAction("Enable Grid Snapping", overFlowMenu);
|
||||
connect(m_enableGridSnappingAction, &QAction::triggered, this, &CViewportTitleDlg::OnGridSnappingToggled);
|
||||
m_enableGridSnappingAction->setCheckable(true);
|
||||
overFlowMenu->addAction(m_enableGridSnappingAction);
|
||||
|
||||
m_gridSizeActionWidget = new QWidgetAction(overFlowMenu);
|
||||
auto gridSizeContainer = new QWidget(overFlowMenu);
|
||||
auto gridSizeLabel = new QLabel(tr("Grid Size"), overFlowMenu);
|
||||
|
||||
m_gridSpinBox = new AzQtComponents::DoubleSpinBox();
|
||||
m_gridSpinBox->setValue(SandboxEditor::GridSnappingSize());
|
||||
m_gridSpinBox->setMinimum(1e-2f);
|
||||
|
||||
QObject::connect(
|
||||
m_gridSpinBox, QOverload<double>::of(&AzQtComponents::DoubleSpinBox::valueChanged), this, &CViewportTitleDlg::OnGridSpinBoxChanged);
|
||||
|
||||
QHBoxLayout* gridSizeLayout = new QHBoxLayout;
|
||||
gridSizeLayout->addWidget(gridSizeLabel);
|
||||
gridSizeLayout->addWidget(m_gridSpinBox);
|
||||
gridSizeContainer->setLayout(gridSizeLayout);
|
||||
m_gridSizeActionWidget->setDefaultWidget(gridSizeContainer);
|
||||
overFlowMenu->addAction(m_gridSizeActionWidget);
|
||||
|
||||
overFlowMenu->addSeparator();
|
||||
|
||||
m_enableAngleSnappingAction = new QAction("Enable Grid Snapping", overFlowMenu);
|
||||
connect(m_enableAngleSnappingAction, &QAction::triggered, this, &CViewportTitleDlg::OnAngleSnappingToggled);
|
||||
m_enableAngleSnappingAction->setCheckable(true);
|
||||
overFlowMenu->addAction(m_enableAngleSnappingAction);
|
||||
|
||||
m_angleSizeActionWidget = new QWidgetAction(overFlowMenu);
|
||||
auto angleSizeContainer = new QWidget(overFlowMenu);
|
||||
auto angleSizeLabel = new QLabel(tr("Angle Snapping"), overFlowMenu);
|
||||
|
||||
m_angleSpinBox = new AzQtComponents::DoubleSpinBox();
|
||||
m_angleSpinBox->setValue(SandboxEditor::AngleSnappingSize());
|
||||
m_angleSpinBox->setMinimum(1e-2f);
|
||||
|
||||
QObject::connect(
|
||||
m_angleSpinBox, QOverload<double>::of(&AzQtComponents::DoubleSpinBox::valueChanged), this,
|
||||
&CViewportTitleDlg::OnAngleSpinBoxChanged);
|
||||
|
||||
QHBoxLayout* angleSizeLayout = new QHBoxLayout;
|
||||
angleSizeLayout->addWidget(angleSizeLabel);
|
||||
angleSizeLayout->addWidget(m_angleSpinBox);
|
||||
angleSizeContainer->setLayout(angleSizeLayout);
|
||||
m_angleSizeActionWidget->setDefaultWidget(angleSizeContainer);
|
||||
overFlowMenu->addAction(m_angleSizeActionWidget);
|
||||
|
||||
m_ui->m_overflowBtn->setMenu(overFlowMenu);
|
||||
m_ui->m_overflowBtn->setPopupMode(QToolButton::InstantPopup);
|
||||
connect(overFlowMenu, &QMenu::aboutToShow, this, &CViewportTitleDlg::UpdateOverFlowMenuState);
|
||||
|
||||
UpdateMuteActionText();
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CViewportTitleDlg::SetViewPane(CLayoutViewPane* pViewPane)
|
||||
{
|
||||
@@ -140,21 +303,27 @@ void CViewportTitleDlg::SetViewPane(CLayoutViewPane* pViewPane)
|
||||
void CViewportTitleDlg::OnInitDialog()
|
||||
{
|
||||
m_ui->m_titleBtn->setText(m_title);
|
||||
m_ui->m_sizeStaticCtrl->setText(QString());
|
||||
|
||||
m_ui->m_toggleHelpersBtn->setChecked(GetIEditor()->GetDisplaySettings()->IsDisplayHelpers());
|
||||
|
||||
|
||||
// Add a child parented to us that listens for r_displayInfo changes.
|
||||
auto displayInfoHelper = new CViewportTitleDlgDisplayInfoHelper(this);
|
||||
connect(displayInfoHelper, &CViewportTitleDlgDisplayInfoHelper::ViewportInfoStatusUpdated, this, &CViewportTitleDlg::UpdateDisplayInfo);
|
||||
UpdateDisplayInfo();
|
||||
|
||||
connect(m_ui->m_toggleHelpersBtn, &QToolButton::clicked, this, &CViewportTitleDlg::OnToggleHelpers);
|
||||
connect(m_ui->m_toggleDisplayInfoBtn, &QToolButton::clicked, this, &CViewportTitleDlg::OnToggleDisplayInfo);
|
||||
// This is here just in case this class hasn't been created before
|
||||
// a VR headset was initialized
|
||||
m_enableVRAction->setEnabled(false);
|
||||
if (AZ::VR::HMDDeviceRequestBus::GetTotalNumOfEventHandlers() != 0)
|
||||
{
|
||||
m_enableVRAction->setEnabled(true);
|
||||
}
|
||||
|
||||
AZ::VR::VREventBus::Handler::BusConnect();
|
||||
|
||||
QFontMetrics metrics({});
|
||||
int width = metrics.boundingRect("-9999.99").width() * m_fieldWidthMultiplier;
|
||||
|
||||
m_cameraSpeed->setFixedWidth(width);
|
||||
|
||||
m_ui->m_toggleHelpersBtn->setProperty("class", "big");
|
||||
m_ui->m_toggleDisplayInfoBtn->setProperty("class", "big");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -177,6 +346,80 @@ void CViewportTitleDlg::OnMaximize()
|
||||
void CViewportTitleDlg::OnToggleHelpers()
|
||||
{
|
||||
Helpers::ToggleHelpers();
|
||||
m_debugHelpersAction->setChecked(Helpers::IsHelpersShown());
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetNoViewportInfo()
|
||||
{
|
||||
AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Broadcast(
|
||||
&AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Events::SetDisplayState, AZ::AtomBridge::ViewportInfoDisplayState::NoInfo);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetNormalViewportInfo()
|
||||
{
|
||||
AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Broadcast(
|
||||
&AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Events::SetDisplayState, AZ::AtomBridge::ViewportInfoDisplayState::NormalInfo);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetFullViewportInfo()
|
||||
{
|
||||
AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Broadcast(
|
||||
&AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Events::SetDisplayState, AZ::AtomBridge::ViewportInfoDisplayState::FullInfo);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetCompactViewportInfo()
|
||||
{
|
||||
AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Broadcast(
|
||||
&AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Events::SetDisplayState, AZ::AtomBridge::ViewportInfoDisplayState::CompactInfo);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CViewportTitleDlg::UpdateDisplayInfo()
|
||||
{
|
||||
if (m_viewportInformationMenu == nullptr)
|
||||
{
|
||||
// Nothing to update, just return;
|
||||
return;
|
||||
}
|
||||
|
||||
AZ::AtomBridge::ViewportInfoDisplayState state = AZ::AtomBridge::ViewportInfoDisplayState::NoInfo;
|
||||
AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::BroadcastResult(
|
||||
state,
|
||||
&AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Events::GetDisplayState
|
||||
);
|
||||
|
||||
m_noInformationAction->setChecked(false);
|
||||
m_normalInformationAction->setChecked(false);
|
||||
m_fullInformationAction->setChecked(false);
|
||||
m_compactInformationAction->setChecked(false);
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case AZ::AtomBridge::ViewportInfoDisplayState::NormalInfo:
|
||||
{
|
||||
m_normalInformationAction->setChecked(true);
|
||||
break;
|
||||
}
|
||||
case AZ::AtomBridge::ViewportInfoDisplayState::FullInfo:
|
||||
{
|
||||
m_fullInformationAction->setChecked(true);
|
||||
break;
|
||||
}
|
||||
case AZ::AtomBridge::ViewportInfoDisplayState::CompactInfo:
|
||||
{
|
||||
m_compactInformationAction->setChecked(true);
|
||||
break;
|
||||
}
|
||||
case AZ::AtomBridge::ViewportInfoDisplayState::NoInfo:
|
||||
default:
|
||||
{
|
||||
m_noInformationAction->setChecked(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_ui->m_debugInformationMenu->setChecked(state != AZ::AtomBridge::ViewportInfoDisplayState::NoInfo);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -184,27 +427,12 @@ void CViewportTitleDlg::OnToggleDisplayInfo()
|
||||
{
|
||||
AZ::AtomBridge::ViewportInfoDisplayState state = AZ::AtomBridge::ViewportInfoDisplayState::NoInfo;
|
||||
AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::BroadcastResult(
|
||||
state,
|
||||
&AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Events::GetDisplayState
|
||||
);
|
||||
state, &AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Events::GetDisplayState);
|
||||
state = aznumeric_cast<AZ::AtomBridge::ViewportInfoDisplayState>(
|
||||
(aznumeric_cast<int>(state)+1) % aznumeric_cast<int>(AZ::AtomBridge::ViewportInfoDisplayState::Invalid));
|
||||
(aznumeric_cast<int>(state) + 1) % aznumeric_cast<int>(AZ::AtomBridge::ViewportInfoDisplayState::Invalid));
|
||||
// SetDisplayState will fire OnViewportInfoDisplayStateChanged and notify us, no need to call UpdateDisplayInfo.
|
||||
AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Broadcast(
|
||||
&AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Events::SetDisplayState,
|
||||
state
|
||||
);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CViewportTitleDlg::UpdateDisplayInfo()
|
||||
{
|
||||
AZ::AtomBridge::ViewportInfoDisplayState state = AZ::AtomBridge::ViewportInfoDisplayState::NoInfo;
|
||||
AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::BroadcastResult(
|
||||
state,
|
||||
&AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Events::GetDisplayState
|
||||
);
|
||||
m_ui->m_toggleDisplayInfoBtn->setChecked(state != AZ::AtomBridge::ViewportInfoDisplayState::NoInfo);
|
||||
&AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Events::SetDisplayState, state);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -277,7 +505,7 @@ void CViewportTitleDlg::CreateFOVMenu()
|
||||
{
|
||||
if (!m_fovMenu)
|
||||
{
|
||||
m_fovMenu = new QMenu(this);
|
||||
m_fovMenu = new QMenu("FOV", this);
|
||||
}
|
||||
|
||||
m_fovMenu->clear();
|
||||
@@ -292,17 +520,6 @@ void CViewportTitleDlg::CreateFOVMenu()
|
||||
connect(action, &QAction::triggered, this, &CViewportTitleDlg::OnMenuFOVCustom);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::PopUpFOVMenu()
|
||||
{
|
||||
if (m_pViewPane == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CreateFOVMenu();
|
||||
m_fovMenu->exec(QCursor::pos());
|
||||
}
|
||||
|
||||
QMenu* const CViewportTitleDlg::GetFovMenu()
|
||||
{
|
||||
CreateFOVMenu();
|
||||
@@ -379,9 +596,9 @@ void CViewportTitleDlg::OnMenuAspectRatioCustom()
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CViewportTitleDlg::CreateAspectMenu()
|
||||
{
|
||||
if (!m_aspectMenu)
|
||||
if (m_aspectMenu == nullptr)
|
||||
{
|
||||
m_aspectMenu = new QMenu(this);
|
||||
m_aspectMenu = new QMenu("Aspect Ratio");
|
||||
}
|
||||
|
||||
m_aspectMenu->clear();
|
||||
@@ -396,23 +613,48 @@ void CViewportTitleDlg::CreateAspectMenu()
|
||||
connect(customAction, &QAction::triggered, this, &CViewportTitleDlg::OnMenuAspectRatioCustom);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::PopUpAspectMenu()
|
||||
{
|
||||
if (!m_pViewPane)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CreateAspectMenu();
|
||||
m_aspectMenu->exec(QCursor::pos());
|
||||
}
|
||||
|
||||
QMenu* const CViewportTitleDlg::GetAspectMenu()
|
||||
{
|
||||
CreateAspectMenu();
|
||||
return m_aspectMenu;
|
||||
}
|
||||
|
||||
QMenu* const CViewportTitleDlg::GetViewportInformationMenu()
|
||||
{
|
||||
CreateViewportInformationMenu();
|
||||
return m_viewportInformationMenu;
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::CreateViewportInformationMenu()
|
||||
{
|
||||
if (m_viewportInformationMenu == nullptr)
|
||||
{
|
||||
m_viewportInformationMenu = new QMenu("Viewport Information");
|
||||
|
||||
m_noInformationAction = new QAction(tr("None"), m_viewportInformationMenu);
|
||||
m_noInformationAction->setCheckable(true);
|
||||
connect(m_noInformationAction, &QAction::triggered, this, &CViewportTitleDlg::SetNoViewportInfo);
|
||||
m_viewportInformationMenu->addAction(m_noInformationAction);
|
||||
|
||||
m_normalInformationAction = new QAction(tr("Normal"), m_viewportInformationMenu);
|
||||
m_normalInformationAction->setCheckable(true);
|
||||
connect(m_normalInformationAction, &QAction::triggered, this, &CViewportTitleDlg::SetNormalViewportInfo);
|
||||
m_viewportInformationMenu->addAction(m_normalInformationAction);
|
||||
|
||||
m_fullInformationAction = new QAction(tr("Full"), m_viewportInformationMenu);
|
||||
m_fullInformationAction->setCheckable(true);
|
||||
connect(m_fullInformationAction, &QAction::triggered, this, &CViewportTitleDlg::SetFullViewportInfo);
|
||||
m_viewportInformationMenu->addAction(m_fullInformationAction);
|
||||
|
||||
m_compactInformationAction = new QAction(tr("Compact"), m_viewportInformationMenu);
|
||||
m_compactInformationAction->setCheckable(true);
|
||||
connect(m_compactInformationAction, &QAction::triggered, this, &CViewportTitleDlg::SetCompactViewportInfo);
|
||||
m_viewportInformationMenu->addAction(m_compactInformationAction);
|
||||
|
||||
UpdateDisplayInfo();
|
||||
}
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::AddResolutionMenus(QMenu* menu, std::function<void(int, int)> callback, const QStringList& customPresets)
|
||||
{
|
||||
static const CRenderViewport::SResolution resolutions[] = {
|
||||
@@ -479,7 +721,7 @@ void CViewportTitleDlg::CreateResolutionMenu()
|
||||
{
|
||||
if (!m_resolutionMenu)
|
||||
{
|
||||
m_resolutionMenu = new QMenu(this);
|
||||
m_resolutionMenu = new QMenu("Resolution");
|
||||
}
|
||||
|
||||
m_resolutionMenu->clear();
|
||||
@@ -494,17 +736,6 @@ void CViewportTitleDlg::CreateResolutionMenu()
|
||||
connect(action, &QAction::triggered, this, &CViewportTitleDlg::OnMenuResolutionCustom);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::PopUpResolutionMenu()
|
||||
{
|
||||
if (!m_pViewPane)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CreateResolutionMenu();
|
||||
m_resolutionMenu->exec(QCursor::pos());
|
||||
}
|
||||
|
||||
QMenu* const CViewportTitleDlg::GetResolutionMenu()
|
||||
{
|
||||
CreateResolutionMenu();
|
||||
@@ -514,14 +745,14 @@ QMenu* const CViewportTitleDlg::GetResolutionMenu()
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CViewportTitleDlg::OnViewportSizeChanged(int width, int height)
|
||||
{
|
||||
m_ui->m_sizeStaticCtrl->setText(QString::fromLatin1("%1 x %2").arg(width).arg(height));
|
||||
m_resolutionMenu->setTitle(QString::fromLatin1("Resolution: %1 x %2").arg(width).arg(height));
|
||||
|
||||
if (width != 0 && height != 0)
|
||||
{
|
||||
// Calculate greatest common divider of width & height
|
||||
int whGCD = gcd(width, height);
|
||||
|
||||
m_ui->m_ratioStaticCtrl->setText(QString::fromLatin1("%1:%2").arg(width / whGCD).arg(height / whGCD));
|
||||
m_aspectMenu->setTitle(QString::fromLatin1("Ratio: %1:%2").arg(width / whGCD).arg(height / whGCD));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,9 +760,9 @@ void CViewportTitleDlg::OnViewportSizeChanged(int width, int height)
|
||||
void CViewportTitleDlg::OnViewportFOVChanged(float fov)
|
||||
{
|
||||
const float degFOV = RAD2DEG(fov);
|
||||
if (m_ui && m_ui->m_fovStaticCtrl)
|
||||
if (m_fovMenu)
|
||||
{
|
||||
m_ui->m_fovStaticCtrl->setText(QString::fromLatin1("%1%2").arg(qRound(degFOV)).arg(QString(QByteArray::fromPercentEncoding("%C2%B0"))));
|
||||
m_fovMenu->setTitle(QString::fromLatin1("FOV: %1%2").arg(qRound(degFOV)).arg(QString(QByteArray::fromPercentEncoding("%C2%B0"))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,7 +772,11 @@ void CViewportTitleDlg::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
switch (event)
|
||||
{
|
||||
case eNotify_OnDisplayRenderUpdate:
|
||||
m_ui->m_toggleHelpersBtn->setChecked(GetIEditor()->GetDisplaySettings()->IsDisplayHelpers());
|
||||
m_debugHelpersAction->setChecked(Helpers::IsHelpersShown());
|
||||
break;
|
||||
case eNotify_OnBeginGameMode:
|
||||
case eNotify_OnEndGameMode:
|
||||
UpdateMuteActionText();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -615,6 +850,132 @@ bool CViewportTitleDlg::eventFilter(QObject* object, QEvent* event)
|
||||
return QWidget::eventFilter(object, event) || consumeEvent;
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnBnClickedSyncplayer()
|
||||
{
|
||||
emit ActionTriggered(ID_GAME_SYNCPLAYER);
|
||||
|
||||
bool bSyncPlayer = GetIEditor()->GetGameEngine()->IsSyncPlayerPosition();
|
||||
m_syncPlayerToCameraAction->setChecked(!bSyncPlayer);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnBnClickedGotoPosition()
|
||||
{
|
||||
emit ActionTriggered(ID_DISPLAY_GOTOPOSITION);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnBnClickedMuteAudio()
|
||||
{
|
||||
gSettings.bMuteAudio = !gSettings.bMuteAudio;
|
||||
|
||||
Audio::AudioSystemRequestBus::Broadcast(
|
||||
&Audio::AudioSystemRequestBus::Events::PushRequest, gSettings.bMuteAudio ? m_oMuteAudioRequest : m_oUnmuteAudioRequest);
|
||||
|
||||
UpdateMuteActionText();
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::UpdateMuteActionText()
|
||||
{
|
||||
m_audioMuteAction->setText(gSettings.bMuteAudio ? tr("Un-mute Audio") : tr("Mute Audio"));
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnHMDInitialized()
|
||||
{
|
||||
m_enableVRAction->setEnabled(true);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnHMDShutdown()
|
||||
{
|
||||
m_enableVRAction->setEnabled(false);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnBnClickedEnableVR()
|
||||
{
|
||||
gSettings.bEnableGameModeVR = !gSettings.bEnableGameModeVR;
|
||||
|
||||
m_enableVRAction->setText(gSettings.bEnableGameModeVR ? tr("Disable VR Preview") : tr("Enable VR Preview"));
|
||||
}
|
||||
|
||||
inline double Round(double fVal, double fStep)
|
||||
{
|
||||
if (fStep > 0.f)
|
||||
{
|
||||
fVal = int_round(fVal / fStep) * fStep;
|
||||
}
|
||||
return fVal;
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetSpeedComboBox(double value)
|
||||
{
|
||||
value = AZStd::clamp(Round(value, m_speedStep), m_minSpeed, m_maxSpeed);
|
||||
|
||||
int index = m_cameraSpeed->findData(value);
|
||||
if (index != -1)
|
||||
{
|
||||
m_cameraSpeed->setCurrentIndex(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_cameraSpeed->lineEdit()->setText(QString().setNum(value, 'f', m_numDecimals));
|
||||
}
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnSpeedComboBoxEnter()
|
||||
{
|
||||
m_cameraSpeed->clearFocus();
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnUpdateMoveSpeedText(const QString& text)
|
||||
{
|
||||
gSettings.cameraMoveSpeed = aznumeric_cast<float>(Round(text.toDouble(), m_speedStep));
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::CheckForCameraSpeedUpdate()
|
||||
{
|
||||
if (gSettings.cameraMoveSpeed != m_prevMoveSpeed && !m_cameraSpeed->lineEdit()->hasFocus())
|
||||
{
|
||||
m_prevMoveSpeed = gSettings.cameraMoveSpeed;
|
||||
SetSpeedComboBox(gSettings.cameraMoveSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnGridSnappingToggled()
|
||||
{
|
||||
m_gridSizeActionWidget->setEnabled(m_enableGridSnappingAction->isChecked());
|
||||
MainWindow::instance()->GetActionManager()->GetAction(ID_SNAP_TO_GRID)->trigger();
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnAngleSnappingToggled()
|
||||
{
|
||||
m_angleSizeActionWidget->setEnabled(m_enableAngleSnappingAction->isChecked());
|
||||
MainWindow::instance()->GetActionManager()->GetAction(ID_SNAPANGLE)->trigger();
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnGridSpinBoxChanged(double value)
|
||||
{
|
||||
SandboxEditor::SetGridSnappingSize(value);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnAngleSpinBoxChanged(double value)
|
||||
{
|
||||
SandboxEditor::SetAngleSnappingSize(value);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::UpdateOverFlowMenuState()
|
||||
{
|
||||
bool gridSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(ID_SNAP_TO_GRID)->isChecked();
|
||||
{
|
||||
QSignalBlocker signalBlocker(m_enableGridSnappingAction);
|
||||
m_enableGridSnappingAction->setChecked(gridSnappingActive);
|
||||
}
|
||||
m_gridSizeActionWidget->setEnabled(gridSnappingActive);
|
||||
|
||||
bool angleSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(ID_SNAPANGLE)->isChecked();
|
||||
{
|
||||
QSignalBlocker signalBlocker(m_enableAngleSnappingAction);
|
||||
m_enableAngleSnappingAction->setChecked(angleSnappingActive);
|
||||
}
|
||||
m_angleSizeActionWidget->setEnabled(angleSnappingActive);
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
@@ -19,8 +19,16 @@
|
||||
#include "RenderViewport.h"
|
||||
#include <AzCore/Component/Component.h>
|
||||
|
||||
#include <IAudioSystem.h>
|
||||
|
||||
#include <functional>
|
||||
#include <QSharedPointer>
|
||||
#include <QWidgetAction>
|
||||
#include <QComboBox>
|
||||
|
||||
#include <AzQtComponents/Components/Widgets/SpinBox.h>
|
||||
|
||||
#include <HMDBus.h>
|
||||
#endif
|
||||
|
||||
// CViewportTitleDlg dialog
|
||||
@@ -42,6 +50,7 @@ class CViewportTitleDlg
|
||||
: public QWidget
|
||||
, public IEditorNotifyListener
|
||||
, public ISystemEventListener
|
||||
, public AZ::VR::VREventBus::Handler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -63,10 +72,15 @@ public:
|
||||
|
||||
bool eventFilter(QObject* object, QEvent* event) override;
|
||||
|
||||
void SetSpeedComboBox(double value);
|
||||
|
||||
QMenu* const GetFovMenu();
|
||||
QMenu* const GetAspectMenu();
|
||||
QMenu* const GetResolutionMenu();
|
||||
|
||||
Q_SIGNALS:
|
||||
void ActionTriggered(int command);
|
||||
|
||||
protected:
|
||||
virtual void OnInitDialog();
|
||||
|
||||
@@ -75,9 +89,20 @@ protected:
|
||||
|
||||
void OnMaximize();
|
||||
void OnToggleHelpers();
|
||||
void OnToggleDisplayInfo();
|
||||
void UpdateDisplayInfo();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// VR Event Bus Implementation
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void OnHMDInitialized() override;
|
||||
void OnHMDShutdown() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void SetupCameraDropdownMenu();
|
||||
void SetupResolutionDropdownMenu();
|
||||
void SetupViewportInformationMenu();
|
||||
void SetupOverflowMenu();
|
||||
|
||||
QString m_title;
|
||||
|
||||
CLayoutViewPane* m_pViewPane;
|
||||
@@ -87,22 +112,84 @@ protected:
|
||||
QStringList m_customFOVPresets;
|
||||
QStringList m_customAspectRatioPresets;
|
||||
|
||||
float m_prevMoveSpeed;
|
||||
|
||||
// Speed combobox/lineEdit settings
|
||||
double m_minSpeed = 0.1;
|
||||
double m_maxSpeed = 100.0;
|
||||
double m_speedStep = 0.1;
|
||||
int m_numDecimals = 1;
|
||||
|
||||
// Speed presets
|
||||
float m_speedPresetValues[3] = { 0.1f, 1.0f, 10.0f };
|
||||
|
||||
double m_fieldWidthMultiplier = 1.8;
|
||||
|
||||
|
||||
void OnMenuFOVCustom();
|
||||
|
||||
void CreateFOVMenu();
|
||||
void PopUpFOVMenu();
|
||||
|
||||
void OnMenuAspectRatioCustom();
|
||||
void CreateAspectMenu();
|
||||
void PopUpAspectMenu();
|
||||
|
||||
void OnMenuResolutionCustom();
|
||||
void CreateResolutionMenu();
|
||||
void PopUpResolutionMenu();
|
||||
|
||||
void CreateViewportInformationMenu();
|
||||
QMenu* const GetViewportInformationMenu();
|
||||
void SetNoViewportInfo();
|
||||
void SetNormalViewportInfo();
|
||||
void SetFullViewportInfo();
|
||||
void SetCompactViewportInfo();
|
||||
|
||||
void OnBnClickedSyncplayer();
|
||||
void OnBnClickedGotoPosition();
|
||||
void OnBnClickedMuteAudio();
|
||||
void OnBnClickedEnableVR();
|
||||
|
||||
void UpdateMuteActionText();
|
||||
|
||||
void OnToggleDisplayInfo();
|
||||
|
||||
void OnSpeedComboBoxEnter();
|
||||
void OnUpdateMoveSpeedText(const QString&);
|
||||
|
||||
void CheckForCameraSpeedUpdate();
|
||||
|
||||
void OnGridSnappingToggled();
|
||||
void OnAngleSnappingToggled();
|
||||
|
||||
void OnGridSpinBoxChanged(double value);
|
||||
void OnAngleSpinBoxChanged(double value);
|
||||
|
||||
void UpdateOverFlowMenuState();
|
||||
|
||||
QMenu* m_fovMenu = nullptr;
|
||||
QMenu* m_aspectMenu = nullptr;
|
||||
QMenu* m_resolutionMenu = nullptr;
|
||||
QMenu* m_viewportInformationMenu = nullptr;
|
||||
QAction* m_noInformationAction = nullptr;
|
||||
QAction* m_normalInformationAction = nullptr;
|
||||
QAction* m_fullInformationAction = nullptr;
|
||||
QAction* m_compactInformationAction = nullptr;
|
||||
QAction* m_debugHelpersAction = nullptr;
|
||||
QAction* m_syncPlayerToCameraAction = nullptr;
|
||||
QAction* m_audioMuteAction = nullptr;
|
||||
QAction* m_enableVRAction = nullptr;
|
||||
QAction* m_enableGridSnappingAction = nullptr;
|
||||
QAction* m_enableAngleSnappingAction = nullptr;
|
||||
QComboBox* m_cameraSpeed = nullptr;
|
||||
AzQtComponents::DoubleSpinBox* m_gridSpinBox = nullptr;
|
||||
AzQtComponents::DoubleSpinBox* m_angleSpinBox = nullptr;
|
||||
QWidgetAction* m_gridSizeActionWidget = nullptr;
|
||||
QWidgetAction* m_angleSizeActionWidget = nullptr;
|
||||
|
||||
Audio::SAudioRequest m_oMuteAudioRequest;
|
||||
Audio::SAudioManagerRequestData<Audio::eAMRT_MUTE_ALL> m_oMuteAudioRequestData;
|
||||
Audio::SAudioRequest m_oUnmuteAudioRequest;
|
||||
Audio::SAudioManagerRequestData<Audio::eAMRT_UNMUTE_ALL> m_oUnmuteAudioRequestData;
|
||||
|
||||
|
||||
QScopedPointer<Ui::ViewportTitleDlg> m_ui;
|
||||
};
|
||||
|
||||
@@ -61,121 +61,43 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_fovLabel">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>FOV:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="m_cameraMenu">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/Menu/camera.svg</normaloff>:/Menu/camera.svg
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_debugInformationMenu">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/Menu/debug.svg</normaloff>:/Menu/debug.svg
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_resolutionMenu">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/Menu/resolution.svg</normaloff>:/Menu/resolution.svg
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_fovStaticCtrl">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>120°</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_ratioLabel">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ratio:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_ratioStaticCtrl">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>000:000</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_sizeStaticCtrl">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0000 x 0000</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="AzQtComponents::ButtonDivider" name="divider1" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_toggleDisplayInfoBtn">
|
||||
<property name="text">
|
||||
<string>Toggle display info</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Toggle display info</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/stylesheet/img/UI20/Info.svg</normaloff>:/stylesheet/img/UI20/Info.svg</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_toggleHelpersBtn">
|
||||
<property name="text">
|
||||
<string>Toggle display helpers</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Toggle display helpers</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/stylesheet/img/UI20/Helpers.svg</normaloff>:/stylesheet/img/UI20/Helpers.svg</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="m_overflowBtn">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/stylesheet/img/UI20/menu-centered.svg</normaloff>:/stylesheet/img/UI20/menu-centered.svg
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -187,6 +109,8 @@
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<resources>
|
||||
<include location="../../Framework/AzQtComponents/AzQtComponents/Images/resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -424,10 +424,6 @@ set(FILES
|
||||
GotoPositionDlg.cpp
|
||||
GotoPositionDlg.h
|
||||
GotoPositionDlg.ui
|
||||
InfoBar.cpp
|
||||
InfoBar.qrc
|
||||
InfoBar.h
|
||||
InfoBar.ui
|
||||
LayoutConfigDialog.cpp
|
||||
LayoutConfigDialog.h
|
||||
LayoutConfigDialog.ui
|
||||
|
||||
Reference in New Issue
Block a user