Fix android/ios muda cfg

This commit is contained in:
Jonathan Kelley committed 2024-01-05 23:37:10 -08:00
1 parent e9e7219b4b
commit 0ac8955bab
5 files changed
+16 -8

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
use crate::{
cfg::{Config, WindowCloseBehaviour},
config::{Config, WindowCloseBehaviour},
desktop_context::WindowEventHandlers,
element::DesktopElement,
file_upload::FileDialogRequest,
File renamed without changes.
+7 -3
View File
@@ -5,7 +5,7 @@
mod app;
mod assets;
mod cfg;
mod config;
mod desktop_context;
mod edits;
mod element;
@@ -15,7 +15,6 @@ mod events;
mod file_upload;
mod hooks;
mod ipc;
mod menubar;
mod protocol;
mod query;
mod shortcut;
@@ -25,9 +24,14 @@ mod webview;
#[cfg(feature = "collect-assets")]
mod collect_assets;
// mobile shortcut is only supported on mobile platforms
#[cfg(any(target_os = "ios", target_os = "android"))]
mod mobile_shortcut;
// menu bar is only supported on desktop platforms
#[cfg(not(any(target_os = "android", target_os = "ios")))]
mod menubar;
// The main entrypoint for this crate
pub use launch::*;
mod launch;
@@ -41,7 +45,7 @@ pub use wry;
// Public exports
pub use assets::AssetRequest;
pub use cfg::{Config, WindowCloseBehaviour};
pub use config::{Config, WindowCloseBehaviour};
pub use desktop_context::{
window, DesktopContext, DesktopService, WryEventHandler, WryEventHandlerId,
};
+6
View File
@@ -1,6 +1,12 @@
use muda::{Menu, PredefinedMenuItem, Submenu};
use tao::window::Window;
pub fn build_menu(window: &Window, default_menu_bar: bool) {
if default_menu_bar {
build_menu_bar(build_default_menu_bar(), window)
}
}
#[allow(unused)]
pub fn build_menu_bar(menu: Menu, window: &Window) {
#[cfg(target_os = "windows")]
+2 -4
View File
@@ -28,10 +28,8 @@ impl WebviewInstance {
let window = cfg.window.clone().build(&shared.target).unwrap();
// TODO: allow users to specify their own menubars, again :/
if cfg.enable_default_menu_bar {
use crate::menubar::*;
build_menu_bar(build_default_menu_bar(), &window);
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]
crate::menubar::build_menu(&window, cfg.enable_default_menu_bar);
// We assume that if the icon is None in cfg, then the user just didnt set it
if cfg.window.window.window_icon.is_none() {