diff --git a/DevTools/VisualBuilder/VBPropertiesWindow.cpp b/DevTools/VisualBuilder/VBPropertiesWindow.cpp index c61cd56e895..b167fa58579 100644 --- a/DevTools/VisualBuilder/VBPropertiesWindow.cpp +++ b/DevTools/VisualBuilder/VBPropertiesWindow.cpp @@ -37,7 +37,7 @@ public: combo->set_only_allow_values_from_model(true); combo->set_model(adopt(*new BoolValuesModel)); combo->on_return_pressed = [this] { commit(); }; - combo->on_change = [this](auto&) { commit(); }; + combo->on_change = [this](auto&, auto&) { commit(); }; return combo; } virtual GVariant value() const override { return static_cast(widget())->text() == "true"; } diff --git a/Libraries/LibGUI/GComboBox.cpp b/Libraries/LibGUI/GComboBox.cpp index 6cbe5212832..1db612c00c2 100644 --- a/Libraries/LibGUI/GComboBox.cpp +++ b/Libraries/LibGUI/GComboBox.cpp @@ -12,7 +12,7 @@ GComboBox::GComboBox(GWidget* parent) m_editor = new GTextEditor(GTextEditor::Type::SingleLine, this); m_editor->on_change = [this] { if (on_change) - on_change(m_editor->text()); + on_change(m_editor->text(), model()->selected_index()); }; m_editor->on_return_pressed = [this] { if (on_return_pressed) @@ -43,9 +43,9 @@ GComboBox::GComboBox(GWidget* parent) m_editor->set_text(new_value); m_editor->select_all(); close(); - deferred_invoke([this](auto&) { + deferred_invoke([this, index](auto&) { if (on_change) - on_change(m_editor->text()); + on_change(m_editor->text(), index); }); }; } diff --git a/Libraries/LibGUI/GComboBox.h b/Libraries/LibGUI/GComboBox.h index b243b0b8c93..839566fe648 100644 --- a/Libraries/LibGUI/GComboBox.h +++ b/Libraries/LibGUI/GComboBox.h @@ -29,7 +29,7 @@ public: int model_column() const { return m_list_view->model_column(); } void set_model_column(int column) { m_list_view->set_model_column(column); } - Function on_change; + Function on_change; Function on_return_pressed; protected: