From 775ae27a5579812a85957ac1154b6c2e9d2049b4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 2 Feb 2021 19:02:01 +0100 Subject: [PATCH] Revert "StatusBar: Allow GML files to set the number of labels to create" This reverts commit e11ec20650e5182f47675210dcd71e7301c34905. Broke FileManager, Browser, etc. --- Userland/Libraries/LibGUI/StatusBar.cpp | 27 ++++++------------------- Userland/Libraries/LibGUI/StatusBar.h | 9 +-------- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/Userland/Libraries/LibGUI/StatusBar.cpp b/Userland/Libraries/LibGUI/StatusBar.cpp index 31db3cb947..c32b45cf0b 100644 --- a/Userland/Libraries/LibGUI/StatusBar.cpp +++ b/Userland/Libraries/LibGUI/StatusBar.cpp @@ -44,15 +44,15 @@ StatusBar::StatusBar(int label_count) layout()->set_margins({ 0, 0, 0, 0 }); layout()->set_spacing(2); - if (label_count > 0) { - for (auto i = 0; i < label_count; i++) - m_labels.append(create_label()); + if (label_count < 1) + label_count = 1; - m_corner = add(); - } + for (auto i = 0; i < label_count; i++) + m_labels.append(create_label()); + + m_corner = add(); REGISTER_STRING_PROPERTY("text", text, set_text); - REGISTER_INT_PROPERTY("label_count", label_count, set_label_count); } StatusBar::~StatusBar() @@ -104,19 +104,4 @@ void StatusBar::resize_event(ResizeEvent& event) Widget::resize_event(event); } -void StatusBar::set_label_count(int label_count) -{ - ASSERT(m_labels.is_empty()); - m_label_count = label_count; - for (auto i = 0; i < label_count; ++i) { - m_labels.append(create_label()); - } - m_corner = add(); -} - -NonnullRefPtr