Show shortcuts in CaptureToolButton tooltips (#1811)
* Show shortcuts in CaptureToolButton tooltips Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Change size indicator tooltip to reduce ambiguity
This commit is contained in:
@@ -58,7 +58,14 @@ void CaptureToolButton::initButton()
|
||||
GlobalValues::buttonBaseSize() + 2),
|
||||
QRegion::Ellipse));
|
||||
|
||||
setToolTip(m_tool->description());
|
||||
// Set a tooltip showing a shortcut in parentheses (if there is a shortcut)
|
||||
QString tooltip = m_tool->description();
|
||||
QString shortcut =
|
||||
ConfigHandler().shortcut(QVariant::fromValue(m_buttonType).toString());
|
||||
if (!shortcut.isEmpty()) {
|
||||
tooltip += QString(" (%1)").arg(shortcut);
|
||||
}
|
||||
setToolTip(tooltip);
|
||||
|
||||
m_emergeAnimation = new QPropertyAnimation(this, "size", this);
|
||||
m_emergeAnimation->setEasingCurve(QEasingCurve::InOutQuad);
|
||||
|
||||
Reference in New Issue
Block a user