Commit 44c92ad2 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

Bug 562386 – PF_SLIDER and PF_SPINNER 'Step' values do not change

2008-11-27  Sven Neumann  <sven@gimp.org>

	Bug 562386 – PF_SLIDER and PF_SPINNER 'Step' values do not 
change
	consistently...

	* plug-ins/pygimp/gimpfu.py (SpinnerEntry): initialize the
	spin-button the way that gtk_spin_button_new_with_range() is
	implemented.


svn path=/trunk/; revision=27726
parent aea5b1a9
2008-11-27 Sven Neumann <sven@gimp.org>
Bug 562386 PF_SLIDER and PF_SPINNER 'Step' values do not change
consistently...
* plug-ins/pygimp/gimpfu.py (SpinnerEntry): initialize the
spin-button the way that gtk_spin_button_new_with_range() is
implemented.
2008-11-26 Martin Nordholts <martinn@svn.gnome.org>
Bug 562366 Default image dimensions are not correctly
......
......@@ -71,6 +71,7 @@ are installed.
'''
import string as _string
import math
import gimp
import gimpcolor
from gimpenums import *
......@@ -493,10 +494,17 @@ def _interact(proc_name, start_params):
class SpinnerEntry(gtk.SpinButton):
# bounds is (upper, lower, step)
def __init__(self, default=0, bounds=(0, 100, 5)):
self.adj = gtk.Adjustment(default, bounds[0],
bounds[1], bounds[2],
bounds[2], 0)
gtk.SpinButton.__init__(self, self.adj, 1, 0)
step = bounds[2]
self.adj = gtk.Adjustment(default, bounds[0], bounds[1],
step, 10 * step, 0)
step = bounds[2]
if math.fabs(step) >= 1.0 or step == 0.0:
digits = 0
else:
digits = abs(math.floor(math.log10(math.fabs(step))));
if digits > 20:
digits = 20
gtk.SpinButton.__init__(self, self.adj, step, int(digits))
def get_value(self):
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment