bgrabitmap / bgracontrols

🆗 BGRA Controls is a set of graphical UI elements that you can use with Lazarus LCL applications.
https://bgrabitmap.github.io/bgracontrols/
182 stars 30 forks source link

Please simplify TBGRASVGTheme #196

Closed mikeprice99 closed 3 weeks ago

mikeprice99 commented 3 weeks ago

Currently the default theme properry 'ButtonNormal' has very complex SVG that contains too much 'Inkscape bloat' that makes it very difficult to edit. (It's 2800 characters in length.)

Can I propose changing the default SVG to this:

<svg  xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
  <defs>
    <linearGradient id="Grad1" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop style="stop-color:#ffffff;stop-opacity:1" offset="30%"/>
      <stop style="stop-color:#87cdde;stop-opacity:1" offset="70%"/>
    </linearGradient>
  </defs>
    <path style="fill:url(#Grad1);fill-opacity:1;stroke:#002255;stroke-width:1;stroke-opacity:1"
     d="m9.8,0.5h12.4c5.15,0 9.3,4.15 9.3,9.3v12.4c0,5.15-4.15,9.3-9.3,9.3h-12.4c-5.15, 0-9.3-4.15-9.3-9.3v-12.4c0-5.15 4.15-9.3 9.3-9.3z" />
</svg> 

In this version all the extra inkscape/sodpodi tags, empty style tag, unused IDs are removed, the gradient is defined with percentages and has a single simple definition. (Length: 540 characters with line breaks etc removed.)

I've just checked the source, it's on line 190 of the unit TBGRASVGTheme. (The SVG for checkboxes and radio buttons are very clean.) I haven't checked whether I can make the changes in GH myself. Can I?

lainz commented 3 weeks ago

Done in dev-bgracontrols branch, thanks-