[Sugar-devel] [PATCH] Set max_column value according to screen width. Ticket #2280

Anish Mangal anishmangal2002 at gmail.com
Sun Sep 5 14:11:48 EDT 2010

I guess the patch can be found in the /rpms directory of the Dextrose
repo. However, on discussing with tomeu, the fix is not how its meant
to be for the problem. I then modded the patch to have a set number of
columns (4, IIRC) and wrap the text under the icons. (This modded
version won't be in the Dextrose repo, but somewhere on the m-l)

A bug (probably in gtk+) doesn't allow the wrapped text to be center
aligned properly under the icon. I tried to debug the problem and
narrowed it down to a potential issue with gtk.misc/gtk.label.
However, I ran out of time then and didn't open the gtk+ source
afterwards (I guess you could say it is in my TODO list ;-) ). Here[1]
is a related discussion on [pygtk-devel].

Btw, folks on #pygtk suggested that gtk.iconview[2] might be the best
way to display the CP-icons. It might need more code changes though.

[1] http://www.daa.com.au/pipermail/pygtk/2010-July/018855.html
[2] http://www.pygtk.org/docs/pygtk/class-gtkiconview.html

On Sun, Sep 5, 2010 at 10:56 PM, Gary Martin <garycmartin at googlemail.com> wrote:
> Hi Neeraj,
> Sorry to spot this so late.
> On 5 Sep 2010, at 15:08, Neeraj Gupta wrote:
>> This patch set the value of maximum number of column in control panel display
>> according to the screen resolution.
> I'm pretty sure there is a patch already, fairly reviewed and tested in the dextrose release for Paraguay that has not yet been merged in Sugar mainline :-( It was listed in Bernie's email of F11-0.88 unmerged patches called "sugar/dynamically-set-number-of-control-panel-columns.patch" I think Anish Mangal landed a slightly improved version in their rep. Sorry, have been searching the bugs.sugarlabs.org but can not find an official ticket. Anish/Bernie can you point to the patch/commit so we can get an official trac filed for mainline review (or whatever the plat du jour is for the review process)?
> Regards,
> --Gary
>> ---
>> src/jarabe/controlpanel/gui.py |    2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>> diff --git a/src/jarabe/controlpanel/gui.py b/src/jarabe/controlpanel/gui.py
>> index 51d9820..e9368d2 100644
>> --- a/src/jarabe/controlpanel/gui.py
>> +++ b/src/jarabe/controlpanel/gui.py
>> @@ -33,7 +33,7 @@ from jarabe.controlpanel.toolbar import SectionToolbar
>> from jarabe import config
>> _logger = logging.getLogger('ControlPanel')
>> -_MAX_COLUMNS = 5
>> +_MAX_COLUMNS = gtk.gdk.screen_width()/(3*style.GRID_CELL_SIZE)
>> class ControlPanel(gtk.Window):
>>     __gtype_name__ = 'SugarControlPanel'
>> --
>> _______________________________________________
>> Sugar-devel mailing list
>> Sugar-devel at lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel


More information about the Sugar-devel mailing list