mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:37:45 +00:00
PixelPaint: Allow ImageEditor event to append info to the statusbar
This provides an event on ImageEditor for other functions to activate functions when appended_status_info is updated
This commit is contained in:
parent
bf06f49417
commit
29665668b6
4 changed files with 33 additions and 1 deletions
|
@ -344,6 +344,8 @@ void ImageEditor::set_editor_color_to_color_at_mouse_position(GUI::MouseEvent co
|
|||
color = layer->currently_edited_bitmap().get_pixel(position);
|
||||
}
|
||||
|
||||
set_appended_status_info(DeprecatedString::formatted("R:{}, G:{}, B:{}, A:{} [{}]", color.red(), color.green(), color.blue(), color.alpha(), color.to_deprecated_string()));
|
||||
|
||||
// We picked a transparent pixel, do nothing.
|
||||
if (!color.alpha())
|
||||
return;
|
||||
|
@ -868,4 +870,11 @@ void ImageEditor::selection_did_change()
|
|||
update();
|
||||
}
|
||||
|
||||
void ImageEditor::set_appended_status_info(DeprecatedString new_status_info)
|
||||
{
|
||||
m_appended_status_info = new_status_info;
|
||||
if (on_appended_status_info_change)
|
||||
on_appended_status_info_change(m_appended_status_info);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue