• Agreed, maybe even Block them?

    Just don't call Bangle.loadWidgets in your clock and you won't get them.

    In terms of moving them, the biggest issue is whether the app itself is aware that they have moved, but if you're writing the app then there's no problem :)

    So... This is what the current drawWidgets function looks like: https://github.com/espruino/Espruino/blo­b/master/libs/js/banglejs/Bangle_drawWid­gets_Q3.js

    If you want to render them all down the left-hand side of the watch screen you can just add this to your watch face:

    Bangle.drawWidgets = (function() {
      if (global.WIDGETS) {
        var y=0, maxw=0;
        for (var wd of WIDGETS) {
      	  wd.x = 0;
      	  wd.y = y;
      	  y += 24;
          maxw = Math.max(wd.width, maxw);
        }
        g.reset();
        g.clearRect(0,0,maxw-1,g.getHeight()-1);­
        try { for (wd of WIDGETS) wd.draw(wd); } catch(e) {print(e);}
      }
    })
    

    I guess there's also the question of widget width since they can all be varying widths, and it is possible to rotate all the widgets too - you just have to override each widget's draw function so it renders to a buffer which you then rotate.

    Bangle.drawWidgets = (function() {
      if (global.WIDGETS) {
        var y=0;
        for (var wd of WIDGETS) {
      	  wd.x = 0;
      	  wd.y = y;
      	  y += wd.width;
        }
        g.reset().clearRect(0,0,23,g.getHeight()­-1);
        try { for (wd of WIDGETS) wd.draw(wd); } catch(e) {print(e);}
      }
    });
    
    Bangle.loadWidgets();
    Object.keys(WIDGETS).forEach(k => {
      var wd = WIDGETS[k];
      wd._draw = wd.draw;
      wd.draw = function() {
        if (!wd.width) return;
        var og = g, oy=wd.y;
        g = Graphics.createArrayBuffer(24,wd.width,1­6,{msb:true});
        g._reset = g.reset;
        g.reset = () => g._reset().setColor(og.theme.fg).setBgCo­lor(og.theme.bg);
        g.setRotation(1).setBgColor(og.theme.bg)­.clear();
        wd.y = 0;
        wd._draw(wd);
        wd.y = oy;
        og.drawImage(g,0,wd.y);
        g = og;
      };  
    });
    
    Bangle.drawWidgets();
    
About

Avatar for Gordon @Gordon started