mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-21 04:28:12 +08:00
Desktop: Display taskbar icon on Windows (#3376)
* task bar icon * limit cef render processes to 1 * disable more chrome features
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use winit::dpi::PhysicalSize;
|
||||
use winit::event_loop::ActiveEventLoop;
|
||||
use winit::icon::Icon;
|
||||
use winit::platform::windows::WinIcon;
|
||||
use winit::platform::windows::{WinIcon, WindowAttributesWindows};
|
||||
use winit::window::{Window, WindowAttributes};
|
||||
|
||||
use crate::event::AppEventScheduler;
|
||||
@@ -11,12 +12,10 @@ pub(super) struct NativeWindowImpl {
|
||||
|
||||
impl super::NativeWindow for NativeWindowImpl {
|
||||
fn configure(attributes: WindowAttributes, _event_loop: &dyn ActiveEventLoop) -> WindowAttributes {
|
||||
if let Ok(win_icon) = WinIcon::from_resource(1, None) {
|
||||
let icon = Icon(std::sync::Arc::new(win_icon));
|
||||
attributes.with_window_icon(Some(icon))
|
||||
} else {
|
||||
attributes
|
||||
}
|
||||
let icon = WinIcon::from_resource(1, Some(PhysicalSize::new(256, 256))).ok().map(|icon| Icon(std::sync::Arc::new(icon)));
|
||||
let win_window = WindowAttributesWindows::default().with_taskbar_icon(icon);
|
||||
let icon = WinIcon::from_resource(1, None).ok().map(|icon| Icon(std::sync::Arc::new(icon)));
|
||||
attributes.with_window_icon(icon).with_platform_attributes(Box::new(win_window))
|
||||
}
|
||||
|
||||
fn new(window: &dyn Window, _app_event_scheduler: AppEventScheduler) -> Self {
|
||||
|
||||
Reference in New Issue
Block a user