Remove Tab Overlay on Project Manager Startup + More Fixes (#3666)
* Refocuses from tab to button on projects screen fist time it is opened Signed-off-by: nggieber <nggieber@amazon.com> * Adds border highlighting to big buttons when they are focused Signed-off-by: nggieber <nggieber@amazon.com> * Fixes issues where project buttons aren't found or deleted on projects screen Signed-off-by: nggieber <nggieber@amazon.com> * Adds tooltip to project name showing project path Signed-off-by: nggieber <nggieber@amazon.com>
This commit is contained in:
@@ -192,6 +192,7 @@ namespace O3DE::ProjectManager
|
||||
projectFooter->setLayout(hLayout);
|
||||
{
|
||||
QLabel* projectNameLabel = new QLabel(m_projectInfo.GetProjectDisplayName(), this);
|
||||
projectNameLabel->setToolTip(m_projectInfo.m_path);
|
||||
hLayout->addWidget(projectNameLabel);
|
||||
|
||||
QMenu* menu = new QMenu(this);
|
||||
|
||||
@@ -65,6 +65,16 @@ namespace O3DE::ProjectManager
|
||||
vLayout->addWidget(m_stack);
|
||||
|
||||
connect(reinterpret_cast<ScreensCtrl*>(parent), &ScreensCtrl::NotifyBuildProject, this, &ProjectsScreen::SuggestBuildProject);
|
||||
|
||||
// Will focus whatever button it finds so the Project tab is not focused on start-up
|
||||
QTimer::singleShot(0, this, [this]
|
||||
{
|
||||
QPushButton* foundButton = m_stack->currentWidget()->findChild<QPushButton*>();
|
||||
if (foundButton)
|
||||
{
|
||||
foundButton->setFocus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ProjectsScreen::~ProjectsScreen()
|
||||
@@ -166,7 +176,7 @@ namespace O3DE::ProjectManager
|
||||
ProjectButton* ProjectsScreen::CreateProjectButton(const ProjectInfo& project)
|
||||
{
|
||||
ProjectButton* projectButton = new ProjectButton(project, this);
|
||||
m_projectButtons.insert(project.m_path, projectButton);
|
||||
m_projectButtons.insert(QDir::toNativeSeparators(project.m_path), projectButton);
|
||||
m_projectsFlowLayout->addWidget(projectButton);
|
||||
|
||||
connect(projectButton, &ProjectButton::OpenProject, this, &ProjectsScreen::HandleOpenProject);
|
||||
@@ -193,7 +203,7 @@ namespace O3DE::ProjectManager
|
||||
QSet<QString> keepProject;
|
||||
for (const ProjectInfo& project : projectsVector)
|
||||
{
|
||||
keepProject.insert(project.m_path);
|
||||
keepProject.insert(QDir::toNativeSeparators(project.m_path));
|
||||
}
|
||||
|
||||
// Clear flow and delete buttons for removed projects
|
||||
@@ -204,6 +214,7 @@ namespace O3DE::ProjectManager
|
||||
|
||||
if (!keepProject.contains(projectButtonsIter.key()))
|
||||
{
|
||||
projectButtonsIter.value()->deleteLater();
|
||||
projectButtonsIter = m_projectButtons.erase(projectButtonsIter);
|
||||
}
|
||||
else
|
||||
@@ -215,7 +226,7 @@ namespace O3DE::ProjectManager
|
||||
QString buildProjectPath = "";
|
||||
if (m_currentBuilder)
|
||||
{
|
||||
buildProjectPath = m_currentBuilder->GetProjectInfo().m_path;
|
||||
buildProjectPath = QDir::toNativeSeparators(m_currentBuilder->GetProjectInfo().m_path);
|
||||
}
|
||||
|
||||
// Put currently building project in front, then queued projects, then sorts alphabetically
|
||||
@@ -249,13 +260,13 @@ namespace O3DE::ProjectManager
|
||||
// Add any missing project buttons and restore buttons to default state
|
||||
for (const ProjectInfo& project : projectsVector)
|
||||
{
|
||||
if (!m_projectButtons.contains(project.m_path))
|
||||
if (!m_projectButtons.contains(QDir::toNativeSeparators(project.m_path)))
|
||||
{
|
||||
m_projectButtons.insert(project.m_path, CreateProjectButton(project));
|
||||
m_projectButtons.insert(QDir::toNativeSeparators(project.m_path), CreateProjectButton(project));
|
||||
}
|
||||
else
|
||||
{
|
||||
auto projectButtonIter = m_projectButtons.find(project.m_path);
|
||||
auto projectButtonIter = m_projectButtons.find(QDir::toNativeSeparators(project.m_path));
|
||||
if (projectButtonIter != m_projectButtons.end())
|
||||
{
|
||||
projectButtonIter.value()->RestoreDefaultState();
|
||||
@@ -273,7 +284,7 @@ namespace O3DE::ProjectManager
|
||||
|
||||
for (const ProjectInfo& project : m_buildQueue)
|
||||
{
|
||||
auto projectIter = m_projectButtons.find(project.m_path);
|
||||
auto projectIter = m_projectButtons.find(QDir::toNativeSeparators(project.m_path));
|
||||
if (projectIter != m_projectButtons.end())
|
||||
{
|
||||
projectIter.value()->SetProjectButtonAction(
|
||||
@@ -288,7 +299,7 @@ namespace O3DE::ProjectManager
|
||||
|
||||
for (const ProjectInfo& project : m_requiresBuild)
|
||||
{
|
||||
auto projectIter = m_projectButtons.find(project.m_path);
|
||||
auto projectIter = m_projectButtons.find(QDir::toNativeSeparators(project.m_path));
|
||||
if (projectIter != m_projectButtons.end())
|
||||
{
|
||||
if (project.m_buildFailed)
|
||||
|
||||
@@ -19,7 +19,7 @@ QT_FORWARD_DECLARE_CLASS(QTabWidget)
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
class ScreenWidget;
|
||||
QT_FORWARD_DECLARE_CLASS(ScreenWidget);
|
||||
|
||||
class ScreensCtrl
|
||||
: public QWidget
|
||||
|
||||
Reference in New Issue
Block a user