Merge pull request #7105 from aws-lumberyard-dev/Atom/guthadam/atom_tools_replace_custom_help_dialog_with_message_box
Atom Tools: Replaced custom help dialog with generic message box
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Window/HelpDialog/HelpDialog.h>
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
HelpDialog::HelpDialog(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::HelpDialogWidget)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
HelpDialog::~HelpDialog() = default;
|
||||
} // namespace MaterialEditor
|
||||
|
||||
#include <Window/HelpDialog/moc_HelpDialog.cpp>
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
|
||||
#include <QDialog>
|
||||
#include <Window/HelpDialog/ui_HelpDialog.h>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class HelpDialogWidget;
|
||||
}
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
//! Displays help for Material Editor
|
||||
class HelpDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
HelpDialog(QWidget* parent = nullptr);
|
||||
~HelpDialog();
|
||||
|
||||
QScopedPointer<Ui::HelpDialogWidget> m_ui;
|
||||
};
|
||||
} // namespace MaterialEditor
|
||||
@@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>HelpDialogWidget</class>
|
||||
<widget class="QDialog" name="HelpDialogWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>270</width>
|
||||
<height>210</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Material Editor Help</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="m_helpText">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Material Editor Controls</span></p><p><span style=" font-weight:600;">LMB</span> - pan camera</p><p><span style=" font-weight:600;">RMB</span> or <span style=" font-weight:600;">Alt+LMB</span> - orbit camera around target</p><p><span style=" font-weight:600;">MMB</span> or <span style=" font-weight:600;">Alt+MMB</span> - move camera on its xy plane</p><p><span style=" font-weight:600;">Alt+RMB</span> or <span style=" font-weight:600;">LMB+RMB</span> - dolly camera on its z axis</p><p><span style=" font-weight:600;">Ctrl+LMB</span> - rotate model</p><p><span style=" font-weight:600;">Shift+LMB</span> - rotate environment</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>HelpDialogWidget</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>HelpDialogWidget</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <Document/MaterialDocumentRequestBus.h>
|
||||
#include <Viewport/MaterialViewportWidget.h>
|
||||
#include <Window/CreateMaterialDialog/CreateMaterialDialog.h>
|
||||
#include <Window/HelpDialog/HelpDialog.h>
|
||||
#include <Window/MaterialEditorWindow.h>
|
||||
#include <Window/MaterialEditorWindowSettings.h>
|
||||
#include <Window/MaterialInspector/MaterialInspector.h>
|
||||
@@ -30,6 +29,7 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnin
|
||||
#include <QCloseEvent>
|
||||
#include <QDesktopServices>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QUrl>
|
||||
#include <QWindow>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
@@ -178,8 +178,22 @@ namespace MaterialEditor
|
||||
|
||||
void MaterialEditorWindow::OpenHelp()
|
||||
{
|
||||
HelpDialog dialog(this);
|
||||
dialog.exec();
|
||||
QMessageBox::information(
|
||||
this, windowTitle(),
|
||||
R"(<html><head/><body>
|
||||
<p><h3><u>Material Editor Controls</u></h3></p>
|
||||
<p><b>LMB</b> - pan camera</p>
|
||||
<p><b>RMB</b> or <b>Alt+LMB</b> - orbit camera around target</p>
|
||||
<p><b>MMB</b> or <b>Alt+MMB</b> - move camera on its xy plane</p>
|
||||
<p><b>Alt+RMB</b> or <b>LMB+RMB</b> - dolly camera on its z axis</p>
|
||||
<p><b>Ctrl+LMB</b> - rotate model</p>
|
||||
<p><b>Shift+LMB</b> - rotate environment</p>
|
||||
</body></html>)");
|
||||
}
|
||||
|
||||
void MaterialEditorWindow::OpenAbout()
|
||||
{
|
||||
QMessageBox::about(this, windowTitle(), QApplication::applicationName());
|
||||
}
|
||||
|
||||
void MaterialEditorWindow::closeEvent(QCloseEvent* closeEvent)
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace MaterialEditor
|
||||
bool GetOpenDocumentParams(AZStd::string& openPath) override;
|
||||
void OpenSettings() override;
|
||||
void OpenHelp() override;
|
||||
void OpenAbout() override;
|
||||
|
||||
void closeEvent(QCloseEvent* closeEvent) override;
|
||||
|
||||
|
||||
@@ -89,7 +89,4 @@ set(FILES
|
||||
Source/Window/MaterialInspector/MaterialInspector.cpp
|
||||
Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h
|
||||
Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp
|
||||
Source/Window/HelpDialog/HelpDialog.h
|
||||
Source/Window/HelpDialog/HelpDialog.cpp
|
||||
Source/Window/HelpDialog/HelpDialog.ui
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user