Ah, I see. Thanks for clearing that up!<br><br><div class="gmail_quote">On Fri, Apr 3, 2009 at 9:53 PM, Eben Eliason <span dir="ltr">&lt;<a href="mailto:eben@laptop.org">eben@laptop.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/4/2 Vamsi Krishna Davuluri &lt;<a href="mailto:vamsi.davuluri@gmail.com">vamsi.davuluri@gmail.com</a>&gt;:<br>
<div class="im">&gt; Hello,<br>
&gt;<br>
&gt; So I was wondering, after right clicking on a journal item, the palette<br>
&gt; again shows the file name. Why is that? as on most of the standard operating<br>
&gt; systems, when ever we right click on an item, we are given options such as<br>
&gt; open, open with, print, copy etc. Never the file name.<br>
&gt;<br>
&gt; Couldn&#39;t the alternate be to highlight the clicked item instead.<br>
<br>
</div>This is because Sugar has &quot;palettes&quot;, which can serve the purpose of<br>
the normal contextual menu, but are also much more extensible. It&#39;s<br>
possible to embed images, descriptions, and other controls into these<br>
palettes, in addition to the usual menu of actions.<br>
<br>
It&#39;s true that in the list view of the Journal, the name of the entry<br>
is redundant, but that&#39;s often not the case (consider the Neighborhood<br>
view, or Home, etc.). The idea behind the palette is to a) provide<br>
more info about the object it relates to (in this case, entry name,<br>
and activity type), as well as provide the list of actions/options for<br>
that object. We keep the redundancy here for consistency across the<br>
UI, and also because the palette itself can cover the name of the<br>
entry in the list.<br>
<font color="#888888"><br>
Eben<br>
</font><div><div></div><div class="h5"><br>
&gt;<br>
&gt; Also a fix to bug #610 would be<br>
&gt;<br>
&gt;     def __init__(self, label=None, accel_path=None,<br>
&gt; menu_after_content=False,<br>
&gt;                  text_maxlen=0, **kwargs):<br>
&gt;<br>
&gt;         screen = gtk.gdk.Screen()<br>
&gt;     self.wwidth = screen.get_width()<br>
&gt;<br>
&gt;         #window = gtk.Window()<br>
&gt;         #self.wwidth, self.wheight = window.get_size()<br>
&gt;<br>
&gt;         self.max_pixels = int((1.0/4)*(self.wwidth))<br>
&gt;<br>
&gt; --------------------------------<br>
&gt;         if text_maxlen &gt;= 0:<br>
&gt;             self._label.set_max_width_chars(text_maxlen)<br>
&gt;             self._label.set_ellipsize(pango.ELLIPSIZE_MIDDLE)<br>
&gt;<br>
&gt;         labels_box.pack_start(self._label, expand=True)<br>
&gt;<br>
&gt;         self._secondary_label = gtk.Label()<br>
&gt;         self._secondary_label.set_alignment(0, 0.5)<br>
&gt;<br>
&gt;         if text_maxlen &gt;= 0:<br>
&gt;             self._secondary_label.set_max_width_chars(text_maxlen)<br>
&gt;             self._secondary_label.set_ellipsize(pango.ELLIPSIZE_END)<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; -------------------------------------------------<br>
&gt;<br>
&gt;  def do_size_request(self, requisition):<br>
&gt;         gtk.Window.do_size_request(self, requisition)<br>
&gt;<br>
&gt;         # gtk.AccelLabel request doesn&#39;t include the accelerator.<br>
&gt;         #label_width = self._label_alignment.size_request()[0] + \<br>
&gt;                       #self._label.get_accel_width() + \<br>
&gt;                       #2 * self.get_border_width()<br>
&gt;         label_width= self.max_pixels<br>
&gt;<br>
&gt;         requisition.width = max(requisition.width,<br>
&gt;                                 style.GRID_CELL_SIZE * 2,<br>
&gt;                                 label_width,<br>
&gt;                                 self._full_request[0])<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; What this does is, It draws the screen proportional to the max_pixels<br>
&gt; specified(the ratio can be fine tuned by the design team), and ellipsizes<br>
&gt; which ever exceeds that limit.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Thank you.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div><div><div></div><div class="h5">&gt; _______________________________________________<br>
&gt; Sugar-devel mailing list<br>
&gt; <a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
&gt; <a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>