Manually pulling back a GtkTreeViewColumn fix from treeview-refactor-staging
This fix has evolved in the staging branch since all column members are
on a private structure, but since it causes warnings when closing the
windows of the testcellarea test (because the combo-boxes use a treeviewcolumn)
I thought it nice for now to just manually include the fix.
The fix is just proper bookkeeping of delegate objects at dispose() time.
Changed tests/testcellarea.c (and scaffolding) to only reorient the GtkCellArea
It's a better test case if the scaffolding only displays the rows from top
to bottom and doesnt line up the cells from left to right (because it shows
that height-for-width still works with vertically oriented areas).
Added some rules to GtkCellAreaBox for rendering the last cell.
- When we reach a cell that is out of the render area, break out
of the loop (for columns user resized too small)
- CLAMP the size of the last renderer to fit into the area
(so that renderers get a chance to ellipsize when rendered
with a space less than allocation, same reason as above).
- Hand out remaining space in the render area to the last cell,
this is for shallow rows in the expand column which may recieve
more than the allocated width.
Added special clause to GtkCellAreaBox focus navigation.
If the area has no activatable cells and has focus when
focus should be cycled, immediately focus out of the area
(because focus in that case is given to the entire area).
Emmanuele Bassi [Tue, 30 Nov 2010 21:54:48 +0000 (21:54 +0000)]
switch: Fix the attribution line
Thomas Wood pointed out that the original MxGtkLightSwitch widget upon
which I based the behaviour of GtkSwitch was not written by him; the
original authors are:
Emmanuele Bassi [Mon, 29 Nov 2010 15:43:43 +0000 (15:43 +0000)]
a11y: Use ATK macros and clean up/2 - GtkSpinner
ATK provides macros to the same effect as G_DEFINE_TYPE; using these
macros has the advantage of removing tons of duplicated code and
reducing the maintainership burden.
The widgets with inline accessibility implementation should switch to
these macros, and clean up the code.
Emmanuele Bassi [Mon, 29 Nov 2010 15:40:29 +0000 (15:40 +0000)]
a11y: Use ATK macros and clean up/1 - GtkAssistant
ATK provides macros to the same effect as G_DEFINE_TYPE; using these
macros has the advantage of removing tons of duplicated code and
reducing the maintainership burden.
The widgets with inline accessibility implementation should switch to
these macros, and clean up the code.
This needs more work, currently we do dupe targets when copying
target entries in various places, and consequently free them
later. To do this correctly, the strings need to be interned
or something like that.
Cosimo Cecchi [Mon, 29 Nov 2010 17:10:06 +0000 (18:10 +0100)]
app-chooser-online: rework of the online module
- the _get_default() method is now async
- the PackageKit module will return NULL in case PackageKit is not
available in the session bus
- the dummy module doesn't exist anymore
- the dialog won't display the online button in case there's no module
available
Cosimo Cecchi [Mon, 29 Nov 2010 15:04:59 +0000 (16:04 +0100)]
app-chooser-button: change the API approach for custom items
Introduce a 'custom-item-activated' on the widget, which behaves
similairly to GtkEntryCompletion::action-activated, i.e. is emitted when
a custom item is chosen from the dropdown list.
Clients can use the name provided when adding the item as a detail for
the signal, to get notified when that specific item is activated, or use
the signal without details to get notifications for all custom items.
Emmanuele Bassi [Fri, 26 Nov 2010 13:24:04 +0000 (13:24 +0000)]
Add GtkSwitch, a "light-switch" like widget
The GtkSwitch widget is a simple UI control that has two states: on and
off. Toggling between the states is possible by clicking the widget or
by dragging the handle.
Changed cell area/renderer "can_focus" semantics to "is_activatable" across the board.
This is because focus in treeviews can be given to cells that cannot do anything
with activation (for better keynav), so we dissociate the concept of cell
activation and focusing.
Since GtkCellArea delegate does all the work, cell layout widgets
who use a GtkCellArea internally only have to implement the _get_area()
method, this just reduces code to forward the calls over the the internal
cell area.
Turns out theres not much reason to do this in a separate api,
now we just sum up the sizes of aligned cell groups in GtkCellAreaContextBox
when pushing the group size.
Emmanuele Bassi [Sun, 28 Nov 2010 18:49:47 +0000 (18:49 +0000)]
rgba: Invert the arguments and improve bindability
Since parse() is a method of the Gdk.RGBA class, the GdkRGBA pointer
should be the first argument, and the string the second one, to allow a
more natural binding.
First go at migrating GtkTreeView(Column) to GtkCellArea
This is still very much a work in progress, but it renders and more or
less works. I will be fixing up the details in the very near future.
Important: this commit breaks ABI as it modifies the GtkTreeViewColumn
structure in gtktreeviewcolumn.h. This is a sealed structure that needs
to be moved to an internal header file, most likely gtktreeprivate.h.
Slight tweak for GtkTreeView, also non-editable cells must be able to receive
focus to get all keyboard navigation right. This will be further tweaked
to get focus siblings to work like focus cells did in GtkTreeView before
refactoring.
The allocated size, or (horizontally speaking) for-width size, can be
smaller than the sum of all minimum widths. For example when the user
is resizing tree view columns manually.
Finally really support rendering of cells in an unallocated context.
What this means is basically that a vertically oriented GtkCellAreaBox
will render cells properly even if the height is not constant for every
for of data in the said GtkCellAreaContext (i.e. the height was not allocated
by gtk_cell_area_context_allocate).
This is done completely on the fly and so is much more heavy duty
at render time (considerably slower but not visibly noticable in
lightweight views like GtkTreeMenu). Note that cell alignments
are not possible in an unallocated orientation, each row of data
individually receives only enough space to render the independant
row and no space is reserved for alignments if the size is not
a constant size across rows in the same context.
Added gtk_cell_renderer_get_aligned_area() and class vfunc.
Since a cell renderer might use more space than the natural
size when recieving expand space it's impossible to know how
much space is actually used to render content.
Adding this virtual method to allow text renderers to implement
it, the base default method uses height-for-width apis and aligns
the cell assuming the renderer uses a fixed size.
This commit removes the similar code from gtkcellarea and
subclasses.