2020-01-13 23:07:43 +01:00
|
|
|
#!/usr/bin/env python3
|
2012-02-05 23:42:23 +01:00
|
|
|
# Progressbar icon tester
|
|
|
|
# Thomas Perl <thp.io/about>; 2012-02-05
|
|
|
|
#
|
|
|
|
# based on: Simple script to test gPodder's "pill" pixbuf implementation
|
|
|
|
# Thomas Perl <thp.io/about>; 2009-09-13
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
2016-09-28 11:47:44 +02:00
|
|
|
from gi.repository import Gtk
|
2012-02-05 23:42:23 +01:00
|
|
|
|
|
|
|
from gpodder.gtkui.draw import draw_cake_pixbuf
|
|
|
|
|
2018-07-24 11:08:10 +02:00
|
|
|
sys.path.insert(0, 'src')
|
|
|
|
|
|
|
|
|
2012-02-05 23:42:23 +01:00
|
|
|
def gen(percentage):
|
|
|
|
pixbuf = draw_cake_pixbuf(percentage)
|
2016-09-28 11:47:44 +02:00
|
|
|
return Gtk.Image.new_from_pixbuf(pixbuf)
|
2012-02-05 23:42:23 +01:00
|
|
|
|
2018-02-10 11:11:20 +01:00
|
|
|
|
2016-09-28 11:47:44 +02:00
|
|
|
w = Gtk.Window()
|
|
|
|
w.connect('destroy', Gtk.main_quit)
|
|
|
|
v = Gtk.VBox()
|
2012-02-05 23:42:23 +01:00
|
|
|
w.add(v)
|
2017-03-26 01:25:04 +01:00
|
|
|
for y in range(1):
|
2016-09-28 11:47:44 +02:00
|
|
|
h = Gtk.HBox()
|
2012-02-05 23:42:23 +01:00
|
|
|
h.set_homogeneous(True)
|
|
|
|
v.add(h)
|
|
|
|
PARTS = 20
|
2017-03-26 01:25:04 +01:00
|
|
|
for x in range(PARTS + 1):
|
2018-03-04 21:15:21 +01:00
|
|
|
h.add(gen(x / PARTS))
|
2012-02-05 23:42:23 +01:00
|
|
|
w.set_default_size(400, 100)
|
|
|
|
w.show_all()
|
2016-09-28 11:47:44 +02:00
|
|
|
Gtk.main()
|