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

Implement color preview #659

Closed
Matteo-Nigro opened this issue May 15, 2023 · 9 comments
Closed

Implement color preview #659

Matteo-Nigro opened this issue May 15, 2023 · 9 comments
Labels
✅enhancement 🌐i18n Localization/Internationalization ui
Milestone

Comments

@Matteo-Nigro
Copy link
Contributor

Hi @zufuliu! I wanted to offer you this implementation... In Notepad3 I find the possibility of opening links directly from the text (Ctrl+Click) and being able to preview the colors (Hex or RGB, etc.) simply by passing the mouse over them, very convenient.
When writing code with lots of colors it is especially useful. Talking about the colors with (Ctrl+Click) the window with the color palettes opens... this is also very useful...

Record

What do you think we could work on it? 😉

@zufuliu
Copy link
Owner

zufuliu commented May 15, 2023

Open link is implemented for Markdown, other schemes will need to wait issue #52.

@zufuliu
Copy link
Owner

zufuliu commented May 20, 2023

An alternative way to implement color preview is show calltips (change text and background color), open color picker when calltip clicked (similar to VSCode). This seems is easy to implemented than using indicators.

image

@Matteo-Nigro
Copy link
Contributor Author

Hello @zufuliu. Great! 😀 It seems to be an interesting solution anyway. Do you think it can be implemented in the next release?

@zufuliu
Copy link
Owner

zufuliu commented May 20, 2023

Do you think it can be implemented in the next release?

Not sure, but could do some experiments.

@zufuliu zufuliu added this to the v4.23.06 milestone May 28, 2023
@zufuliu zufuliu added 🌐i18n Localization/Internationalization ui labels May 28, 2023
@zufuliu zufuliu changed the title Implement link and color preview Implement color preview May 28, 2023
@zufuliu
Copy link
Owner

zufuliu commented May 29, 2023

Implemented by 9492cf8:
ColorCallTip

@Matteo-Nigro
Copy link
Contributor Author

Matteo-Nigro commented May 29, 2023

Hi @zufuliu very good, seems to be quite practical. I only report one bug... Upon closer examination I think the problem actually occurs only if the text begins with a color code... as seen in my second screenshot. Regardless of the lexer chosen.

In this case an error is returned which can potentially crash the program. Here is the error message and screenshot of the text that generated it.

image

image

@zufuliu
Copy link
Owner

zufuliu commented May 29, 2023

The stack overrun is fixed by 98a70ca, it caused by:
https://github.com/zufuliu/notepad2/blob/98a70ca6985795e8a7e890a802ad55e5af504b47/src/Styles.c#L5348-L5349

zufuliu added a commit that referenced this issue May 30, 2023
@zufuliu zufuliu closed this as completed Jun 16, 2023
@meteorquake
Copy link

That looks good, I'm sure I'll use it!
There may perhaps be some advantages in having it only activate when a modifier eg shift is held down whilst passing over but I'm not sure.

@zufuliu
Copy link
Owner

zufuliu commented Jul 12, 2023

shift is held down whilst passing over

I think it would make the feature hard to use (something like "Color Preview" right-click menu).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅enhancement 🌐i18n Localization/Internationalization ui
Projects
None yet
Development

No branches or pull requests

3 participants