Explorar o código

LibVT: Enable caller to control the visibility of the scrollbar widget

In preparation for another feature, expose an API so that any users of
this widget can control the scrollbar visibility.
Brian Gianforcaro %!s(int64=3) %!d(string=hai) anos
pai
achega
0e26ba59f7

+ 5 - 0
Userland/Libraries/LibVT/TerminalWidget.cpp

@@ -548,6 +548,11 @@ void TerminalWidget::set_opacity(u8 new_opacity)
     update();
     update();
 }
 }
 
 
+void TerminalWidget::set_show_scrollbar(bool show_scrollbar)
+{
+    m_scrollbar->set_visible(show_scrollbar);
+}
+
 bool TerminalWidget::has_selection() const
 bool TerminalWidget::has_selection() const
 {
 {
     return m_selection.is_valid();
     return m_selection.is_valid();

+ 2 - 0
Userland/Libraries/LibVT/TerminalWidget.h

@@ -43,6 +43,8 @@ public:
     void set_opacity(u8);
     void set_opacity(u8);
     float opacity() { return m_opacity; };
     float opacity() { return m_opacity; };
 
 
+    void set_show_scrollbar(bool);
+
     enum class BellMode {
     enum class BellMode {
         Visible,
         Visible,
         AudibleBeep,
         AudibleBeep,