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

Apply lightness limits in accent colors.

This commit is contained in:
John Preston
2019-08-27 12:44:54 +03:00
parent 56a82600f8
commit 763bdf8798
3 changed files with 96 additions and 20 deletions

View File

@@ -199,16 +199,17 @@ void ColorsPalette::show(Type type) {
const auto colorizer = Window::Theme::ColorizerFrom(
*scheme,
scheme->accentColor);
const auto box = Ui::show(Box<EditColorBox>(
auto box = Box<EditColorBox>(
tr::lng_settings_theme_accent_title(tr::now),
EditColorBox::Mode::HSL,
current));
current);
box->setLightnessLimits(
colorizer.lightnessMin,
colorizer.lightnessMax);
box->setSaveCallback(crl::guard(custom, [=](QColor result) {
_selected.fire_copy(result);
}));
Ui::show(std::move(box));
}, custom->lifetime());
pushButton(custom);
inner->resize(_outer->width(), inner->height());