Fixed some Clang compiler warnings

This commit is contained in:
Leon Styhre 2024-08-20 17:27:36 +02:00
parent 3a5c4a7605
commit 8689b3aecf
4 changed files with 8 additions and 8 deletions

View file

@ -89,7 +89,7 @@ void TextEditComponent::onSizeChanged()
onTextChanged(); // Wrap point probably changed.
}
void TextEditComponent::setValue(const std::string& val, bool update)
void TextEditComponent::setText(const std::string& val, bool update)
{
mText = val;

View file

@ -30,7 +30,7 @@ public:
void onSizeChanged() override;
void setValue(const std::string& val, bool update = true);
void setText(const std::string& val, bool update = true);
std::string getValue() const override;
void startEditing();

View file

@ -135,7 +135,7 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
glm::ivec2 {mHorizontalKeyCount, static_cast<int>(kbLayout.size()) / 3});
mText = std::make_shared<TextEditComponent>(mMultiLine);
mText->setValue(initValue, false);
mText->setText(initValue, false);
// Header.
mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true);
@ -685,12 +685,12 @@ std::shared_ptr<ButtonComponent> GuiTextEditKeyboardPopup::makeButton(
return;
}
else if (key == _("LOAD")) {
mText->setValue(mDefaultValue->getValue());
mText->setText(mDefaultValue->getValue());
mText->setCursor(mDefaultValue->getValue().size());
return;
}
else if (key == _("CLEAR")) {
mText->setValue("");
mText->setText("");
return;
}
else if (key == _("CANCEL")) {

View file

@ -56,7 +56,7 @@ GuiTextEditPopup::GuiTextEditPopup(const HelpStyle& helpstyle,
}
mText = std::make_shared<TextEditComponent>(mMultiLine);
mText->setValue(initValue, false);
mText->setText(initValue, false);
std::vector<std::shared_ptr<ButtonComponent>> buttons;
buttons.push_back(
@ -67,14 +67,14 @@ GuiTextEditPopup::GuiTextEditPopup(const HelpStyle& helpstyle,
if (mComplexMode) {
buttons.push_back(
std::make_shared<ButtonComponent>(_("LOAD"), loadBtnHelpText, [this, defaultValue] {
mText->setValue(defaultValue);
mText->setText(defaultValue);
mText->setCursor(0);
mText->setCursor(defaultValue.size());
}));
}
buttons.push_back(std::make_shared<ButtonComponent>(_("CLEAR"), clearBtnHelpText,
[this] { mText->setValue(""); }));
[this] { mText->setText(""); }));
buttons.push_back(std::make_shared<ButtonComponent>(_("CANCEL"), _("discard changes"),
[this] { delete this; }));