Re: Tree View sidebar / List View



On 28 Jun 2002, Shahms E. King wrote:

> *snip*
> > 
> > In general (i haven't thought this through), i'd like there to be only one 
> > source for listview models in nautilus. Probably one with just one column 
> > that had the NautilusFile in it, and then you'd use 
> > gtk_tree_view_column_set_cell_data_func() to get the data from the 
> > model/nautilusfile to the cellrenderer/column.
> > 
> > You would just call nautilus_file_get_model() or something.
> > 
> > That way we would have very little duplication, and doing various sorts of 
> > lists would be pretty simple.
> > 
> > -- 
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> >  Alexander Larsson                                            Red Hat, Inc 
> 
> 
> Yes, perhaps I'm missing something, but going through fm-list-model.c it
> seems to me that creating that entire model was a little unnecessary and
> that the gtk_tree_view_column_set_cell_data_func() way was simpler and
> more reasonable.  The only reason I can think for creating your own
> model would be for the tree view, where you really want to know if the
> NautilusFile has children without having to add them to the model (you
> also get such useful features as the "Loading..." text).

Yeah. Care would need to be taken to ensure that the model correctly 
lazily instantiates the filesystem tree, so we don't load NautilusFiles 
for every file in the filesystem though.
 
> Additionally, the only reasonable differences (IMHO) between the Tree
> View sidebar and the List View are that 1)the tree view has only one
> column and 2) the tree view is a tree, rather than a list.
> 
> Both of these could be relatively easily accomplished using both one
> model and one view, but in the List View case, just disable the
> expanders and in the sidebar case, just disable the all but the one
> column (and set some reasonable default zoom, possibly turn the rules
> hinting off).  The point is all of this could be done based on the
> requested IID (I think, don't know very much aboot Bonobo at the moment)
> and save a LOT of code duplication.

I'm not sure about this. The tree in the sidebar is supposed to be a 
"lightweight" version that don't have all the editing capabilities of the 
main view, more a viewer/browser than an editor. But if the model just 
works most of the hard work for trees/lists should be done anyway, so it 
won't be bad.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a maverick chivalrous vagrant on his last day in the job. She's a 
cold-hearted hypochondriac lawyer who believes she is the reincarnation of an 
ancient Egyptian queen. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]