Commits

Erik Grinaker committed 22f6831

fixed some rendering issues with the new password entry

  • Participants
  • Parent commits ba434a1

Comments (0)

Files changed (2)

 
 ---------------[ 2006-01-26 : 0.4.6 ]---------------
 
+2006-01-26  Erik Grinaker <erikg@codepoet.no>
+
+	* fixed some rendering issues with the new password entry
+
 2006-01-25  Erik Grinaker <erikg@codepoet.no>
 
 	* ~ in filenames will now be expanded to homedir

File src/lib/ui.py

 
 		# set up ui
 		self.hbox = HBox()
-		self.hbox.set_size_request(-1, 16)
 		self.add(self.hbox)
 
 		self.entry = Entry(text)
 		self.hbox.pack_start(self.entry)
 
 		self.iconebox	= EventBox()
-		self.iconebox.set_border_width(2)
 		self.iconebox.set_visible_window(False)
 
+		self.iconalign	= Alignment(1.0, 0.5, 0, 0)
+		self.iconalign.set_padding(1, 1, 0, 2)
+		self.iconalign.add(self.iconebox)
+
 		# connect signals
 		self.connect("expose-event", self.__cb_expose)
 		self.connect("size-allocate", self.__cb_size_allocate)
 	def __cb_expose(self, widget, data):
 		"Draws the widget borders on expose"
 
+		allocation	= self.get_allocation()
 		style		= self.entry.get_style()
-		allocation	= self.get_allocation()
 		intfocus	= self.entry.style_get_property("interior-focus")
 		focuswidth	= self.entry.style_get_property("focus-line-width")
 
 
 		requisition.width	= self.border_width * 2
 		requisition.height	= self.border_width * 2
-
-		self.ensure_style()
 		xborder, yborder	= self.__entry_get_borders()
 
-		if self.child.get_property("visible") == True:
-			child_width, child_height = self.child.size_request()
-			requisition.width	+= child_width
-			requisition.height	+= child_height
+		entrywidth, entryheight	= self.entry.size_request()
+		requisition.height	+= entryheight >= 18 and entryheight or 18
 
 		requisition.width	+= 2 * xborder
 		requisition.height	+= 2 * yborder
 		if self.icon != None and self.icon.get_stock()[0] == stock:
 			return
 
-		if self.iconebox in self.hbox.get_children():
-			self.hbox.remove(self.iconebox)
+		if self.iconalign in self.hbox.get_children():
+			self.hbox.remove(self.iconalign)
 			self.iconebox.remove(self.icon)
 			self.icon.destroy()
 			self.icon = None
 
 		self.icon = Image(stock, ICON_SIZE_ENTRY)
 		self.iconebox.add(self.icon)
-		self.hbox.pack_start(self.iconebox, False, False)
+		self.hbox.pack_start(self.iconalign, False, False)
 		self.hbox.show_all()