Usage Tips #31
Replies: 2 comments
-
The reason for the following is: An egui window with a certain width and frame will cause the last character of the terminal to be cut off. If you are creating an egui context with a fixed width and no frame, make it a multiple of the font size. So if you have a font size of 16, and you want a terminal 20 characters wide, you can set the width to 16*20=320. If you want to add an egui frame to the context containing the ratatui terminal, I recommend adding a buffer to the preceding value to account for the Frame margin. So if you have a frame, font size 16, and a terminal 20 characters wide- then use a buffer value a bit lower than the font size, so we can use 14 (Might have to play around with it). Thus the size should be 16*20 + 14 = 334. For better effect, modify the Frame properties, see: https://docs.rs/egui/latest/egui/containers/struct.Frame.html Sample Code:
OR
|
Beta Was this translation helpful? Give feedback.
-
If you need to have a ratatui terminal and another egui widget in the same window, you should wrap both into an egui container. This is because egui_ratatui works by always filling it's own context completely, nothing else can be added to the context directly containing a ratatui terminal.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
If I find ways that make using the library better, I will document them here. Later I will make a better source but this is it for now.
Beta Was this translation helpful? Give feedback.
All reactions