← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2402: (detail: make SeqSerializable number nicer)

 

------------------------------------------------------------
revno: 2402
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Sun 2010-08-15 22:54:55 +0200
message:
  (detail: make SeqSerializable number nicer)
modified:
  gui/qt4/SerializableEditor.py


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'gui/qt4/SerializableEditor.py'
--- gui/qt4/SerializableEditor.py	2010-08-15 17:53:02 +0000
+++ gui/qt4/SerializableEditor.py	2010-08-15 20:54:55 +0000
@@ -389,8 +389,8 @@
 def makeSerializableLabel(ser,href=False,addr=True,boldHref=True,num=-1,count=-1):
 	ret=u''
 	if num>=0:
-		if count<=0: ret+=u'%d / %d.'%(num,count)
-		else ret+=u'%d. '%num
+		if count>=0: ret+=u'%d/%d. '%(num,count)
+		else: ret+=u'%d. '%num
 	if href: ret+=(u' <b>' if boldHref else u' ')+serializableHref(ser)+(u'</b> ' if boldHref else u' ')
 	else: ret+=ser.__class__.__name__+' '
 	if hasattr(ser,'label') and ser.label: ret+=u' “'+unicode(ser.label)+u'”'
@@ -418,6 +418,7 @@
 		for w in buttons[0:2]+[self.combo,]+buttons[2:4]: topLineLayout.addWidget(w)
 		self.layout.addWidget(topLineFrame) # nested layout
 		self.scroll=QScrollArea(self); self.scroll.setWidgetResizable(True)
+		self.scroll.sizeHint=lambda: QSize(0,0)
 		self.layout.addWidget(self.scroll)
 		self.seqEdit=None # currently edited serializable
 		self.setLayout(self.layout)