mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
PixelPaint: Fix initial tool selection
This changes how the initial tool is beeing set on application startup. With this change the initial tool is set the same way as when the tool is changed via the frontend. Thus it also updates the tool properties window which wasn't done before leaving the properties empty as long the tool was changed for the first time.
This commit is contained in:
parent
2b44c4c3f7
commit
d462d6280a
Notes:
sideshowbarker
2024-07-17 02:23:25 +09:00
Author: https://github.com/Torstennator Commit: https://github.com/SerenityOS/serenity/commit/d462d6280a Pull-request: https://github.com/SerenityOS/serenity/pull/22256
1 changed files with 5 additions and 2 deletions
|
@ -70,9 +70,12 @@ void ToolboxWidget::setup_tools()
|
|||
tool->set_action(action);
|
||||
m_tools.append(move(tool));
|
||||
if (is_default_tool) {
|
||||
VERIFY(m_active_tool == nullptr);
|
||||
m_active_tool = m_tools[m_tools.size() - 1];
|
||||
action->set_checked(true);
|
||||
auto default_tool_index = m_tools.size() - 1;
|
||||
deferred_invoke([&, default_tool_index]() {
|
||||
VERIFY(m_active_tool == nullptr);
|
||||
on_tool_selection(m_tools[default_tool_index]);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue