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
add a way to enlarge font with key combination #10
Comments
I just took a look at your code. Even though you've imported lenses, do you think that make lenses (or prisms) out of the data structures TMConfig, ConfigOptions, and ConfigHooks would make this easier? EDIT: I thought you weren't using the lens package. I spoke too soon. |
Thanks for taking a look at this @emmanueldenloye! Yeah, there should be lenses available in the Termonad.Lenses module. If you notice any record fields that don't have lenses, this would be considered a bug! |
I didn't realize you could make lenses in that way. That is rather convienent. To make the font changes I was considering using a config hook. I could use a hook similar to:
or even that one. I'll cook up something and see what shakes out. |
I don't think this would necessarily require using the config hook. I think basically you just need to add a new menu entry for shrinking and enlarging the current font size. A new menu entry should be added here and here. In the callback for when you click on the menu entry, you need to take the current list of terminals, and loop over them setting the new font size. An example of looping over existing terminals can be found here. Here's the code that initially sets the font size: Line 303 in cff560a
Creating the original font description can be found here: Line 152 in cff560a
You may have to refactor the code a little to make re-creating the font description easy? |
This has been implemented in #95. This is just a MVP implementation that gives a way to increase / decrease the fontsize with a menu option. The following two improvements have not yet been made:
This hasn't been implemented, but if someone is interested in it, I would accept a PR adding this. |
Currently Termonad doesn't have any way to enlarge the font with a key combination. You have to edit the
~/.config/termonad/termonad.hs
file and restart Termonad. This is pretty annoying and should be fixed.I used to use the terminal emulator Roxterm. Roxterm has font resizing options like the following ("Zoom In", "Zoom Out", "Normal Size"):
It would be great to have similar options for Termonad. Adding this would require the following steps:
Add a new menu entry for enlarging and shrinking here.
Setup the callbacks for the options in the second half of this function.
Within the callbacks, create a new FontDescription, and then loop through the existing terminals and update their FontDescription.
Bonus points if you change it so that a FontDescription is actually associated with a single terminal instead of the entire application. That way the font size for a single terminal would be able to be increased instead of increasing the font sizes for all terminals.
Extra bonus points if you add a configuration option that the user can set that says whether they want the Increase Font Size / Decrease Font Size buttons to change the font size of ALL terminals, or just the focused on. Or, maybe add an extra button that increases the fontsize for all terminals??
The text was updated successfully, but these errors were encountered: