mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
PixelPaint: Correctly set default layer name
Previously, if you confirmed the "new layer" dialog without any change to the layer name, the layer would end up with an empty string for its name.
This commit is contained in:
parent
f17bee0cb5
commit
256030da4e
Notes:
sideshowbarker
2024-07-17 05:23:40 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/256030da4e Pull-request: https://github.com/SerenityOS/serenity/pull/18042
2 changed files with 4 additions and 2 deletions
|
@ -28,7 +28,7 @@ CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Win
|
|||
name_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
m_name_textbox = main_widget->add<GUI::TextBox>();
|
||||
m_name_textbox->set_text("Layer"sv);
|
||||
m_name_textbox->set_text(default_layer_name);
|
||||
m_name_textbox->select_all();
|
||||
m_name_textbox->on_change = [this] {
|
||||
m_layer_name = m_name_textbox->text();
|
||||
|
|
|
@ -18,10 +18,12 @@ public:
|
|||
DeprecatedString const& layer_name() const { return m_layer_name; }
|
||||
|
||||
private:
|
||||
static constexpr StringView default_layer_name = "Layer"sv;
|
||||
|
||||
CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Window* parent_window);
|
||||
|
||||
Gfx::IntSize m_layer_size;
|
||||
DeprecatedString m_layer_name;
|
||||
DeprecatedString m_layer_name { default_layer_name };
|
||||
|
||||
RefPtr<GUI::TextBox> m_name_textbox;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue