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 = []
|
cargo_options = []
|
||||||
|
|
||||||
rust_target = 'debug'
|
rust_target = 'debug'
|
||||||
|
@@ -14,6 +14,7 @@ use crate::{
|
|||||||
library::{Library, LibraryOutput},
|
library::{Library, LibraryOutput},
|
||||||
locales::tera_tr,
|
locales::tera_tr,
|
||||||
media_details::MediaDetails,
|
media_details::MediaDetails,
|
||||||
|
meson_config::APP_ID,
|
||||||
servers::server_list::{ServerList, ServerListOutput},
|
servers::server_list::{ServerList, ServerListOutput},
|
||||||
tr,
|
tr,
|
||||||
utils::{main_window::MAIN_APP_WINDOW_NAME, shift_state::shift_state_controller},
|
utils::{main_window::MAIN_APP_WINDOW_NAME, shift_state::shift_state_controller},
|
||||||
@@ -107,6 +108,7 @@ impl Component for App {
|
|||||||
root: &Self::Root,
|
root: &Self::Root,
|
||||||
sender: relm4::ComponentSender<Self>,
|
sender: relm4::ComponentSender<Self>,
|
||||||
) -> relm4::ComponentParts<Self> {
|
) -> relm4::ComponentParts<Self> {
|
||||||
|
gtk::Window::set_default_icon_name(APP_ID);
|
||||||
adw::StyleManager::default().set_color_scheme(CONFIG.read().general.theme().into());
|
adw::StyleManager::default().set_color_scheme(CONFIG.read().general.theme().into());
|
||||||
|
|
||||||
// Use development styles when running debug build
|
// Use development styles when running debug build
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use relm4::{prelude::*, ComponentParts, SimpleComponent};
|
use relm4::{prelude::*, ComponentParts, SimpleComponent};
|
||||||
|
|
||||||
use crate::tr;
|
use crate::{meson_config::APP_ID, tr};
|
||||||
|
|
||||||
pub(crate) struct About;
|
pub(crate) struct About;
|
||||||
|
|
||||||
@@ -18,6 +18,7 @@ impl SimpleComponent for About {
|
|||||||
set_visible: true,
|
set_visible: true,
|
||||||
|
|
||||||
set_application_name: tr!("app-name"),
|
set_application_name: tr!("app-name"),
|
||||||
|
set_application_icon: APP_ID,
|
||||||
set_developer_name: "Avery ❤️",
|
set_developer_name: "Avery ❤️",
|
||||||
set_version: "0.0",
|
set_version: "0.0",
|
||||||
set_license_type: gtk::License::Agpl30,
|
set_license_type: gtk::License::Agpl30,
|
||||||
|
@@ -7,6 +7,7 @@ pub mod jellyfin_api;
|
|||||||
pub mod library;
|
pub mod library;
|
||||||
pub mod locales;
|
pub mod locales;
|
||||||
pub mod media_details;
|
pub mod media_details;
|
||||||
|
pub mod meson_config;
|
||||||
pub mod preferences;
|
pub mod preferences;
|
||||||
pub mod servers;
|
pub mod servers;
|
||||||
pub mod utils;
|
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;
|
use relm4::RelmApp;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@@ -9,11 +12,7 @@ fn main() {
|
|||||||
video_player_gst::init_gst();
|
video_player_gst::init_gst();
|
||||||
}
|
}
|
||||||
|
|
||||||
let app = if cfg!(debug_assertions) {
|
let app = RelmApp::new(APP_ID);
|
||||||
RelmApp::new("cafe.avery.Delfin.Devel")
|
|
||||||
} else {
|
|
||||||
RelmApp::new("cafe.avery.Delfin")
|
|
||||||
};
|
|
||||||
|
|
||||||
relm4_icons::initialize_icons();
|
relm4_icons::initialize_icons();
|
||||||
load_css();
|
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',
|
subproject_dir: 'video_player_mpv',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
gnome = import('gnome')
|
||||||
|
|
||||||
base_id = 'cafe.avery.Delfin'
|
base_id = 'cafe.avery.Delfin'
|
||||||
|
|
||||||
cargo = find_program('cargo', required: true)
|
cargo = find_program('cargo', required: true)
|
||||||
@@ -28,5 +30,14 @@ if get_option('flatpak')
|
|||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
prefix = get_option('prefix')
|
||||||
|
datadir = prefix / get_option('datadir')
|
||||||
|
iconsdir = datadir / 'icons'
|
||||||
|
|
||||||
subproject('sys')
|
subproject('sys')
|
||||||
subdir('delfin')
|
subdir('delfin')
|
||||||
|
subdir('data')
|
||||||
|
|
||||||
|
gnome.post_install(
|
||||||
|
gtk_update_icon_cache: true,
|
||||||
|
)
|
||||||
|
Reference in New Issue
Block a user