mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:37:43 +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 {
|
class ActionModel final : public GUI::Model {
|
||||||
public:
|
public:
|
||||||
enum Column {
|
enum Column {
|
||||||
|
Icon,
|
||||||
Text,
|
Text,
|
||||||
Shortcut,
|
Shortcut,
|
||||||
__Count,
|
__Count,
|
||||||
|
@ -59,6 +60,10 @@ public:
|
||||||
auto& action = *static_cast<GUI::Action*>(index.internal_data());
|
auto& action = *static_cast<GUI::Action*>(index.internal_data());
|
||||||
|
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
|
case Column::Icon:
|
||||||
|
if (action.icon())
|
||||||
|
return *action.icon();
|
||||||
|
return "";
|
||||||
case Column::Text:
|
case Column::Text:
|
||||||
return Gfx::parse_ampersand_string(action.text());
|
return Gfx::parse_ampersand_string(action.text());
|
||||||
case Column::Shortcut:
|
case Column::Shortcut:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue