All: Reformat according to new standard
This commit is contained in:
committed by
Kacper Donat
parent
eafd18dac0
commit
25c3ba7338
@@ -21,8 +21,8 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
# include <QBuffer>
|
||||
# include <QPainter>
|
||||
#include <QBuffer>
|
||||
#include <QPainter>
|
||||
|
||||
#include <FCConfig.h>
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
#include "InputHint.h"
|
||||
#include "InputHintWidget.h"
|
||||
|
||||
Gui::InputHintWidget::InputHintWidget(QWidget* parent) : StatusBarLabel(parent, "InputHintEnabled")
|
||||
Gui::InputHintWidget::InputHintWidget(QWidget* parent)
|
||||
: StatusBarLabel(parent, "InputHintEnabled")
|
||||
{}
|
||||
|
||||
void Gui::InputHintWidget::showHints(const std::list<InputHint>& hints)
|
||||
@@ -51,9 +52,11 @@ void Gui::InputHintWidget::showHints(const std::list<InputHint>& hints)
|
||||
QColor color = palette().text().color();
|
||||
|
||||
if (auto iconPath = getCustomIconPath(key)) {
|
||||
return factory.pixmapFromSvg(*iconPath,
|
||||
QSize(iconSize, iconSize),
|
||||
{{0xFFFFFF, color.rgb() & RGB_MASK}});
|
||||
return factory.pixmapFromSvg(
|
||||
*iconPath,
|
||||
QSize(iconSize, iconSize),
|
||||
{{0xFFFFFF, color.rgb() & RGB_MASK}}
|
||||
);
|
||||
}
|
||||
|
||||
return generateKeyIcon(key, color, iconSize);
|
||||
@@ -89,9 +92,11 @@ void Gui::InputHintWidget::showHints(const std::list<InputHint>& hints)
|
||||
messages.append(getHintHTML(hint));
|
||||
}
|
||||
|
||||
QString html = QStringLiteral("<table style=\"line-height: %1px\" height=%1>"
|
||||
"<tr>%2</tr>"
|
||||
"</table>")
|
||||
QString html = QStringLiteral(
|
||||
"<table style=\"line-height: %1px\" height=%1>"
|
||||
"<tr>%2</tr>"
|
||||
"</table>"
|
||||
)
|
||||
.arg(iconSize + iconMargin * 2);
|
||||
|
||||
setText(html.arg(messages.join(QStringLiteral("<td width=10></td>"))));
|
||||
@@ -140,7 +145,7 @@ QPixmap Gui::InputHintWidget::generateKeyIcon(const InputHint::UserInput key, co
|
||||
|
||||
const QRect keyRect(margin, margin, symbolWidth, iconSymbolHeight);
|
||||
|
||||
QPixmap pixmap = BitmapFactory().empty({ symbolWidth + margin * 2, height });
|
||||
QPixmap pixmap = BitmapFactory().empty({symbolWidth + margin * 2, height});
|
||||
|
||||
QPainter painter(&pixmap);
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
@@ -152,7 +157,8 @@ QPixmap Gui::InputHintWidget::generateKeyIcon(const InputHint::UserInput key, co
|
||||
// this is important for characters that are below baseline
|
||||
keyRect.translated(0, -(textBoundingRect.y() + textBoundingRect.height()) / 2),
|
||||
Qt::AlignHCenter,
|
||||
text);
|
||||
text
|
||||
);
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user