Changes made to address comments.

monroegm-disable-blank-issue-2
John Jones-Steele 5 years ago
parent 40cdcb63b8
commit 0983d1ba45

@ -508,8 +508,7 @@ namespace AzQtComponents
// First draw as standard to get the correct hover background for the complete control.
QProxyStyle::drawControl(element, option, painter, widget);
// Now draw the icon as non-hovered so control behaves as designed.
const QStyleOptionMenuItem* opt = qstyleoption_cast<const QStyleOptionMenuItem*>(option);
QStyleOptionMenuItem myOpt = *(const_cast<QStyleOptionMenuItem*>(opt));
QStyleOptionMenuItem myOpt = *qstyleoption_cast<const QStyleOptionMenuItem*>(option);
myOpt.state &= ~QStyle::State_Selected;
return QProxyStyle::drawControl(element, &myOpt, painter, widget);
}

@ -56,7 +56,5 @@ namespace AWSCore
// To improve experience, use process watcher to keep track of ongoing tool process
AZStd::unique_ptr<AzFramework::ProcessWatcher> m_resourceMappingToolWatcher;
const int m_sizeOfIcon = 16;
};
} // namespace AWSCore

@ -35,6 +35,9 @@
namespace AWSCore
{
static constexpr int IconSize = 16;
AWSCoreEditorMenu::AWSCoreEditorMenu(const QString& text)
: QMenu(text)
, m_resourceMappingToolWatcher(nullptr)
@ -228,7 +231,7 @@ namespace AWSCore
void AWSCoreEditorMenu::AddSpaceForIcon(QMenu *menu)
{
QSize size = menu->sizeHint();
size.setWidth(size.width() + m_sizeOfIcon);
size.setWidth(size.width() + IconSize);
menu->setFixedSize(size);
}
} // namespace AWSCore

Loading…
Cancel
Save