Adds Links to Gem Directory and Documentation for Gems (#2922)

* Changed blue text to white that is not meant as a link, made 'View in Director' link work for gems in the inspector, added parsing for gem documentation link

Signed-off-by: nggieber <nggieber@amazon.com>

* Added documentation links for gems, changed markup for urls in summaries and requirements so they are clickable

Signed-off-by: nggieber <nggieber@amazon.com>

* Fixed a couple of the documentation links

Signed-off-by: nggieber <nggieber@amazon.com>

* Added documentation url to edit gem properties script and updated unit tests

Signed-off-by: nggieber <nggieber@amazon.com>
This commit is contained in:
AMZN-nggieber
2021-08-06 08:19:35 -07:00
committed by GitHub
parent 5a05fe93d4
commit 2c7f6f9742
83 changed files with 240 additions and 148 deletions
@@ -108,7 +108,7 @@ namespace O3DE::ProjectManager
{
// Gem name, creator and summary
m_nameLabel = CreateStyledLabel(m_mainLayout, 18, s_headerColor);
m_creatorLabel = CreateStyledLabel(m_mainLayout, 12, s_creatorColor);
m_creatorLabel = CreateStyledLabel(m_mainLayout, 12, s_headerColor);
m_mainLayout->addSpacing(5);
// TODO: QLabel seems to have issues determining the right sizeHint() for our font with the given font size.
@@ -116,6 +116,8 @@ namespace O3DE::ProjectManager
m_summaryLabel = CreateStyledLabel(m_mainLayout, 12, s_textColor);
m_mainLayout->addWidget(m_summaryLabel);
m_summaryLabel->setWordWrap(true);
m_summaryLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
m_summaryLabel->setOpenExternalLinks(true);
m_mainLayout->addSpacing(5);
// Directory and documentation links
@@ -161,6 +163,8 @@ namespace O3DE::ProjectManager
m_reqirementsTextLabel = GemInspector::CreateStyledLabel(requrementsLayout, 10, s_textColor);
m_reqirementsTextLabel->setWordWrap(true);
m_reqirementsTextLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
m_reqirementsTextLabel->setOpenExternalLinks(true);
QSpacerItem* reqirementsSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding);
requrementsLayout->addSpacerItem(reqirementsSpacer);
@@ -38,7 +38,6 @@ namespace O3DE::ProjectManager
// Colors
inline constexpr static const char* s_headerColor = "#FFFFFF";
inline constexpr static const char* s_textColor = "#DDDDDD";
inline constexpr static const char* s_creatorColor = "#94D2FF";
private slots:
void OnSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
@@ -95,7 +95,6 @@ namespace O3DE::ProjectManager
gemCreatorRect.moveTo(contentRect.left(), contentRect.top() + gemNameRect.height());
painter->setFont(standardFont);
painter->setPen(m_linkColor);
gemCreatorRect = painter->boundingRect(gemCreatorRect, Qt::TextSingleLine, gemCreator);
painter->drawText(gemCreatorRect, Qt::TextSingleLine, gemCreator);
@@ -646,6 +646,7 @@ namespace O3DE::ProjectManager
{
GemInfo gemInfo;
gemInfo.m_path = Py_To_String(path);
gemInfo.m_directoryLink = gemInfo.m_path;
auto data = m_manifest.attr("get_gem_json_data")(pybind11::none(), path, pyProjectPath);
if (pybind11::isinstance<pybind11::dict>(data))
@@ -661,6 +662,7 @@ namespace O3DE::ProjectManager
gemInfo.m_version = "";
gemInfo.m_requirement = Py_To_String_Optional(data, "requirements", "");
gemInfo.m_creator = Py_To_String_Optional(data, "origin", "");
gemInfo.m_documentationLink = Py_To_String_Optional(data, "documentation_url", "");
if (gemInfo.m_creator.contains("Open 3D Engine"))
{