1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

LibVT: Make TerminalWidget's automatic size policy updates optional

When embedding a TerminalWidget, you might not want it to automatically
update its own size policy based on the exact terminal buffer size.

This behavior is now passed as a flag to the TerminalWidget constructor
which makes it behave nicely both inside HackStudio and in Terminal.
This commit is contained in:
Andreas Kling 2019-10-21 20:28:30 +02:00
parent 43ccb28852
commit da0958a882
4 changed files with 10 additions and 6 deletions

View file

@ -15,7 +15,7 @@ class TerminalWidget final : public GFrame
, public VT::TerminalClient {
C_OBJECT(TerminalWidget)
public:
explicit TerminalWidget(int ptm_fd, RefPtr<CConfigFile> config);
TerminalWidget(int ptm_fd, bool automatic_size_policy, RefPtr<CConfigFile> config);
virtual ~TerminalWidget() override;
void create_window();
@ -99,6 +99,7 @@ private:
u8 m_opacity { 255 };
bool m_needs_background_fill { true };
bool m_cursor_blink_state { true };
bool m_automatic_size_policy { false };
int m_glyph_width { 0 };