summaryrefslogtreecommitdiffstats
path: root/src/yuzu/util/util.h
blob: 8839e160ae938c87bdfa4b07428b304c483d0de7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SPDX-FileCopyrightText: 2015 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <filesystem>
#include <QFont>
#include <QString>

/// Returns a QFont object appropriate to use as a monospace font for debugging widgets, etc.

[[nodiscard]] QFont GetMonospaceFont();

/// Convert a size in bytes into a readable format (KiB, MiB, etc.)

[[nodiscard]] QString ReadableByteSize(qulonglong size);

/**
 * Creates a circle pixmap from a specified color
 *
 * @param color The color the pixmap shall have
 *
 * @return QPixmap circle pixmap
 */

[[nodiscard]] QPixmap CreateCirclePixmapFromColor(const QColor& color);

/**
 * Saves a windows icon to a file
 *
 * @param image The image to save
 *
 * @param path The icons path
 *
 * @return bool If the operation succeeded
 */

[[nodiscard]] bool SaveIconToFile(const QImage& image, const std::filesystem::path& icon_path);