summaryrefslogtreecommitdiff
path: root/src/citron/util/util.h
diff options
context:
space:
mode:
authorZephyron <zephyron@citron-emu.org>2024-12-31 16:19:25 +1000
committerZephyron <zephyron@citron-emu.org>2024-12-31 16:19:25 +1000
commit9427e27e24a7135880ee2881c3c44988e174b41a (patch)
tree83f0062a35be144f6b162eaa823c5b3c7620146e /src/citron/util/util.h
parentb35ae725d20960411e8588b11c12a2d55f86c9d0 (diff)
chore: update project branding to citron
Diffstat (limited to 'src/citron/util/util.h')
-rw-r--r--src/citron/util/util.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/citron/util/util.h b/src/citron/util/util.h
new file mode 100644
index 000000000..4094cf6c2
--- /dev/null
+++ b/src/citron/util/util.h
@@ -0,0 +1,29 @@
+// 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 path The icons path
+ * @param image The image to save
+ * @return bool If the operation succeeded
+ */
+[[nodiscard]] bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image);