|
@@ -282,6 +282,95 @@ pub struct DebConfig {
|
|
|
pub desktop_template: Option<PathBuf>,
|
|
|
}
|
|
|
|
|
|
+/// Position coordinates struct.
|
|
|
+#[derive(Default, Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
|
|
|
+#[cfg_attr(feature = "schema", derive(JsonSchema))]
|
|
|
+#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
|
|
+pub struct Position {
|
|
|
+ /// X coordinate.
|
|
|
+ pub x: u32,
|
|
|
+ /// Y coordinate.
|
|
|
+ pub y: u32,
|
|
|
+}
|
|
|
+
|
|
|
+/// Size of the window.
|
|
|
+#[derive(Default, Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
|
|
|
+#[cfg_attr(feature = "schema", derive(JsonSchema))]
|
|
|
+#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
|
|
+pub struct Size {
|
|
|
+ /// Width of the window.
|
|
|
+ pub width: u32,
|
|
|
+ /// Height of the window.
|
|
|
+ pub height: u32,
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/// Configuration for Apple Disk Image (.dmg) bundles.
|
|
|
+///
|
|
|
+/// See more: https://tauri.app/v1/api/config#dmgconfig
|
|
|
+#[skip_serializing_none]
|
|
|
+#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
|
|
|
+#[cfg_attr(feature = "schema", derive(JsonSchema))]
|
|
|
+#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
|
|
+pub struct DmgConfig {
|
|
|
+ /// Image to use as the background in dmg file. Accepted formats: `png`/`jpg`/`gif`.
|
|
|
+ pub background: Option<PathBuf>,
|
|
|
+ /// Position of volume window on screen.
|
|
|
+ pub window_position: Option<Position>,
|
|
|
+ /// Size of volume window.
|
|
|
+ #[serde(
|
|
|
+ default = "window_size",
|
|
|
+ alias = "window-size"
|
|
|
+ )]
|
|
|
+ pub window_size: Size,
|
|
|
+ /// Position of app file on window.
|
|
|
+ #[serde(
|
|
|
+ default = "app_position",
|
|
|
+ alias = "app-position"
|
|
|
+ )]
|
|
|
+ pub app_position: Position,
|
|
|
+ /// Position of application folder on window.
|
|
|
+ #[serde(
|
|
|
+ default = "application_folder_position",
|
|
|
+ alias = "application-folder-position"
|
|
|
+ )]
|
|
|
+ pub application_folder_position: Position,
|
|
|
+}
|
|
|
+
|
|
|
+impl Default for DmgConfig {
|
|
|
+ fn default() -> Self {
|
|
|
+ Self {
|
|
|
+ background: None,
|
|
|
+ window_position: None,
|
|
|
+ window_size: window_size(),
|
|
|
+ app_position: app_position(),
|
|
|
+ application_folder_position: application_folder_position(),
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+fn window_size() -> Size {
|
|
|
+ Size {
|
|
|
+ width: 660,
|
|
|
+ height: 400,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+fn app_position() -> Position {
|
|
|
+ Position {
|
|
|
+ x: 180,
|
|
|
+ y: 170,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+fn application_folder_position() -> Position {
|
|
|
+ Position {
|
|
|
+ x: 480,
|
|
|
+ y: 170,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
fn de_minimum_system_version<'de, D>(deserializer: D) -> Result<Option<String>, D::Error>
|
|
|
where
|
|
|
D: Deserializer<'de>,
|
|
@@ -850,6 +939,9 @@ pub struct BundleConfig {
|
|
|
/// Configuration for the Debian bundle.
|
|
|
#[serde(default)]
|
|
|
pub deb: DebConfig,
|
|
|
+ /// DMG-specific settings.
|
|
|
+ #[serde(default)]
|
|
|
+ pub dmg: DmgConfig,
|
|
|
/// Configuration for the macOS bundles.
|
|
|
#[serde(rename = "macOS", default)]
|
|
|
pub macos: MacConfig,
|
|
@@ -2440,6 +2532,7 @@ mod build {
|
|
|
let long_description = quote!(None);
|
|
|
let appimage = quote!(Default::default());
|
|
|
let deb = quote!(Default::default());
|
|
|
+ let dmg = quote!(Default::default());
|
|
|
let macos = quote!(Default::default());
|
|
|
let external_bin = opt_vec_str_lit(self.external_bin.as_ref());
|
|
|
let windows = &self.windows;
|
|
@@ -2463,6 +2556,7 @@ mod build {
|
|
|
long_description,
|
|
|
appimage,
|
|
|
deb,
|
|
|
+ dmg,
|
|
|
macos,
|
|
|
external_bin,
|
|
|
windows,
|
|
@@ -2771,6 +2865,7 @@ mod test {
|
|
|
long_description: None,
|
|
|
appimage: Default::default(),
|
|
|
deb: Default::default(),
|
|
|
+ dmg: Default::default(),
|
|
|
macos: Default::default(),
|
|
|
external_bin: None,
|
|
|
windows: Default::default(),
|