mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
LibGUI: Show action icons in CommandPalette when available :^)
This commit is contained in:
parent
3e7e52c5f0
commit
30d4f4b010
1 changed files with 5 additions and 0 deletions
|
@ -20,6 +20,7 @@ namespace GUI {
|
|||
class ActionModel final : public GUI::Model {
|
||||
public:
|
||||
enum Column {
|
||||
Icon,
|
||||
Text,
|
||||
Shortcut,
|
||||
__Count,
|
||||
|
@ -59,6 +60,10 @@ public:
|
|||
auto& action = *static_cast<GUI::Action*>(index.internal_data());
|
||||
|
||||
switch (index.column()) {
|
||||
case Column::Icon:
|
||||
if (action.icon())
|
||||
return *action.icon();
|
||||
return "";
|
||||
case Column::Text:
|
||||
return Gfx::parse_ampersand_string(action.text());
|
||||
case Column::Shortcut:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue