2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Start support of linear gradient wallpapers.

This commit is contained in:
John Preston
2021-08-12 17:51:44 +03:00
parent 1fd28d5cfb
commit c2b1187948
14 changed files with 379 additions and 227 deletions

View File

@@ -232,17 +232,20 @@ bool ShowWallPaper(
match->captured(1),
qthelp::UrlParamNameTransform::ToLower);
const auto bg = params.value("bg_color");
if (!params.value("gradient").isEmpty()
|| bg.contains('~')
|| bg.contains('-')) {
const auto color = params.value("color");
const auto gradient = params.value("gradient");
if (gradient.contains('~') || bg.contains('~')) {
Ui::show(Box<InformBox>(
tr::lng_background_gradient_unsupported(tr::now)));
return false;
}
const auto color = params.value("color");
return BackgroundPreviewBox::Start(
controller,
(color.isEmpty() ? params.value(qsl("slug")) : color),
(!color.isEmpty()
? color
: !gradient.isEmpty()
? gradient
: params.value(qsl("slug"))),
params);
}