gimp r27727 - in branches/gimp-2-6: . plug-ins/pygimp
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27727 - in branches/gimp-2-6: . plug-ins/pygimp
- Date: Thu, 27 Nov 2008 10:26:00 +0000 (UTC)
Author: neo
Date: Thu Nov 27 10:25:59 2008
New Revision: 27727
URL: http://svn.gnome.org/viewvc/gimp?rev=27727&view=rev
Log:
2008-11-27 Sven Neumann <sven gimp org>
Merged from trunk:
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.
Modified:
branches/gimp-2-6/ChangeLog
branches/gimp-2-6/plug-ins/pygimp/gimpfu.py
Modified: branches/gimp-2-6/plug-ins/pygimp/gimpfu.py
==============================================================================
--- branches/gimp-2-6/plug-ins/pygimp/gimpfu.py (original)
+++ branches/gimp-2-6/plug-ins/pygimp/gimpfu.py Thu Nov 27 10:25:59 2008
@@ -71,6 +71,7 @@
'''
import string as _string
+import math
import gimp
import gimpcolor
from gimpenums import *
@@ -493,10 +494,17 @@
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:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]