Design Monkey
Weblog of Hylke Bons

SparkleShare Plugins

Sunday, October 2nd, 2011

Yesterday I did some work on adding plugin support to SparkleShare. This feature allows you to write your own plugins in the form of a simple XML file. It’s possible to preset an address or a complete address + repository, as well as which backend to use (only Git and experimental Mercurial at this point):

<?xml version="1.0" encoding="UTF-8"?>
<sparkleshare>
  <plugin>
    <info>
      <name>Red Hat UX Team Hub</name>
      <description>Internal server for the UX team</description>
      <icon>redhat.png</icon>
      <backend>Git</backend>
    </info>
    <address>
      <value>ssh://git@design.bos.lab.redhat.com/</value>
      <example></example>
    </address>
    <path>
      <value></value>
      <example>/project</example>
    </path>
  </plugin>
</sparkleshare>

Save the XML file (ending with .xml, and along with the 24×24px icon) in ~/.config/sparkleshare/plugins and it will appear the next time you start SparkleShare. Granted, it’s not a very friendly way to add plugins, but I’ll work on that.

SparkleShare Plugins

By the way: does anyone know how to make the secondary description line in the TreeView row 50% transparent and white when the row is selected? I guess I have to take the selection background colour and the selected text colour and then blend them, but I’ve no idea how… :)


What people think...


  1.  Monday, October 3rd, 2011 at 00:09

    To customize how you’re rendering text you probably want to write your own GtkCellRenderer. For C# probably the closest example is the Vala one I wrote:
    http://live.gnome.org/Vala/GtkCellRendererSample

  2.  Monday, October 3rd, 2011 at 00:16
    Hylke  

    @Alberto Thanks, I’ll have a look :)

  3.  Monday, October 3rd, 2011 at 17:19

    Gee, that’s some crazy sh*t one has to do to get a label colored :/

  4.  Monday, October 3rd, 2011 at 21:12
    Hylke  

    @Jakub indeed. This has to be made much easier as we’re using this pattern more and more now too.

  5.  Tuesday, October 4th, 2011 at 06:36

    I have some Python code that should show how to do the colour trick you’re looking for: http://bazaar.launchpad.net/~ubuntu-wine/vineyard/trunk/view/head:/vineyard/common.py .

    The interesting parts are the colour mix function at line 1439 and the cell renderer (actually the commented out code in that) at 1211.

    It is indeed crazy what one needs to do to the list views sometimes. Vineyard has, I believe, 3 different proxy list widgets for that reason, though that’s probably overkill :P

    Great project, SparkleShare, by the way!

  6.  Tuesday, October 4th, 2011 at 15:18
    Hylke  

    @Christian That did the trick. Thank you. :)

  7.  Thursday, October 20th, 2011 at 02:44

    I guess blending would be done by using the background color and adding half (or removing half) of the typical text color. It’s simple math, really. If the background’s color is rgb(255,255,255) and the standard text color is rgb(128,128,128), then I guess adding half of 128 to the original 128 (64+128 = 192) would produce a color close to this. If I had the chance, I would produce a JavaScript example just for this because it’s a very good design question to ask and should be a color selection.


Leave your thoughts

Due to spam I check every comment myself,
so it may take a little longer for your comment to appear.


© 2006–2012  Hylke Bons