Merge branch 'development' into optimization/unused_files

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

# Conflicts:
#	Code/Editor/IEditorImpl.cpp
#	Code/Editor/IEditorImpl.h
#	Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake
This commit is contained in:
Esteban Papp
2022-01-25 15:40:30 -08:00
871 changed files with 19489 additions and 7437 deletions
@@ -411,18 +411,6 @@ namespace AzQtComponents
}
break;
case CE_HeaderSection:
{
if (qobject_cast<const QHeaderView*>(widget))
{
if (TableView::drawHeaderSection(this, option, painter, widget, m_data->tableViewConfig))
{
return;
}
}
}
break;
case CE_ComboBoxLabel:
{
if (qobject_cast<const QComboBox*>(widget))
@@ -134,7 +134,7 @@ namespace AzQtComponents
QColor color;
QString colorName(m_namedVariables.value(name));
bool colorSet = false;
[[maybe_unused]] bool colorSet = false;
if (QColor::isValidColor(colorName))
{
color.setNamedColor(colorName);
@@ -32,7 +32,8 @@ namespace AzQtComponents
{
if (QWidget* widget = item->widget())
{
toolbar->addWidget(widget);
QAction* action = toolbar->addWidget(widget);
action->setObjectName(widget->objectName());
}
else if (item->spacerItem())
{
@@ -12,13 +12,12 @@
AZ_PUSH_DISABLE_WARNING(4244 4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags<Qt::AlignmentFlag>' needs to have dll-interface to be used by clients of class 'QLayoutItem'
#include <QHBoxLayout>
#include <QToolButton>
#include <QToolBar>
#include <QLabel>
#include <QHBoxLayout>
#include <QSettings>
#include <QMenu>
#include <QResizeEvent>
#include <QSettings>
#include <QToolBar>
#include <QToolButton>
AZ_POP_DISABLE_WARNING
namespace AzQtComponents
@@ -46,7 +45,7 @@ namespace AzQtComponents
m_label = new QLabel(this);
m_label->setObjectName(g_labelName);
boxLayout->addWidget(m_label);
m_label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
m_label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
connect(m_label, &QLabel::linkActivated, this, &BreadCrumbs::onLinkActivated);
}
@@ -82,9 +81,38 @@ namespace AzQtComponents
// clean up the path to use all the first separator in the list of separators
m_currentPath.replace(g_windowsSeparator, g_separator);
// update internals
m_currentPathSize = m_currentPath.split(g_separator, Qt::SkipEmptyParts).size();
m_currentPathIcons.resize(m_currentPathSize);
fillLabel();
}
void BreadCrumbs::setDefaultIcon(const QString& icon)
{
m_defaultIcon = icon;
}
void BreadCrumbs::setIconAt(int index, const QString& icon)
{
if (index < 0 || index >= m_currentPathSize)
{
return;
}
m_currentPathIcons[index] = icon;
}
QIcon BreadCrumbs::iconAt(int index)
{
if (index < 0 || index >= m_currentPathSize || m_currentPathIcons[index].isNull())
{
return QIcon(m_defaultIcon);
}
return QIcon(m_currentPathIcons[index]);
}
bool BreadCrumbs::getPushPathOnLinkActivation() const
{
return m_pushPathOnLinkActivation;
@@ -220,6 +248,26 @@ namespace AzQtComponents
QWidget::resizeEvent(event);
}
QString BreadCrumbs::generateIconHtml(int index)
{
QString imagePath;
if (index >= 0 && index < m_currentPathIcons.size())
{
imagePath = m_currentPathIcons[index];
}
if (imagePath.isEmpty())
{
imagePath = m_defaultIcon;
}
return !imagePath.isEmpty() ? QStringLiteral("<img width=\"16\" height=\"16\" style=\"vertical-align: middle\" src=\"%1\">%2%2")
.arg(imagePath)
.arg("&nbsp;")
: "";
}
void BreadCrumbs::fillLabel()
{
QString htmlString = "";
@@ -247,7 +295,10 @@ namespace AzQtComponents
plainTextPath = m_truncatedPaths.takeLast();
}
htmlString.prepend(plainTextPath);
int index = m_currentPathSize - 1;
htmlString.prepend(generateIconHtml(index) + plainTextPath);
--index;
while (!m_truncatedPaths.isEmpty())
{
@@ -262,7 +313,7 @@ namespace AzQtComponents
const QString linkPath = buildPathFromList(fullPath, m_truncatedPaths.size());
const QString& part = m_truncatedPaths.takeLast();
htmlString.prepend(QString("%1").arg(formatLink(linkPath, part)));
htmlString.prepend(QString("%1%2").arg(generateIconHtml(index--)).arg(formatLink(linkPath, part)));
}
m_label->setText(htmlString);
@@ -78,6 +78,13 @@ namespace AzQtComponents
//! Sets the current breadcrumb path without updating the navigation stack.
void setCurrentPath(const QString& newPath);
//! Sets a default icon for path elements.
void setDefaultIcon(const QString& iconPath);
//! Sets an icon for the path element at index.
void setIconAt(int index, const QString& iconPath);
//! Gets the icon for the path element at index.
QIcon iconAt(int index);
//! Returns true if activating a link should automatically push a new path to the navigation stack.
bool getPushPathOnLinkActivation() const;
//! Sets whether activating a link should automatically push a new path to the navigation stack.
@@ -134,6 +141,7 @@ namespace AzQtComponents
void onLinkActivated(const QString& link);
private:
QString generateIconHtml(int index);
void fillLabel();
void changePath(const QString& newPath);
@@ -155,6 +163,14 @@ namespace AzQtComponents
QStringList m_truncatedPaths;
AZ_POP_DISABLE_WARNING
bool m_pushPathOnLinkActivation = true;
int m_currentPathSize = 0;
QString m_defaultIcon;
AZ_PUSH_DISABLE_WARNING(
4251, "-Wunknown-warning-option") // 4251: 'AzQtComponents::BreadCrumbs::m_currentPathIcons': class 'QVector<QIcon>' needs to have
// dll-interface to be used by clients of class 'AzQtComponents::BreadCrumbs'
QVector<QString> m_currentPathIcons;
AZ_POP_DISABLE_WARNING
friend class Style;
@@ -38,7 +38,6 @@ namespace AzQtComponents
ConfigHelpers::read<qreal>(settings, QStringLiteral("FocusBorderWidth"), config.focusBorderWidth);
ConfigHelpers::read<QColor>(settings, QStringLiteral("FocusBorderColor"), config.focusBorderColor);
ConfigHelpers::read<QColor>(settings, QStringLiteral("FocusFillColor"), config.focusFillColor);
ConfigHelpers::read<QColor>(settings, QStringLiteral("HeaderFillColor"), config.headerFillColor);
settings.endGroup();
return config;
@@ -52,7 +51,6 @@ namespace AzQtComponents
config.focusBorderWidth = 1;
config.focusBorderColor = QStringLiteral("#94D2FF");
config.focusFillColor = QStringLiteral("#10ffffff");
config.headerFillColor = QStringLiteral("#2d2d2d");
return config;
}
@@ -177,22 +175,6 @@ namespace AzQtComponents
return true;
}
bool TableView::drawHeaderSection(const Style* style, const QStyleOption* option, QPainter* painter, const QWidget* widget, const Config& config)
{
Q_UNUSED(widget);
Q_UNUSED(style);
const auto headerViewOption = qstyleoption_cast<const QStyleOptionHeader*>(option);
if (!headerViewOption)
{
return false;
}
painter->fillRect(headerViewOption->rect, config.headerFillColor);
return true;
}
bool TableView::drawFrameFocusRect(const Style* style, const QStyleOption* option, QPainter* painter, const Config& config)
{
Q_UNUSED(style);
@@ -62,7 +62,6 @@ namespace AzQtComponents
qreal focusBorderWidth;
QColor focusBorderColor;
QColor focusFillColor;
QColor headerFillColor;
};
/*!
@@ -93,7 +92,6 @@ namespace AzQtComponents
private:
static bool drawHeader(const Style* style, const QStyleOption* option, QPainter* painter, const QWidget* widget, const Config& config);
static bool drawHeaderSection(const Style* style, const QStyleOption* option, QPainter* painter, const QWidget* widget, const Config& config);
static bool drawFrameFocusRect(const Style* style, const QStyleOption* option, QPainter* painter, const Config& config);
static QRect itemViewItemRect(const Style* style, QStyle::SubElement element, const QStyleOptionViewItem* option, const QWidget* widget, const Config& config);
static QSize sizeFromContents(const Style* style, QStyle::ContentsType type, const QStyleOption* option, const QSize& contentsSize, const QWidget* widget, const Config& config);
@@ -66,7 +66,7 @@ QTreeView QHeaderView::section
{
height: 24px;
background: #444444;
background: #2d2d2d;
border: none;
font-size: 12px;
@@ -134,6 +134,9 @@ TableViewPage::TableViewPage(QWidget* parent)
auto logItemDelegate = new AzToolsFramework::Logging::LogTableItemDelegate(ui->logTableView);
ui->logTableView->setItemDelegate(logItemDelegate);
// Example of changing the header section background color
ui->logTableView->setStyleSheet("QHeaderView::section { background: transparent; }");
ui->qTableView->setModel(logModel);
ui->qTableView->setAlternatingRowColors(true);
ui->qTableView->setShowGrid(false);