[gpodder] Re: gPodder (color) customization

  • From: Thomas Perl <th.perl@xxxxxxxxx>
  • To: gpodder@xxxxxxxxxxxxx
  • Date: Fri, 14 Sep 2012 21:31:45 +0200

Hi Marcos,

2012/9/12 Marcos Riban <marcosriban@xxxxxxxxx>
> regarding the "theming" thing I agree with you as this is exactly what I had 
> in mind myself: adjusting gPodder to my personal taste without generalizing 
> it or forcing it upon the public.
> If you could tell me where to edit the source code, that would be very kind.

Here we go:

> All customizations refer to the podcast list on the left side:
> 1) Set a custom background color (#e7ebef)

In src/gpodder/gtkui/main.py at the beginning of init_podcast_list_treeview, do:

self.treeChannels.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse('#e7ebef'))

> 2) Set a different size for the podcast pictures

In the same function, a few lines below, change the iconcell width property:

iconcell.set_property('width', YOUR_CUSTOM_SIZE)

And you also have to edit src/gpodder/gtkui/model.py, search for
self._max_image_side = ... and modify it, e.g.:

self._max_image_side = YOUR_CUSTOM_SIZE

> 3) Increase font size of podcast title

You can do that in def _format_description(self, ...) in the same file
(model.py), simply use Pango Markup for it:

http://developer.gnome.org/pango/stable/PangoMarkupFormat.html

For example, you can change this line:

d.append(title_markup)

to this:

d.append('<span size="xx-large">' + title_markup + '</span>')

> 4) Hide the description text below the podcast title

In the same function, remove the 4 lines at the end (the first line is
"if description_markup.strip():") and only add the following line
instead:

return ''.join(d)

> 5) Edit the look of the dynamic episode count and place it below the podcast
> title like this: "New: 2 | Total: 4". So instead of having the episode count
> on the right side of the podcast title I would like to see it below where
> the description text (4) was before.

In src/gpodder/gtkui/main.py comment out the following lines:

        iconcell = gtk.CellRendererPixbuf()
        iconcell.set_property('xalign', 1.0)
        column.pack_start(iconcell, False)
        column.add_attribute(iconcell, 'pixbuf', PodcastListModel.C_PILL)
        column.add_attribute(iconcell, 'visible',
PodcastListModel.C_PILL_VISIBLE)

How to add the episode count and things to the description is left as
an exercise to the reader, otherwise it wouldn't be fun at all ;)
(Hint: _format_description has some interesting parameters that might
come in handy).

Voila: http://o.thp.io/images/gpodder-customization-example_2012-09-14.png

Enjoy,
Thomas

Other related posts: