mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 04:17:34 +00:00
LibGUI: Make GUI::FileIconProvider::icon_for_executable() a public API
This way we can use it instead of icon_for_path() in a bunch of places and avoid loading the full FileIconProvider configuration.
This commit is contained in:
parent
a49fd0ff5e
commit
ffa241250b
6 changed files with 20 additions and 6 deletions
|
@ -46,7 +46,7 @@ namespace FileManager {
|
|||
|
||||
NonnullRefPtr<GUI::Action> LauncherHandler::create_launch_action(Function<void(const LauncherHandler&)> launch_handler)
|
||||
{
|
||||
auto icon = GUI::FileIconProvider::icon_for_path(details().executable).bitmap_for_size(16);
|
||||
auto icon = GUI::FileIconProvider::icon_for_executable(details().executable).bitmap_for_size(16);
|
||||
return GUI::Action::create(details().name, move(icon), [this, launch_handler = move(launch_handler)](auto&) {
|
||||
launch_handler(*this);
|
||||
});
|
||||
|
|
|
@ -276,7 +276,7 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
|
|||
if (role == GUI::ModelRole::Display) {
|
||||
switch (index.column()) {
|
||||
case Column::Icon: {
|
||||
auto icon = GUI::FileIconProvider::icon_for_path(thread.current_state.executable);
|
||||
auto icon = GUI::FileIconProvider::icon_for_executable(thread.current_state.executable);
|
||||
if (auto* bitmap = icon.bitmap_for_size(16))
|
||||
return *bitmap;
|
||||
return *m_generic_process_icon;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue