Added ellipsis support on menu items

This commit is contained in:
noisymime 2007-09-01 23:28:47 +00:00
parent 245a4fd819
commit f344cd4f33
4 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import clutter
import pygtk
import gtk
import pango
import time
from ReflectionTexture import Texture_Reflection
@ -285,7 +286,10 @@ class ListItem (clutter.Label):
self.currentOpacity = 255
self.menu = menu
self.data = itemLabel #By default the items data is simply its label
#The width is the length of the selector bar minus its offset
width = menu.getMenuMgr().get_selector_bar().get_width() + menu.getMenuMgr().get_selector_bar().get_x_offset()
self.set_width(width)
self.set_ellipsize(pango.ELLIPSIZE_END)
#Text is actually scaled down in 'regular' position so that it doesn't get jaggies when zoomed in
self.set_scale(self.zoomLevel, self.zoomLevel)
self.currentZoom = 0

BIN
Menu.pyc

Binary file not shown.

View File

@ -148,13 +148,14 @@ class MenuMgr:
class MenuSelector(clutter.Texture):
x_offset = -50
width = 400
def __init__ (self, menuMgr):
clutter.Texture.__init__ (self)
self.menuMgr = menuMgr
pixbuf = gtk.gdk.pixbuf_new_from_file("ui/active_bar.png")
self.set_pixbuf(pixbuf)
self.set_width(400)
self.set_width(self.width)
pixbuf = gtk.gdk.pixbuf_new_from_file("ui/spinner1.gif")
self.spinner = clutter.Texture()
@ -231,4 +232,6 @@ class MenuSelector(clutter.Texture):
def get_x_offset(self):
return self.x_offset
def get_width(self):
return self.width

Binary file not shown.