LibGUI: Add TabWidget::set_property() and handle some properties

This commit is contained in:
Andreas Kling 2020-09-14 16:38:07 +02:00
commit 3355a3e179
Notes: sideshowbarker 2024-07-19 02:24:46 +09:00
2 changed files with 18 additions and 0 deletions

View file

@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/JsonValue.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Painter.h>
#include <LibGUI/TabWidget.h>
@ -394,4 +395,19 @@ void TabWidget::context_menu_event(ContextMenuEvent& context_menu_event)
}
}
bool TabWidget::set_property(const StringView& name, const JsonValue& value)
{
if (name == "container_padding") {
set_container_padding(value.to_i32());
return true;
}
if (name == "uniform_tabs") {
set_uniform_tabs(value.to_bool());
return true;
}
return Widget::set_property(name, value);
}
}