Merge pull request #1551 from aws-lumberyard-dev/LY-122268

Entity Outliner - Sort Order options don't show current selection
This commit is contained in:
jjjoness
2021-06-24 15:01:36 +01:00
committed by GitHub
@@ -514,6 +514,20 @@ namespace AzQtComponents
}
}
}
// Implement checkmark with icon in menu.
QStyleOptionMenuItem myOpt = *qstyleoption_cast<const QStyleOptionMenuItem*>(option);
bool checkable = myOpt.checkType != QStyleOptionMenuItem::NotCheckable;
bool checked = checkable ? myOpt.checked : false;
if (!myOpt.icon.isNull() && checked)
{
const int iconSize{ 18 };
int topPadding{ AZStd::max( 0 , (myOpt.rect.height() - iconSize) / 2) - 1};
QProxyStyle::drawControl(element, &myOpt, painter, widget);
myOpt.rect.adjust(0, topPadding, iconSize - myOpt.rect.width(), iconSize - myOpt.rect.height());
return drawPrimitive(PE_IndicatorMenuCheckMark, &myOpt, painter, widget);
}
}
break;
}