2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Update API scheme on layer 148: Topic icons.

This commit is contained in:
John Preston
2022-10-05 11:42:44 +04:00
parent f3c664859d
commit ae3496d6a4
31 changed files with 525 additions and 204 deletions

View File

@@ -0,0 +1,25 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "ui/color_int_conversion.h"
namespace Ui {
QColor ColorFromSerialized(quint32 serialized) {
return QColor(
int((serialized >> 16) & 0xFFU),
int((serialized >> 8) & 0xFFU),
int(serialized & 0xFFU));
}
std::optional<QColor> MaybeColorFromSerialized(quint32 serialized) {
return (serialized == quint32(-1))
? std::nullopt
: std::make_optional(ColorFromSerialized(serialized));
}
} // namespace Ui

View File

@@ -0,0 +1,16 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
namespace Ui {
[[nodiscard]] QColor ColorFromSerialized(quint32 serialized);
[[nodiscard]] std::optional<QColor> MaybeColorFromSerialized(
quint32 serialized);
} // namespace Ui