Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make custom text replaces work without replace emoji being enabled #242

Merged
merged 2 commits into from
Dec 17, 2021

Conversation

the-blank-x
Copy link
Contributor

@ilya-fedin
Copy link
Contributor

That would make people who don't like text replaces angry I guess :D

@the-blank-x
Copy link
Contributor Author

Then don't have any text replaces lol

@ilya-fedin
Copy link
Contributor

I don't think you really need to change lib_ui's API. It would make more sense to replace the array used in setInstantReplaces when the option changes than creating a new weird special-case API.

@ilya-fedin
Copy link
Contributor

Then don't have any text replaces lol

I don't quite understand what you wanted to say

@the-blank-x
Copy link
Contributor Author

the-blank-x commented Oct 17, 2021

I don't think you really need to change lib_ui's API. It would make more sense to replace the array used in setInstantReplaces when the option changes than creating a new weird special-case API.

When you change the replace emoji option it applies instantly without having to reopen kotatogram

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Oct 17, 2021

When you change the replace emoji option it applies instantly without having to reopen kotatogram

The call to setInstantReplaces should have effect instantly as well

@the-blank-x
Copy link
Contributor Author

The call to setInstantReplaces should have effect instantly as well

I don't get what you're saying

@ilya-fedin
Copy link
Contributor

Example of what I mean:

	Core::App().settings().replaceEmojiValue(
	) | rpl::start_with_next([=](bool replaceEmoji) {
		if (replaceEmoji) {
			text->setInstantReplaces(Ui::InstantReplaces::Default());
		} else {
			text->setInstantReplaces(Kotato::InstantReplaces::TextOnly());
		}
	});

@ilya-fedin
Copy link
Contributor

But I still don't think having text-only replaces always is a good idea, I'm pretty sure that would make people angry

@the-blank-x
Copy link
Contributor Author

I want https://github.com/kotatogram/kotatogram-desktop/wiki/Custom-text-replaces to work even if Replace emoji is disabled, if you don't want them you can always remove it from the config

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Oct 17, 2021

I want https://github.com/kotatogram/kotatogram-desktop/wiki/Custom-text-replaces to work even if Replace emoji is disabled

Ah. I thought you want these replaces: https://github.com/kotatogram/lib_ui/blob/master/ui/widgets/input_fields.cpp#L917-L924

It seems to me that the proper way would be to have a setInstantReplaces that accepts a rpl::producer then. That would allow the set to be changed at any time in runtime.

@the-blank-x the-blank-x force-pushed the custom-replace-no-emoji branch from 12d9db7 to 22d387f Compare October 17, 2021 12:01
@the-blank-x the-blank-x force-pushed the custom-replace-no-emoji branch from 22d387f to 5df6089 Compare October 24, 2021 06:39
@EricKotato
Copy link
Member

I will return to it after next stable release.

@EricKotato EricKotato merged commit a851f77 into kotatogram:dev Dec 17, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants