Add about auction box layout (no icons yet).

This commit is contained in:
John Preston
2025-11-13 14:12:07 +04:00
parent 0e5e4ca7ea
commit cab93600dd
15 changed files with 406 additions and 201 deletions

View File

@@ -3676,19 +3676,6 @@ Webview::StorageId TonSiteStorageId() {
return result;
}
template <>
std::optional<bool> Account::readPrefImpl<bool>(std::string_view key) {
if (const auto data = readPrefGeneric(key)) {
return !data->isEmpty();
}
return {};
}
template <>
void Account::writePrefImpl<bool>(std::string_view key, bool value) {
writePrefGeneric(key, value ? "\x1"_q : QByteArray());
}
void Account::clearPref(std::string_view key) {
const auto i = _prefs.find(QByteArray(key.data(), key.size()));
if (i == end(_prefs)) {
@@ -3790,4 +3777,18 @@ void Account::readPrefs() {
_prefs = std::move(map);
}
// Define your own pref types in the similar way.
template <>
std::optional<bool> Account::readPrefImpl<bool>(std::string_view key) {
if (const auto data = readPrefGeneric(key)) {
return !data->isEmpty();
}
return {};
}
template <>
void Account::writePrefImpl<bool>(std::string_view key, bool value) {
writePrefGeneric(key, value ? "\x1"_q : QByteArray());
}
} // namespace Storage