Add vector graphics as addable elements

Something is missing? Have an idea? Ask for new stuff here.
Post Reply
dew
Posts: 34
Joined: Wed Apr 03, 2019 7:09 pm

Add vector graphics as addable elements

Post by dew » Wed Apr 03, 2019 7:48 pm

Currently it's not possible to add scalable vector objects to a desktop or folder or panel.
I suggest the following vector graphics elements as natively implemented elements to be addable from LL directly with the suggested parameters.
All elements shall of course be scalable, rotatable etc. as vector objects (high quality).

custom SVG graphics (user defined)
  • reference to user selected / provided SVG file (sdcard, ...)
  • separate anchor point for placement, scale + rotation
  • position
line
  • separate anchor point for placement, scale + rotation
  • start position
  • end position
  • line width
  • line color RGBA
  • line style (full, dotted, ...)

polyline
  • separate anchor point for placement, scale + rotation
  • setpoints
  • line width
  • line color RGBA
  • line style (full, dotted, ...)
rectangle (box)
  • separate anchor point for placement, scale + rotation
  • position
  • width
  • height
  • outline width
  • outline color RGBA
  • outline line style
  • fill color(s)
    • single RGBA color
    • dual RGBA color gradient fill (box, circle etc.)
  • (optional) RGBA texture (with clamping modes, scale, rotation)
  • corner roundness (0..100%)
triangle
-> same params as rectangle but triangle shaped

polygon
  • separate anchor point for placement, scale + rotation
  • setpoints
  • outline width
  • outline color RGBA
  • outline line style
  • fill color(s)
    • single RGBA color
    • dual RGBA color gradient fill (box, circle etc.)
  • (optional) RGBA texture (with clamping modes, scale, rotation)
  • corner roundness (0..100%)
circle
  • separate anchor point for placement, scale + rotation
  • position
  • radius x
  • radius y
  • outline width
  • outline color RGBA
  • outline line style
  • fill color(s)
    • single RGBA color
    • dual RGBA color gradient fill (box, circle etc.)
  • (optional) RGBA texture (with clamping modes, scale, rotation)

Hope you like it :D

User avatar
F43nd1r
Posts: 38
Joined: Thu Jan 24, 2019 1:20 pm

Re: Add vector graphics as addable elements

Post by F43nd1r » Thu Apr 04, 2019 1:04 am

What advantage would this have over a custom view, which is drawn on by script?

User avatar
Pierrot
Site Admin
Posts: 181
Joined: Wed Jan 23, 2019 12:18 pm
Location: French Alps

Re: Add vector graphics as addable elements

Post by Pierrot » Thu Apr 04, 2019 5:21 am

This is well hidden, but Lightning supports vector graphics through a subset of SVG : https://www.lightninglauncher.com/scrip ... vgSvg.html.
It's fully functional though. This is available in both stable and beta, I don't know why the API reference is not up to date.
That being said, it's not easy to use.
IIRC you can load SVG images as you would for JPG, PNG, GIF. Once a SVG is loaded into memory you can manipulate individual elements through scripts.

But indeed, as F43nd1r said, it might be easier to directly use a custom view and issue painting operations on a 2D Canvas. This requires more knowledge, but since SVG is not well documented in the app, that's still the easiest solution...

dew
Posts: 34
Joined: Wed Apr 03, 2019 7:09 pm

Re: Add vector graphics as addable elements

Post by dew » Thu Apr 04, 2019 11:05 am

Well the advantage would be usability and ease of use.

When LL supports graphics elements as direct elements with associated UI to configure them then it's much quicker to add and manage these elements than having to script this by hand. This would also reach more users because the elements are easy to find and to use when they are handled like an app or a panel.

Do you have any link about how to include a SVG on the desktop with current options?

dew
Posts: 34
Joined: Wed Apr 03, 2019 7:09 pm

Re: Add vector graphics as addable elements

Post by dew » Thu Apr 04, 2019 11:06 am

Ah, sorry... You already posted a link 😂

dew
Posts: 34
Joined: Wed Apr 03, 2019 7:09 pm

Re: Add vector graphics as addable elements

Post by dew » Thu Apr 04, 2019 11:13 am

Well I had a look and while it's eventually doable this way it's still a lot more cumbersome than having dedicated elements which provide the listed graphic elements from my OP plus providing the associated properties in a UI.
I believe it does make a difference in terms of usability and reaching not so experienced users. Hope that makes sense.

Also looking at this feature suggestion:
viewtopic.php?f=5&t=83&p=455#p455
I believe it would be extraordinary hard to define a precise clipping mask polygon without user interface support...

dew
Posts: 34
Joined: Wed Apr 03, 2019 7:09 pm

Re: Add vector graphics as addable elements

Post by dew » Sat Apr 06, 2019 3:08 pm

Wanted to clarifiy my inital request a little bit.

The main differences and the biggest advantages over custom views are these:

- no code required, therefore usable by everyone
- directly accessible through the [+] menu
- extensive UI editor for interactively adding and editing all vector elements

This would bring a whole new level to LL for styling your desktops or creating interesting elements.
Semi-transparent fills (single color, multi-color gradients) and interactive editing by drawing these elements is something that is required to make this cool and easy of course.
I.e. the properies described above shall be interactively edited through the UI! E.g. you would tap to add a set point when you create a new polygon. Tap and move to move a set point. Etc.


I believe it's a very powerful addition to LL.
Hope you like it :D

User avatar
Pierrot
Site Admin
Posts: 181
Joined: Wed Jan 23, 2019 12:18 pm
Location: French Alps

Re: Add vector graphics as addable elements

Post by Pierrot » Sun Apr 07, 2019 8:48 am

This was the reasons for adding SVG into the app, but the job is only half done though. I'll try to resume it at some point.

dew
Posts: 34
Joined: Wed Apr 03, 2019 7:09 pm

Re: Add vector graphics as addable elements

Post by dew » Sun Apr 07, 2019 12:38 pm

😊👍

Post Reply