summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGUI/AbstractButton.cpp14
-rw-r--r--Userland/Libraries/LibGUI/AbstractButton.h2
-rw-r--r--Userland/Libraries/LibGUI/Button.cpp5
-rw-r--r--Userland/Libraries/LibGUI/Button.h5
-rw-r--r--Userland/Libraries/LibGUI/CheckBox.cpp5
-rw-r--r--Userland/Libraries/LibGUI/CheckBox.h1
-rw-r--r--Userland/Libraries/LibGUI/RadioButton.cpp5
-rw-r--r--Userland/Libraries/LibGUI/RadioButton.h1
8 files changed, 8 insertions, 30 deletions
diff --git a/Userland/Libraries/LibGUI/AbstractButton.cpp b/Userland/Libraries/LibGUI/AbstractButton.cpp
index 9de91b683f..b723fadd85 100644
--- a/Userland/Libraries/LibGUI/AbstractButton.cpp
+++ b/Userland/Libraries/LibGUI/AbstractButton.cpp
@@ -28,17 +28,19 @@ AbstractButton::AbstractButton(String text)
click();
};
- REGISTER_STRING_PROPERTY("text", text_deprecated, set_text_deprecated);
+ // FIXME: Port JsonValue to the new String class.
+ register_property(
+ "text",
+ [this]() { return this->text().to_deprecated_string(); },
+ [this](auto& value) {
+ this->set_text(String::from_deprecated_string(value.to_deprecated_string()).release_value_but_fixme_should_propagate_errors());
+ return true;
+ });
REGISTER_BOOL_PROPERTY("checked", is_checked, set_checked);
REGISTER_BOOL_PROPERTY("checkable", is_checkable, set_checkable);
REGISTER_BOOL_PROPERTY("exclusive", is_exclusive, set_exclusive);
}
-void AbstractButton::set_text_deprecated(DeprecatedString deprecated_text)
-{
- set_text(String::from_deprecated_string(deprecated_text).release_value_but_fixme_should_propagate_errors());
-}
-
void AbstractButton::set_text(String text)
{
if (m_text == text)
diff --git a/Userland/Libraries/LibGUI/AbstractButton.h b/Userland/Libraries/LibGUI/AbstractButton.h
index d890abeaa1..9ec6037cc6 100644
--- a/Userland/Libraries/LibGUI/AbstractButton.h
+++ b/Userland/Libraries/LibGUI/AbstractButton.h
@@ -21,8 +21,6 @@ public:
Function<void(bool)> on_checked;
- virtual void set_text_deprecated(DeprecatedString);
- DeprecatedString text_deprecated() const { return m_text.to_deprecated_string(); }
virtual void set_text(String);
String const& text() const { return m_text; }
diff --git a/Userland/Libraries/LibGUI/Button.cpp b/Userland/Libraries/LibGUI/Button.cpp
index 9536d27037..9d11c8f435 100644
--- a/Userland/Libraries/LibGUI/Button.cpp
+++ b/Userland/Libraries/LibGUI/Button.cpp
@@ -20,11 +20,6 @@ REGISTER_WIDGET(GUI, DialogButton)
namespace GUI {
-Button::Button(DeprecatedString deprecated_text)
- : Button(String::from_deprecated_string(deprecated_text).release_value_but_fixme_should_propagate_errors())
-{
-}
-
Button::Button(String text)
: AbstractButton(move(text))
{
diff --git a/Userland/Libraries/LibGUI/Button.h b/Userland/Libraries/LibGUI/Button.h
index 9420551997..e5301359cf 100644
--- a/Userland/Libraries/LibGUI/Button.h
+++ b/Userland/Libraries/LibGUI/Button.h
@@ -68,7 +68,6 @@ public:
virtual Optional<UISize> calculated_min_size() const override;
protected:
- explicit Button(DeprecatedString text);
explicit Button(String text = {});
virtual void mousedown_event(MouseEvent&) override;
virtual void mousemove_event(MouseEvent&) override;
@@ -92,10 +91,6 @@ class DialogButton final : public Button {
public:
virtual ~DialogButton() override {};
- explicit DialogButton(DeprecatedString deprecated_text)
- : DialogButton(String::from_deprecated_string(deprecated_text).release_value_but_fixme_should_propagate_errors())
- {
- }
explicit DialogButton(String text = {})
: Button(move(text))
{
diff --git a/Userland/Libraries/LibGUI/CheckBox.cpp b/Userland/Libraries/LibGUI/CheckBox.cpp
index 3da479ce83..34611c33fb 100644
--- a/Userland/Libraries/LibGUI/CheckBox.cpp
+++ b/Userland/Libraries/LibGUI/CheckBox.cpp
@@ -20,11 +20,6 @@ static constexpr int s_box_width = 13;
static constexpr int s_box_height = 13;
static constexpr int s_horizontal_padding = 6;
-CheckBox::CheckBox(DeprecatedString deprecated_text)
- : CheckBox(String::from_deprecated_string(deprecated_text).release_value_but_fixme_should_propagate_errors())
-{
-}
-
CheckBox::CheckBox(String text)
: AbstractButton(move(text))
{
diff --git a/Userland/Libraries/LibGUI/CheckBox.h b/Userland/Libraries/LibGUI/CheckBox.h
index 2122d32f1d..f39f938057 100644
--- a/Userland/Libraries/LibGUI/CheckBox.h
+++ b/Userland/Libraries/LibGUI/CheckBox.h
@@ -30,7 +30,6 @@ public:
void set_checkbox_position(CheckBoxPosition value) { m_checkbox_position = value; }
protected:
- explicit CheckBox(DeprecatedString);
explicit CheckBox(String = {});
private:
diff --git a/Userland/Libraries/LibGUI/RadioButton.cpp b/Userland/Libraries/LibGUI/RadioButton.cpp
index 73fe040497..cae14e4157 100644
--- a/Userland/Libraries/LibGUI/RadioButton.cpp
+++ b/Userland/Libraries/LibGUI/RadioButton.cpp
@@ -16,11 +16,6 @@ REGISTER_WIDGET(GUI, RadioButton)
namespace GUI {
-RadioButton::RadioButton(DeprecatedString text)
- : RadioButton(String::from_deprecated_string(text).release_value_but_fixme_should_propagate_errors())
-{
-}
-
RadioButton::RadioButton(String text)
: AbstractButton(move(text))
{
diff --git a/Userland/Libraries/LibGUI/RadioButton.h b/Userland/Libraries/LibGUI/RadioButton.h
index 87da825829..d07da91a0a 100644
--- a/Userland/Libraries/LibGUI/RadioButton.h
+++ b/Userland/Libraries/LibGUI/RadioButton.h
@@ -22,7 +22,6 @@ public:
virtual Optional<UISize> calculated_min_size() const override;
protected:
- explicit RadioButton(DeprecatedString text);
explicit RadioButton(String text = {});
virtual void paint_event(PaintEvent&) override;