mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Added reset button for profile to edit peer color box.
This commit is contained in:
@@ -998,6 +998,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_settings_color_apply" = "Apply Style";
|
||||
"lng_settings_color_profile_emoji" = "Add icons to Profile";
|
||||
"lng_settings_color_profile_emoji_channel" = "Profile Logo";
|
||||
"lng_settings_color_reset" = "Reset Profile Color";
|
||||
|
||||
"lng_suggest_hide_new_title" = "Hide new chats?";
|
||||
"lng_suggest_hide_new_about" = "You are receiving lots of new chats from users who are not in your Contact List.\n\nDo you want to have such chats **automatically muted** and **archived**?";
|
||||
|
||||
@@ -1802,6 +1802,29 @@ void EditPeerProfileColorSection(
|
||||
},
|
||||
true));
|
||||
|
||||
const auto resetWrap = container->add(
|
||||
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
||||
container,
|
||||
object_ptr<Ui::VerticalLayout>(container)));
|
||||
const auto resetInner = resetWrap->entity();
|
||||
|
||||
Ui::AddSkip(resetInner, st::settingsColorSampleSkip);
|
||||
const auto resetButton = resetInner->add(
|
||||
object_ptr<Ui::SettingsButton>(
|
||||
resetInner,
|
||||
tr::lng_settings_color_reset(),
|
||||
st::settingsButtonLightNoIcon));
|
||||
resetButton->setClickedCallback([=] {
|
||||
state->index = kUnsetColorIndex;
|
||||
state->patternEmojiId = 0;
|
||||
preview->setColorProfileIndex(std::nullopt);
|
||||
preview->setPatternEmojiId(0);
|
||||
});
|
||||
|
||||
resetWrap->toggleOn(state->index.value(
|
||||
) | rpl::map([](uint8 index) { return index != kUnsetColorIndex; }));
|
||||
resetWrap->finishAnimating();
|
||||
|
||||
state->index.value(
|
||||
) | rpl::start_with_next([=](uint8 index) {
|
||||
if (state->selector) {
|
||||
|
||||
Reference in New Issue
Block a user