jarek-foksa / xel

Xel - Widget toolkit for building native-like Electron and Web apps
https://xel-toolkit.org
Other
677 stars 58 forks source link

Deprecate global "size" setting #129

Closed jarek-foksa closed 10 months ago

jarek-foksa commented 11 months ago

Global size setting should be delegated to the host environment. I have already migrated Boxy SVG to rely exclusively on the zoom factor set using webFrame.setZoomFactor() (Electron) or the native "Zoom in/out" controls (PWA).

Following APIs should be removed from Xel:

The size getter/setter on each widget should be adjusted so that the only allowed values are "small", "large" or null (default):

class {
  // @type "small" || "large" || null
  // @default null
  // @attribute
  get size() {
    let size = this.getAttribute("size");
    return ["small", "large"].includes(size) ? size : null;
  }
  set size(size) {
    ["small", "large"].includes(size) ? this.setAttribute("size", size) : this.removeAttribute("size");
  }
}

Finally, make sure to increase the major Xel version number and document all breaking changes in the changelog.

jarek-foksa commented 10 months ago

Done (https://github.com/jarek-foksa/xel/commit/571c4ecbab99b720c8b1516406073d6a50bdbf5d).