Use app icon for windows and about
This commit is contained in:
10
data/icons/meson.build
Normal file
10
data/icons/meson.build
Normal file
@@ -0,0 +1,10 @@
|
||||
install_data(
|
||||
'@0@.svg'.format(app_id),
|
||||
install_dir: iconsdir / 'hicolor' / 'scalable' / 'apps'
|
||||
)
|
||||
|
||||
install_data(
|
||||
'@0@-symbolic.svg'.format(base_id),
|
||||
install_dir: iconsdir / 'hicolor' / 'symbolic' / 'apps',
|
||||
rename: '@0@-symbolic.svg'.format(app_id)
|
||||
)
|
1
data/meson.build
Normal file
1
data/meson.build
Normal file
@@ -0,0 +1 @@
|
||||
subdir('icons')
|
2
delfin/.gitignore
vendored
Normal file
2
delfin/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Gets generated by Meson
|
||||
src/meson_config.rs
|
@@ -1,3 +1,18 @@
|
||||
config = configure_file(
|
||||
input: 'src/meson_config.rs.in',
|
||||
output: 'meson_config.rs',
|
||||
configuration: {
|
||||
'APP_ID': app_id,
|
||||
},
|
||||
)
|
||||
|
||||
run_command(
|
||||
'cp',
|
||||
meson.project_build_root() / 'delfin' / 'meson_config.rs',
|
||||
meson.project_source_root() / 'delfin' / 'src' / 'meson_config.rs',
|
||||
check: true
|
||||
)
|
||||
|
||||
cargo_options = []
|
||||
|
||||
rust_target = 'debug'
|
||||
|
@@ -14,6 +14,7 @@ use crate::{
|
||||
library::{Library, LibraryOutput},
|
||||
locales::tera_tr,
|
||||
media_details::MediaDetails,
|
||||
meson_config::APP_ID,
|
||||
servers::server_list::{ServerList, ServerListOutput},
|
||||
tr,
|
||||
utils::{main_window::MAIN_APP_WINDOW_NAME, shift_state::shift_state_controller},
|
||||
@@ -107,6 +108,7 @@ impl Component for App {
|
||||
root: &Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
gtk::Window::set_default_icon_name(APP_ID);
|
||||
adw::StyleManager::default().set_color_scheme(CONFIG.read().general.theme().into());
|
||||
|
||||
// Use development styles when running debug build
|
||||
|
@@ -1,7 +1,7 @@
|
||||
use gtk::prelude::*;
|
||||
use relm4::{prelude::*, ComponentParts, SimpleComponent};
|
||||
|
||||
use crate::tr;
|
||||
use crate::{meson_config::APP_ID, tr};
|
||||
|
||||
pub(crate) struct About;
|
||||
|
||||
@@ -18,6 +18,7 @@ impl SimpleComponent for About {
|
||||
set_visible: true,
|
||||
|
||||
set_application_name: tr!("app-name"),
|
||||
set_application_icon: APP_ID,
|
||||
set_developer_name: "Avery ❤️",
|
||||
set_version: "0.0",
|
||||
set_license_type: gtk::License::Agpl30,
|
||||
|
@@ -7,6 +7,7 @@ pub mod jellyfin_api;
|
||||
pub mod library;
|
||||
pub mod locales;
|
||||
pub mod media_details;
|
||||
pub mod meson_config;
|
||||
pub mod preferences;
|
||||
pub mod servers;
|
||||
pub mod utils;
|
||||
|
@@ -1,4 +1,7 @@
|
||||
use delfin::app::{App, APP_BROKER};
|
||||
use delfin::{
|
||||
app::{App, APP_BROKER},
|
||||
meson_config::APP_ID,
|
||||
};
|
||||
use relm4::RelmApp;
|
||||
|
||||
fn main() {
|
||||
@@ -9,11 +12,7 @@ fn main() {
|
||||
video_player_gst::init_gst();
|
||||
}
|
||||
|
||||
let app = if cfg!(debug_assertions) {
|
||||
RelmApp::new("cafe.avery.Delfin.Devel")
|
||||
} else {
|
||||
RelmApp::new("cafe.avery.Delfin")
|
||||
};
|
||||
let app = RelmApp::new(APP_ID);
|
||||
|
||||
relm4_icons::initialize_icons();
|
||||
load_css();
|
||||
|
2
delfin/src/meson_config.rs.in
Normal file
2
delfin/src/meson_config.rs.in
Normal file
@@ -0,0 +1,2 @@
|
||||
// Generated by Meson from meson_config.rs.in - do not modify
|
||||
pub const APP_ID: &str = "@APP_ID@";
|
11
meson.build
11
meson.build
@@ -6,6 +6,8 @@ project(
|
||||
subproject_dir: 'video_player_mpv',
|
||||
)
|
||||
|
||||
gnome = import('gnome')
|
||||
|
||||
base_id = 'cafe.avery.Delfin'
|
||||
|
||||
cargo = find_program('cargo', required: true)
|
||||
@@ -28,5 +30,14 @@ if get_option('flatpak')
|
||||
)
|
||||
endif
|
||||
|
||||
prefix = get_option('prefix')
|
||||
datadir = prefix / get_option('datadir')
|
||||
iconsdir = datadir / 'icons'
|
||||
|
||||
subproject('sys')
|
||||
subdir('delfin')
|
||||
subdir('data')
|
||||
|
||||
gnome.post_install(
|
||||
gtk_update_icon_cache: true,
|
||||
)
|
||||
|
Reference in New Issue
Block a user