Backport some review fixes of Lioncash
This commit is contained in:
parent
ffd78b635e
commit
2f6f232965
7 changed files with 58 additions and 68 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
#include <QPainter>
|
||||
#include "citra_qt/util/util.h"
|
||||
|
||||
QFont GetMonospaceFont() {
|
||||
|
@ -24,3 +25,13 @@ QString ReadableByteSize(qulonglong size) {
|
|||
.arg(size / std::pow(1024, digit_groups), 0, 'f', 1)
|
||||
.arg(units[digit_groups]);
|
||||
}
|
||||
|
||||
QPixmap CreateCirclePixmapFromColor(const QColor& color) {
|
||||
QPixmap circle_pixmap(16, 16);
|
||||
circle_pixmap.fill(Qt::transparent);
|
||||
QPainter painter(&circle_pixmap);
|
||||
painter.setPen(color);
|
||||
painter.setBrush(color);
|
||||
painter.drawEllipse(0, 0, 15, 15);
|
||||
return circle_pixmap;
|
||||
}
|
||||
|
|
|
@ -12,3 +12,10 @@ QFont GetMonospaceFont();
|
|||
|
||||
/// Convert a size in bytes into a readable format (KiB, MiB, etc.)
|
||||
QString ReadableByteSize(qulonglong size);
|
||||
|
||||
/**
|
||||
* Creates a circle pixmap from a specified color
|
||||
* @param color The color the pixmap shall have
|
||||
* @return QPixmap circle pixmap
|
||||
*/
|
||||
QPixmap CreateCirclePixmapFromColor(const QColor& color);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue