diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-05-05 14:08:33 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-05-11 20:16:43 +0200 |
commit | 0e1c8e702c71780f9e05ce22e5d8343355af4d2f (patch) | |
tree | a3f525b7d1ed3a487ded1b2dcf0deffdf789c01c | |
parent | f64a164392ae07dd1de8eff35ba5ad60f5f3e07d (diff) | |
download | serenity-0e1c8e702c71780f9e05ce22e5d8343355af4d2f.zip |
LibGUI: Expose more TabWidget properties to GML
- close_button_enabled
- show_tab_bar
- reorder_allowed
-rw-r--r-- | Userland/Libraries/LibGUI/TabWidget.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/TabWidget.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/TabWidget.cpp b/Userland/Libraries/LibGUI/TabWidget.cpp index 2fa065520f..e1cda9f267 100644 --- a/Userland/Libraries/LibGUI/TabWidget.cpp +++ b/Userland/Libraries/LibGUI/TabWidget.cpp @@ -6,7 +6,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <AK/JsonObject.h> #include <AK/JsonValue.h> #include <LibGUI/BoxLayout.h> #include <LibGUI/Painter.h> @@ -26,6 +25,9 @@ TabWidget::TabWidget() set_focus_policy(FocusPolicy::NoFocus); REGISTER_MARGINS_PROPERTY("container_margins", container_margins, set_container_margins); + REGISTER_BOOL_PROPERTY("show_close_buttons", close_button_enabled, set_close_button_enabled); + REGISTER_BOOL_PROPERTY("show_tab_bar", is_bar_visible, set_bar_visible); + REGISTER_BOOL_PROPERTY("reorder_allowed", reorder_allowed, set_reorder_allowed); REGISTER_BOOL_PROPERTY("uniform_tabs", uniform_tabs, set_uniform_tabs); register_property( diff --git a/Userland/Libraries/LibGUI/TabWidget.h b/Userland/Libraries/LibGUI/TabWidget.h index d032ad5717..d8111dbe66 100644 --- a/Userland/Libraries/LibGUI/TabWidget.h +++ b/Userland/Libraries/LibGUI/TabWidget.h @@ -81,6 +81,7 @@ public: bool is_bar_visible() const { return m_bar_visible; }; void set_close_button_enabled(bool close_button_enabled) { m_close_button_enabled = close_button_enabled; }; + bool close_button_enabled() const { return m_close_button_enabled; } void set_reorder_allowed(bool reorder_allowed) { m_reorder_allowed = reorder_allowed; } bool reorder_allowed() const { return m_reorder_allowed; } |