os-js / osjs-client

OS.js Client Module
https://manual.os-js.org/
Other
31 stars 31 forks source link

Add config option to override application window options (#115) #116

Closed andersevenrud closed 4 years ago

andersevenrud commented 4 years ago

This PR adds the option to override any application default window spawn option via core configuration.

Schema is (in src/client/config.js):

{
  application: {
    windows: [
      {
        // Application metadata name
        application: string | RegExp | undefined,

        // Window ID      
        window: string | RegExp | undefined,

        // The following options are overridable
        options: {
          dimension: WindowDimension?,
          position: WindowPosition?,
          attributes: WindowAttributes?
        }
      }
    ]
  }
}

If no application is defined, the options will override any window match (with is the id option assigned to a window on construction. Note that a Window ID is unique per application, not globally.)

andersevenrud commented 4 years ago

Example:

{
  application: {
    windows: [
      {
        application: 'FileManager',     
        window: 'FileManager',
        options: {
          dimension: {width: 800, height: 800}
        }
      }
    ]
  }
}