@@ -55,7 +55,7 @@ AZ_POP_DISABLE_WARNING
|
||||
namespace MaterialEditor
|
||||
{
|
||||
MaterialEditorWindow::MaterialEditorWindow(QWidget* parent /* = 0 */)
|
||||
: AzQtComponents::DockMainWindow(parent)
|
||||
: AzQtComponents::AzQtApplicationWindow(parent, "MaterialEditorWindow")
|
||||
{
|
||||
resize(1280, 1024);
|
||||
|
||||
@@ -82,45 +82,25 @@ namespace MaterialEditor
|
||||
setWindowTitle(QApplication::applicationName());
|
||||
}
|
||||
|
||||
m_advancedDockManager = new AzQtComponents::FancyDocking(this);
|
||||
|
||||
setObjectName("MaterialEditorWindow");
|
||||
setDockNestingEnabled(true);
|
||||
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
|
||||
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
|
||||
setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
|
||||
setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
|
||||
|
||||
m_menuBar = new QMenuBar(this);
|
||||
m_menuBar->setObjectName("MenuBar");
|
||||
setMenuBar(m_menuBar);
|
||||
|
||||
m_toolBar = new MaterialEditorToolBar(this);
|
||||
m_toolBar->setObjectName("ToolBar");
|
||||
addToolBar(m_toolBar);
|
||||
|
||||
m_centralWidget = new QWidget(this);
|
||||
m_tabWidget = new AzQtComponents::TabWidget(m_centralWidget);
|
||||
m_tabWidget->setObjectName("TabWidget");
|
||||
m_tabWidget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
|
||||
m_tabWidget->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
m_materialViewport = new MaterialViewportWidget(m_centralWidget);
|
||||
m_materialViewport->setObjectName("Viewport");
|
||||
m_materialViewport->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
|
||||
QVBoxLayout* vl = new QVBoxLayout(m_centralWidget);
|
||||
|
||||
vl->setMargin(0);
|
||||
vl->setContentsMargins(0, 0, 0, 0);
|
||||
vl->addWidget(m_tabWidget);
|
||||
vl->addWidget(m_materialViewport);
|
||||
m_centralWidget->setLayout(vl);
|
||||
setCentralWidget(m_centralWidget);
|
||||
|
||||
|
||||
m_statusBar = new StatusBarWidget(this);
|
||||
m_statusBar->setObjectName("StatusBar");
|
||||
statusBar()->addPermanentWidget(m_statusBar, 1);
|
||||
|
||||
|
||||
SetupMenu();
|
||||
SetupTabs();
|
||||
|
||||
@@ -738,22 +718,6 @@ namespace MaterialEditor
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialEditorWindow::SelectPreviousTab()
|
||||
{
|
||||
if (m_tabWidget->count() > 1)
|
||||
{
|
||||
// Adding count to wrap around when index <= 0
|
||||
m_tabWidget->setCurrentIndex((m_tabWidget->currentIndex() + m_tabWidget->count() - 1) % m_tabWidget->count());
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialEditorWindow::SelectNextTab()
|
||||
{
|
||||
if (m_tabWidget->count() > 1)
|
||||
{
|
||||
m_tabWidget->setCurrentIndex((m_tabWidget->currentIndex() + 1) % m_tabWidget->count());
|
||||
}
|
||||
}
|
||||
} // namespace MaterialEditor
|
||||
|
||||
#include <Window/moc_MaterialEditorWindow.cpp>
|
||||
|
||||
@@ -12,10 +12,11 @@
|
||||
#include <Atom/Document/MaterialDocumentNotificationBus.h>
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
|
||||
#include <AzQtComponents/Components/DockMainWindow.h>
|
||||
//#include <AzQtComponents/Components/DockMainWindow.h>
|
||||
#include <AzQtComponents/Components/FancyDocking.h>
|
||||
#include <AzQtComponents/Components/StyledDockWidget.h>
|
||||
#include <AzQtComponents/Components/Widgets/TabWidget.h>
|
||||
#include <AzQtComponents/Application/Window/AzQtApplicationWindow.h>
|
||||
|
||||
#include <Atom/Window/MaterialEditorWindowRequestBus.h>
|
||||
#include <Viewport/MaterialViewportWidget.h>
|
||||
@@ -43,7 +44,7 @@ namespace MaterialEditor
|
||||
* 3) MaterialPropertyInspector - The user edits the properties of the selected Material.
|
||||
*/
|
||||
class MaterialEditorWindow
|
||||
: public AzQtComponents::DockMainWindow
|
||||
: public AzQtComponents::AzQtApplicationWindow
|
||||
, private MaterialEditorWindowRequestBus::Handler
|
||||
, private MaterialDocumentNotificationBus::Handler
|
||||
{
|
||||
@@ -74,61 +75,31 @@ namespace MaterialEditor
|
||||
void OnDocumentUndoStateChanged(const AZ::Uuid& documentId) override;
|
||||
void OnDocumentSaved(const AZ::Uuid& documentId) override;
|
||||
|
||||
void SetupMenu();
|
||||
void SetupMenu() override;
|
||||
void SetupTabs() override;
|
||||
|
||||
void SetupTabs();
|
||||
void AddTabForDocumentId(const AZ::Uuid& documentId);
|
||||
void RemoveTabForDocumentId(const AZ::Uuid& documentId);
|
||||
void UpdateTabForDocumentId(const AZ::Uuid& documentId);
|
||||
QString GetDocumentPath(const AZ::Uuid& documentId) const;
|
||||
AZ::Uuid GetDocumentIdFromTab(const int tabIndex) const;
|
||||
QString GetDocumentPath(const AZ::Uuid& documentId) const;
|
||||
|
||||
void OpenTabContextMenu();
|
||||
void SelectPreviousTab();
|
||||
void SelectNextTab();
|
||||
void OpenTabContextMenu() override;
|
||||
|
||||
void closeEvent(QCloseEvent* closeEvent) override;
|
||||
|
||||
AzQtComponents::FancyDocking* m_advancedDockManager = nullptr;
|
||||
QWidget* m_centralWidget = nullptr;
|
||||
QMenuBar* m_menuBar = nullptr;
|
||||
AzQtComponents::TabWidget* m_tabWidget = nullptr;
|
||||
MaterialViewportWidget* m_materialViewport = nullptr;
|
||||
MaterialEditorToolBar* m_toolBar = nullptr;
|
||||
|
||||
AZStd::unordered_map <AZStd::string, AzQtComponents::StyledDockWidget*> m_dockWidgets;
|
||||
|
||||
QMenu* m_menuFile = {};
|
||||
QAction* m_actionNew = {};
|
||||
QAction* m_actionOpen = {};
|
||||
QAction* m_actionOpenRecent = {};
|
||||
QAction* m_actionClose = {};
|
||||
QAction* m_actionCloseAll = {};
|
||||
QAction* m_actionCloseOthers = {};
|
||||
QAction* m_actionSave = {};
|
||||
QAction* m_actionSaveAsCopy = {};
|
||||
QAction* m_actionSaveAsChild = {};
|
||||
QAction* m_actionSaveAll = {};
|
||||
QAction* m_actionExit = {};
|
||||
|
||||
QMenu* m_menuEdit = {};
|
||||
QAction* m_actionUndo = {};
|
||||
QAction* m_actionRedo = {};
|
||||
QAction* m_actionSettings = {};
|
||||
|
||||
QMenu* m_menuView = {};
|
||||
QAction* m_actionAssetBrowser = {};
|
||||
QAction* m_actionInspector = {};
|
||||
QAction* m_actionConsole = {};
|
||||
QAction* m_actionPythonTerminal = {};
|
||||
QAction* m_actionPerfMonitor = {};
|
||||
QAction* m_actionViewportSettings = {};
|
||||
QAction* m_actionNextTab = {};
|
||||
QAction* m_actionPreviousTab = {};
|
||||
|
||||
QMenu* m_menuHelp = {};
|
||||
QAction* m_actionHelp = {};
|
||||
QAction* m_actionAbout = {};
|
||||
|
||||
StatusBarWidget* m_statusBar = {};
|
||||
};
|
||||
|
||||
-2
@@ -152,7 +152,6 @@ namespace ShaderManagementConsole
|
||||
{
|
||||
AzFramework::AssetSystemStatusBus::Handler::BusConnect();
|
||||
AzToolsFramework::EditorPythonConsoleNotificationBus::Handler::BusConnect();
|
||||
AZ::Debug::TraceMessageBus::Handler::BusConnect();
|
||||
|
||||
AzFramework::Application::StartCommon(systemEntity);
|
||||
|
||||
@@ -164,7 +163,6 @@ namespace ShaderManagementConsole
|
||||
void ShaderManagementConsoleApplication::OnShaderManagementConsoleWindowClosing()
|
||||
{
|
||||
ExitMainLoop();
|
||||
AZ::Debug::TraceMessageBus::Handler::BusDisconnect();
|
||||
ShaderManagementConsoleWindowNotificationBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorPythonConsoleNotificationBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
+5
-38
@@ -37,30 +37,14 @@ AZ_POP_DISABLE_WARNING
|
||||
namespace ShaderManagementConsole
|
||||
{
|
||||
ShaderManagementConsoleWindow::ShaderManagementConsoleWindow(QWidget* parent /* = 0 */)
|
||||
: AzQtComponents::DockMainWindow(parent)
|
||||
: AzQtComponents::AzQtApplicationWindow(parent, "ShaderManagementConsoleWindow")
|
||||
{
|
||||
setWindowTitle("Shader Management Console");
|
||||
|
||||
m_advancedDockManager = new AzQtComponents::FancyDocking(this);
|
||||
|
||||
setDockNestingEnabled(true);
|
||||
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
|
||||
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
|
||||
setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
|
||||
setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
|
||||
|
||||
m_menuBar = new QMenuBar(this);
|
||||
setMenuBar(m_menuBar);
|
||||
|
||||
m_toolBar = new ShaderManagementConsoleToolBar(this);
|
||||
m_toolBar->setObjectName("ToolBar");
|
||||
addToolBar(m_toolBar);
|
||||
|
||||
m_centralWidget = new QWidget(this);
|
||||
m_tabWidget = new AzQtComponents::TabWidget(m_centralWidget);
|
||||
m_tabWidget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
|
||||
m_tabWidget->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QVBoxLayout* vl = new QVBoxLayout(m_centralWidget);
|
||||
vl->setMargin(0);
|
||||
vl->setContentsMargins(0, 0, 0, 0);
|
||||
vl->addWidget(m_tabWidget);
|
||||
@@ -143,7 +127,7 @@ namespace ShaderManagementConsole
|
||||
|
||||
m_actionUndo->setEnabled(canUndo);
|
||||
m_actionRedo->setEnabled(canRedo);
|
||||
m_actionPreferences->setEnabled(false);
|
||||
m_actionSettings->setEnabled(false);
|
||||
|
||||
m_actionAssetBrowser->setEnabled(true);
|
||||
m_actionPythonTerminal->setEnabled(true);
|
||||
@@ -263,9 +247,9 @@ namespace ShaderManagementConsole
|
||||
|
||||
m_menuEdit->addSeparator();
|
||||
|
||||
m_actionPreferences = m_menuEdit->addAction("&Preferences...", [this]() {
|
||||
m_actionSettings = m_menuEdit->addAction("&Preferences...", [this]() {
|
||||
}, QKeySequence::Preferences);
|
||||
m_actionPreferences->setEnabled(false);
|
||||
m_actionSettings->setEnabled(false);
|
||||
|
||||
m_menuView = m_menuBar->addMenu("&View");
|
||||
|
||||
@@ -471,23 +455,6 @@ namespace ShaderManagementConsole
|
||||
}
|
||||
}
|
||||
|
||||
void ShaderManagementConsoleWindow::SelectPreviousTab()
|
||||
{
|
||||
if (m_tabWidget->count() > 1)
|
||||
{
|
||||
// Adding count to wrap around when index <= 0
|
||||
m_tabWidget->setCurrentIndex((m_tabWidget->currentIndex() + m_tabWidget->count() - 1) % m_tabWidget->count());
|
||||
}
|
||||
}
|
||||
|
||||
void ShaderManagementConsoleWindow::SelectNextTab()
|
||||
{
|
||||
if (m_tabWidget->count() > 1)
|
||||
{
|
||||
m_tabWidget->setCurrentIndex((m_tabWidget->currentIndex() + 1) % m_tabWidget->count());
|
||||
}
|
||||
}
|
||||
|
||||
void ShaderManagementConsoleWindow::SelectDocumentForTab(const int tabIndex)
|
||||
{
|
||||
const AZ::Uuid documentId = GetDocumentIdFromTab(tabIndex);
|
||||
|
||||
+6
-38
@@ -15,10 +15,11 @@
|
||||
#include <Atom/RPI.Edit/Shader/ShaderVariantListSourceData.h>
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
|
||||
#include <AzQtComponents/Components/DockMainWindow.h>
|
||||
//#include <AzQtComponents/Components/DockMainWindow.h>
|
||||
#include <AzQtComponents/Components/FancyDocking.h>
|
||||
#include <AzQtComponents/Components/StyledDockWidget.h>
|
||||
#include <AzQtComponents/Components/Widgets/TabWidget.h>
|
||||
#include <AzQtComponents/Application/Window/AzQtApplicationWindow.h>
|
||||
|
||||
#include <Window/ShaderManagementConsoleBrowserWidget.h>
|
||||
#include <Window/ToolBar/ShaderManagementConsoleToolBar.h>
|
||||
@@ -41,7 +42,7 @@ namespace ShaderManagementConsole
|
||||
* its panels, managing selection of assets, and performing high-level actions like saving. It contains...
|
||||
*/
|
||||
class ShaderManagementConsoleWindow
|
||||
: public AzQtComponents::DockMainWindow
|
||||
: public AzQtComponents::AzQtApplicationWindow
|
||||
, private ShaderManagementConsoleDocumentNotificationBus::Handler
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -59,17 +60,15 @@ namespace ShaderManagementConsole
|
||||
void OnDocumentUndoStateChanged(const AZ::Uuid& documentId) override;
|
||||
void OnDocumentSaved(const AZ::Uuid& documentId) override;
|
||||
|
||||
void SetupMenu();
|
||||
void SetupMenu() override;
|
||||
void SetupTabs() override;
|
||||
|
||||
void SetupTabs();
|
||||
void AddTabForDocumentId(const AZ::Uuid& documentId);
|
||||
void RemoveTabForDocumentId(const AZ::Uuid& documentId);
|
||||
void UpdateTabForDocumentId(const AZ::Uuid& documentId);
|
||||
AZ::Uuid GetDocumentIdFromTab(const int tabIndex) const;
|
||||
|
||||
void OpenTabContextMenu();
|
||||
void SelectPreviousTab();
|
||||
void SelectNextTab();
|
||||
void OpenTabContextMenu() override;
|
||||
|
||||
void SelectDocumentForTab(const int tabIndex);
|
||||
void CloseDocumentForTab(const int tabIndex);
|
||||
@@ -79,42 +78,11 @@ namespace ShaderManagementConsole
|
||||
|
||||
void CreateDocumentContent(const AZ::Uuid& documentId, QStandardItemModel* model);
|
||||
|
||||
AzQtComponents::FancyDocking* m_advancedDockManager = nullptr;
|
||||
QMenuBar* m_menuBar = nullptr;
|
||||
QWidget* m_centralWidget = nullptr;
|
||||
AzQtComponents::TabWidget* m_tabWidget = nullptr;
|
||||
ShaderManagementConsoleBrowserWidget* m_assetBrowser = nullptr;
|
||||
ShaderManagementConsoleToolBar* m_toolBar = nullptr;
|
||||
AzToolsFramework::CScriptTermDialog* m_pythonTerminal = nullptr;
|
||||
|
||||
AzQtComponents::StyledDockWidget* m_assetBrowserDockWidget = nullptr;
|
||||
AzQtComponents::StyledDockWidget* m_pythonTerminalDockWidget = nullptr;
|
||||
|
||||
QMenu* m_menuFile = {};
|
||||
QMenu* m_menuNew = {};
|
||||
QAction* m_actionOpen = {};
|
||||
QAction* m_actionOpenRecent = {};
|
||||
QAction* m_actionClose = {};
|
||||
QAction* m_actionCloseAll = {};
|
||||
QAction* m_actionCloseOthers = {};
|
||||
QAction* m_actionSave = {};
|
||||
QAction* m_actionSaveAsCopy = {};
|
||||
QAction* m_actionSaveAll = {};
|
||||
QAction* m_actionExit = {};
|
||||
|
||||
QMenu* m_menuEdit = {};
|
||||
QAction* m_actionUndo = {};
|
||||
QAction* m_actionRedo = {};
|
||||
QAction* m_actionPreferences = {};
|
||||
|
||||
QMenu* m_menuView = {};
|
||||
QAction* m_actionAssetBrowser = {};
|
||||
QAction* m_actionPythonTerminal = {};
|
||||
QAction* m_actionNextTab = {};
|
||||
QAction* m_actionPreviousTab = {};
|
||||
|
||||
QMenu* m_menuHelp = {};
|
||||
QAction* m_actionHelp = {};
|
||||
QAction* m_actionAbout = {};
|
||||
};
|
||||
} // namespace ShaderManagementConsole
|
||||
|
||||
Reference in New Issue
Block a user