mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:37:44 +00:00
ClipboardHistory: Fix crash when deleting without selection
* Fix by only activating the deletion action if we have a selection
This commit is contained in:
parent
3eca77bd86
commit
138c3c7d58
1 changed files with 1 additions and 0 deletions
|
@ -85,6 +85,7 @@ int main(int argc, char* argv[])
|
|||
auto entry_context_menu = GUI::Menu::construct();
|
||||
entry_context_menu->add_action(delete_action);
|
||||
table_view.on_context_menu_request = [&](const GUI::ModelIndex&, const GUI::ContextMenuEvent& event) {
|
||||
delete_action->set_enabled(!table_view.selection().is_empty());
|
||||
entry_context_menu->popup(event.screen_position());
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue