Styling fixes and AzQtAppWindow changes
Signed-off-by: Dayo Lawal <lawalfua@amazon.com>
This commit is contained in:
@@ -31,7 +31,7 @@ namespace AzQtComponents
|
||||
QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
|
||||
}
|
||||
|
||||
void AzQtApplication::SetDpiScaling()
|
||||
void AzQtApplication::InitializeDpiScaling()
|
||||
{
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
@@ -39,6 +39,5 @@ namespace AzQtComponents
|
||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||
AzQtComponents::Utilities::HandleDpiAwareness(AzQtComponents::Utilities::SystemDpiAware);
|
||||
}
|
||||
|
||||
} // namespace AzQtComponents
|
||||
|
||||
|
||||
@@ -25,9 +25,11 @@ namespace AzQtComponents
|
||||
public:
|
||||
AzQtApplication(int& argc, char** argv);
|
||||
|
||||
//! DPI Scaling so that we support HighDpi monitors, like the Retina displays on Windows 10
|
||||
//! Must be set before QApplication is initialized,
|
||||
static void SetDpiScaling();
|
||||
//! Initializes Qt DPI scaling to handle displays with high display densities, such as Retina displays.
|
||||
//! Currently, this uses Qt's system DPI awareness, in which a common device scaling factor will be
|
||||
//! calculated across all attached screens.
|
||||
//! \warning This must be called before this AzQtApplication instance is initialized.
|
||||
static void InitializeDpiScaling();
|
||||
};
|
||||
|
||||
} // namespace AzQtComponents
|
||||
|
||||
+1
-33
@@ -16,46 +16,14 @@
|
||||
|
||||
namespace AzQtComponents
|
||||
{
|
||||
AzQtApplicationWindow::AzQtApplicationWindow(QWidget* parent /* = 0 */, const AZStd::string& objectName)
|
||||
AzQtApplicationWindow::AzQtApplicationWindow(QWidget* parent /* = 0 */)
|
||||
: AzQtComponents::DockMainWindow(parent)
|
||||
{
|
||||
m_advancedDockManager = new AzQtComponents::FancyDocking(this);
|
||||
|
||||
setObjectName(objectName.c_str());
|
||||
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_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);
|
||||
|
||||
vl = new QVBoxLayout(m_centralWidget);
|
||||
}
|
||||
|
||||
void AzQtApplicationWindow::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 AzQtApplicationWindow::SelectNextTab()
|
||||
{
|
||||
if (m_tabWidget->count() > 1)
|
||||
{
|
||||
m_tabWidget->setCurrentIndex((m_tabWidget->currentIndex() + 1) % m_tabWidget->count());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-34
@@ -42,7 +42,7 @@ namespace AzQtComponents
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AzQtApplicationWindow(QWidget* parent, const AZStd::string& objectName);
|
||||
AzQtApplicationWindow(QWidget* parent);
|
||||
|
||||
protected:
|
||||
virtual void SetupMenu() {};
|
||||
@@ -50,40 +50,7 @@ namespace AzQtComponents
|
||||
|
||||
virtual void OpenTabContextMenu() {};
|
||||
|
||||
void SelectPreviousTab();
|
||||
void SelectNextTab();
|
||||
|
||||
AzQtComponents::FancyDocking* m_advancedDockManager = nullptr;
|
||||
QMenuBar* m_menuBar = nullptr;
|
||||
QWidget* m_centralWidget = nullptr;
|
||||
AzQtComponents::TabWidget* m_tabWidget = nullptr;
|
||||
|
||||
QVBoxLayout* vl;
|
||||
|
||||
QMenu* m_menuFile = {};
|
||||
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_actionSettings = {};
|
||||
|
||||
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