-
Notifications
You must be signed in to change notification settings - Fork 33
[Feature]: Relative app icon paths #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,3 +19,4 @@ third_party/*/patches/.applied_* | |
| __pycache__/ | ||
| libs/libfreetype/include/ | ||
| utils/.cached/* | ||
| .vscode | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // Begining of possible AssetManager to locate/read/write to files and folders in the app directory | ||
| namespace LFoundation { | ||
|
|
||
| class AssetManager { | ||
| public: | ||
| AssetManager(std::string name) { | ||
|
nimelehin marked this conversation as resolved.
Outdated
|
||
| app_root = "/Applications/"; | ||
| app_root += name + ".app/Content/"; | ||
| } | ||
|
|
||
| ~AssetManager() = default; | ||
|
|
||
| std::string find(std::string path) { | ||
| return app_root + path; | ||
| } | ||
| private: | ||
| std::string app_root; | ||
|
nimelehin marked this conversation as resolved.
Outdated
|
||
| }; | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "icon_rel_path": "Resources/about.icon/", | ||
| "assets": ["Resources"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "icon_rel_path": "Resources/activity_monitor.icon", | ||
| "assets": ["Resources"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "icon_rel_path": "Resources/calculator.icon", | ||
| "assets": ["Resources"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "icon_rel_path": "Resources/terminal.icon", | ||
| "assets": ["Resources"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,12 @@ class AppListViewController : public UI::ViewController<AppListView> { | |
| LG::PNG::PNGLoader loader; | ||
|
|
||
| std::string icon_path = jdict_root->data()["icon_path"]->cast_to<LFoundation::Json::StringObject>()->data(); | ||
| std::string icon_rel_path = jdict_root->data()["icon_rel_path"]->cast_to<LFoundation::Json::StringObject>()->data(); | ||
|
|
||
| if (!icon_rel_path.empty()) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding an "empty" icon if
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, so that means
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should unify As an alternative to this |
||
| icon_path = content_dir + icon_rel_path; | ||
| } | ||
|
|
||
| new_ent.set_icon(loader.load_from_file(icon_path + "/32x32.png")); | ||
|
|
||
| std::string rel_exec_path = jdict_root->data()["exec_rel_path"]->cast_to<LFoundation::Json::StringObject>()->data(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.