소스 검색

copy cli config definition window visibility defaults (#1353)

chip 4 년 전
부모
커밋
53910ff7ac
2개의 변경된 파일12개의 추가작업 그리고 4개의 파일을 삭제
  1. 10 2
      cli/core/config_definition.rs
  2. 2 2
      cli/core/schema.json

+ 10 - 2
cli/core/config_definition.rs

@@ -228,16 +228,24 @@ pub struct WindowConfig {
   #[serde(default)]
   pub maximized: bool,
   /// Whether the window is visible or not.
-  #[serde(default)]
+  #[serde(default = "default_visible")]
   pub visible: bool,
   /// Whether the window should have borders and bars.
-  #[serde(default)]
+  #[serde(default = "default_decorations")]
   pub decorations: bool,
   /// Whether the window should always be on top of other windows.
   #[serde(default)]
   pub always_on_top: bool,
 }
 
+fn default_visible() -> bool {
+  true
+}
+
+fn default_decorations() -> bool {
+  true
+}
+
 #[skip_serializing_none]
 #[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize, JsonSchema)]
 #[serde(rename_all = "camelCase", deny_unknown_fields)]

+ 2 - 2
cli/core/schema.json

@@ -929,7 +929,7 @@
         },
         "decorations": {
           "description": "Whether the window should have borders and bars.",
-          "default": false,
+          "default": true,
           "type": "boolean"
         },
         "fullscreen": {
@@ -1015,7 +1015,7 @@
         },
         "visible": {
           "description": "Whether the window is visible or not.",
-          "default": false,
+          "default": true,
           "type": "boolean"
         },
         "width": {