Skip to content
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

fix: Bundle Icons For macOS #50

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 77 additions & 55 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Dependencies (Linux)
- `libxkbcommon-dev`
- `libcosmic`
- `libsqlite3-dev`
- `cosmic-icons`

Dependencies (macOS)

Expand Down
3 changes: 2 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ build-release-macos *args:
lipo "target/aarch64-apple-darwin/release/{{name}}" -create -output "{{app-binary}}"

mkdir -p "{{app-binary-dir}}"
mkdir -p "{{app-extras-dir}}"
mkdir -p "{{app-extras-dir}}/icons/"
cp -fRp "{{app-template}}" "{{app-dir}}"
cp -fp "{{app-binary}}" "{{app-binary-dir}}"
cp ./res/icons/* "{{app-extras-dir}}/icons/"
touch -r "{{app-binary}}" "{{app-dir}}/{{app-name}}"
echo "Created '{{app-name}}' in '{{app-dir}}'"
git stash -- {{app-template-plist}}
Expand Down
12 changes: 12 additions & 0 deletions res/icons/accessories-clock-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions res/icons/contact-new-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions res/icons/dialog-information-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions res/icons/dialog-warning-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions res/icons/emblem-shared-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions res/icons/emblem-synchronizing-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions res/icons/insert-text-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions res/icons/mail-archive-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/icons/mail-mark-important-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions res/icons/network-server-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions res/icons/system-lock-screen-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions res/icons/text-x-generic-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions res/icons/user-available-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions res/icons/web-browser-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions res/icons/x-office-document-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions res/icons/x-office-spreadsheet-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::pages::accounts::{add_account, edit_account, AppAccountsMessage, Page
use crate::pages::bookmarks::{
edit_bookmark, new_bookmark, view_notes, AppBookmarksMessage, PageBookmarksView,
};
use crate::utils::icons::load_icon;
use cosmic::app::{Core, Task};
use cosmic::cosmic_config::{self, CosmicConfigEntry, Update};
use cosmic::cosmic_theme::{self, ThemeMode};
Expand Down Expand Up @@ -255,7 +256,7 @@ impl Application for Cosmicding {
let dialog = match dialog_page {
DialogPage::RemoveAccount(account) => {
widget::dialog(fl!("remove") + " " + { &account.display_name })
.icon(icon::from_name("dialog-warning-symbolic").size(58).icon())
.icon(icon::icon(load_icon("dialog-warning-symbolic")).size(58))
.body(fl!("remove-account-confirm"))
.primary_action(
widget::button::destructive(fl!("yes")).on_press_maybe(Some(
Expand All @@ -268,7 +269,7 @@ impl Application for Cosmicding {
}
DialogPage::RemoveBookmark(account, bookmark) => {
widget::dialog(fl!("remove") + " " + { &bookmark.title })
.icon(icon::from_name("dialog-warning-symbolic").size(58).icon())
.icon(icon::icon(load_icon("dialog-warning-symbolic")).size(58))
.body(fl!("remove-bookmark-confirm"))
.primary_action(widget::button::destructive(fl!("yes")).on_press_maybe(Some(
Message::CompleteRemoveDialog(account.clone(), Some(bookmark.clone())),
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod app;
mod config;

Check warning on line 2 in src/main.rs

View workflow job for this annotation

GitHub Actions / lint

unused import: `std::env`

warning: unused import: `std::env` --> src/utils/icons.rs:2:5 | 2 | use std::env; | ^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
mod db;
mod http;
mod i18n;
Expand All @@ -9,6 +9,7 @@
mod nav;
mod pages;
mod style;
mod utils;

use crate::config::{Config, CONFIG_VERSION};
use app::{Flags, APPID};
Expand Down
5 changes: 3 additions & 2 deletions src/nav.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::utils::icons::load_icon;
use cosmic::{widget::icon, Element};

use crate::{app, fl};
Expand All @@ -24,8 +25,8 @@ impl AppNavPage {
}
pub fn icon(self) -> cosmic::widget::Icon {
match self {
Self::BookmarksView => icon::from_name("web-browser-symbolic").icon(),
Self::AccountsView => icon::from_name("contact-new-symbolic").icon(),
Self::BookmarksView => icon::icon(load_icon("web-browser-symbolic")),
Self::AccountsView => icon::icon(load_icon("contact-new-symbolic")),
}
}

Expand Down
Loading
Loading