The setter for the "font" property returned a boolean that indicated
whether the given font has been found. Instead, fall back to the default
font name when the given font doesn't exist.
GtkFontButton already has a property named "font-name" which may
conflict / be an ABI break when moving GtkFontButton to implement
GtkFontChooser. Also, this is more in line with how other parts in
gtk (e.g. GtkCellRendererText) call a font string property.
Make the GtkFontChooser API similar to the Gtk{File,Recent,App}Chooser
APIs by introducing GtkFontChooser as an interface, that has a default
implementation in GtkFontChooserWidget.
https://bugzilla.gnome.org/show_bug.cgi?id=657627
We simply use the Tracker DBus api here, caching and direct
access that come with libtracker-sparql are probably not needed
here. Based on a patch by Martyn Russell.
https://bugzilla.gnome.org/show_bug.cgi?id=658272
gtk_tree_model_filter_free_level() should always release ref on parent
unless the parent has been removed in the child model. The unit tests
added in the previous commit test this.
If the level to be reordered did not contain an elt with offset == 0
(for example if that node was hidden), the first reference was not
correctly transferred.
A unit test for this has been added in a previous commit.
This is due to the special handling for filter functions that depend
on child level state. If the parent level of a level is the root level,
the level cannot be removed from the cache. Any change in this level
can cause its parent in the root level to become visible again.
The most important change is that the function now properly releases
any external ref count and propagates these changes to the child model.
If a node is removed due to a filtering action, we now properly release
all external reference counts for its hierarchy of child nodes.
Apart from that, the function has been restructured to remove code
duplication.
Finally, there is still some doubt whether there are more calls to
gtk_tree_model_filter_free_level() which need unref_external set to TRUE.
Should be helpful when debugging this thing. Perhaps this needs to
be properly integrated in G_DEBUG/GTK_DEBUG, but currently I do not see
the need to.
There was still a discrepancy between the comments and the code about when
exactly a level was to be removed. The rule is now set on that for a level
to be removed its zero_ref_count as well as the zero_ref_count of its
parent has to be zero.
The code sets old_adj_ptr to the location containing the old weak ref,
but then wants to remove a weak ref from &view->old_hadj, causing warnings
when disposing the widget.
This will take you to the file's folder and select the file in question.
The menu item is only available in Recently-used and Search modes, so that
you can go from files in them to the 'normal' browsing mode.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
row-spacing behaved like column-spacing should have and vice versa.
Also update tests that erroneously checked this behavior.
Thanks to Joanmarie Diggs for finding this.
For god-knows-what reason, at-spi is trying various formats
of strings when registering listeners, triggering g_warnings()
from gailutil code. Stop doing that.
Also, don't leak temporary string arrays that are a side-effect
of passing parameters around as formatted strings.
https://bugzilla.gnome.org/show_bug.cgi?id=658168
Make page titles left-aligned again. Changing from misc alignment
to GtkWidget::halign here was a mistake. We can't do that for labels
in a size group, as long as labels still pay attention to misc
alignment.
https://bugzilla.gnome.org/show_bug.cgi?id=658008
The gtk_render_line() code has a FIXME (coming from the 2.x migration I
suppose) about using xthickness, and it actually hardcodes two lines of
different color instead of drawing a single one.
Since we don't support xthickness anymore, make gtk_render_line() do
what it says, i.e. just draw an 1px line colored with the current
color.
https://bugzilla.gnome.org/show_bug.cgi?id=657963
Otherwise the default values are only used if no vfunc is set,
making that default unavailable to vfunc implementations as a fallback,
and unavailable to language bindings (such as gtkmm) that always
have a vfunc implementation, even if that often only tries to call
the base vfunc implemntation.
This was making gtkmm's ToolPalette's (and probably ToolBar's)
items look like buttons instead of being flat.
https://bugzilla.gnome.org/show_bug.cgi?id=656223
This fixes a regression introduced in commit
b1a1685a33eca16979e63d79915395af0b36. gdk_visual_get_*_pixel_details()
should not be called with a NULL visual.
https://bugzilla.gnome.org/show_bug.cgi?id=649588
When using an editable toolbar in evince, we can end up
in gtk_toolbar_get_visible() position with item being the
highlight_tool_item, but not one of the regular children.
So, handle that.
There's no real asynchronicity going on, anyway, so let's do both within
a single iteration of the idle handler.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
The mtime from GtkRecentManager may not the same as the file's actual
mtime, so the final result could appear unsorted to the user. Instead,
we will let the view do the sorting.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
It's possible the GtkLabel receives drag'n'drop related signals
if it was setup to receive them by a container or other external
code, just avoid dereferencing priv->select_info in this case.
Also create a separate section for values to associate the values with.
Finally, use this section information when delayed-parsing a widget
style property.
This struct keeps track of an area of text in a CSS file and uses it
when specifying information. Also, the cssprovider keeps track of
sections when parsing a file.
gtk_menu_shell_insert() is a virtual function that was being directly
invoked from the class vtable.
Turn it into a proper signal and emit it in the usual way.
https://bugzilla.gnome.org/show_bug.cgi?id=656565
This makes the behavior identical to other widgets which
handle button presses, and it avoids problems when placing
switches into a windows main toolbar.
https://bugzilla.gnome.org/show_bug.cgi?id=656986
We have meaningful labels for the Ok buttons in all other choosers,
so just use the same string we use in the app chooser and the
font chooser.
Also move the mnemonic from s to a in 'Saturation', to avoid a
mnemonic conflict. String change !
https://bugzilla.gnome.org/show_bug.cgi?id=657006
This is done in the same way as GArray was replaced with GSequence in
GtkTreeModelFilter, in a patch done by Xavier Claessens.
All sorting code has been reworked to use the GSequence sorting
and insert sort functions, instead of doing a lot on our own.
Significantly improves performance when e.g. removing (filtering) a lot
of rows from the filter model. Fixes bug 616871.
This commit includes changes by Kristian Rietveld to make the patch apply
on top of the treemodel-fix branch and pass all newly written unit tests.
This allows for more thorough testing of "has child" filter functions.
We also test a has child filter function with a sort model as
child model, to verify that we receive enough signals to function
properly.
The filter model is now more strict about the signals which are emitted,
so the base tests have been expanded to test with both the root level
nodes collapsed and expanded.
- Before we kept a reference on all nodes in non-root levels. This has
been changed, now we keep a reference on the first node of each level.
If, due to changes in the model, another node becomes the first node in
the level, the reference is transferred to this new first node.
- All non-root levels keep a reference on their parent.
- By making use of the external ref count, the filter model now emits less
unnecessary signals.
- GtkTreeModelFilter does support filter functions which decide visibility
of a given node based on the number of or visibility of children.
To accomplish this, a child level of a node is cached when its
parent has an external ref count > 0, because changes to the node might
affect this parent.
- An optimization for not building the root level in case the inserted
node is not visible in gtk_tree_model_filter_row_inserted() has been
removed. In this case, we still need to build the root level and
possibly a child level to monitor for signals which might make
this row visible.
In gtk_tree_model_filter_check_ancestors(), also handle the case when
a node is already in the cache, but invisible, in the root level.
With the upcoming changes to GtkTreeModelFilter's ref counting this
case can occur.
We need to distinguish between the ref count objects have on us versus
the ref count we have on our child model. To keep track of the former,
we introduce the "external ref count" in this commit. The zero_ref_count
needs to be determined from the external ref count, because objects that
have a ref count on us have say in which levels must be cached and which
can be released.
Before the caching in GtkTreeModelFilter was essentially broken and
levels were never released. This was caused because the zero_ref_count
was connected to the ref count the filter model had on its child model.
Now that this depends on the external ref count, this is working fine and
as to be expected.
The row-deleted signal should be emitted after the internal data
structures have been updated. In gtk_tree_model_filter_remove_elt_from_level
and gtk_tree_model_filter_virtual_root_deleted the signal was still being
emitted before the updates were carried out.
Now that we call unref_node in free_level, we have to take care that
free_level may only unref (parent) nodes when these still exist in the
child model. After row-deleted has been received for a node, its
children may no longer unref this node.
Referencing a parent node for each referenced node is overdone. Instead,
we now reference the parent from build_level and unreference in free_level.
Each level keeps a single reference on its immediate parent. This both
alleviates the performence problems and should perfectly serve the purpose.
The bulk of the fix is to walk the chain of ancestors, starting at the
root level, and check if the visibility of any of the ancestors has
changed. If yes, the necessary signals are emitted so that this change
is propagated properly. This walk is done after a node has been
inserted, changed or deleted, see function
gtk_tree_model_filter_check_ancestors().
Bug reported, and initial debugging and analysis, by Xavier Claessens.
Suggested by Xavier Claessens / bug 621076.
(Additional obseration: this should speed up the filter model's
handling of row-inserted as a binary search is now used instead
of a linear scan).
gtk/gtkborderimage.c, gtk/gtklabel.c and gtk/gtkstyleproperty.c call
round() and/or rint(), which was only available in C99 compilers.
This adds the inclusion of the fallback implementation (gtk/fallback-c89.c)
to define these functions if they are not initially made available by the
compiler.
Also remove the rint() implementation in gtk/gtklabel.c as it is now in
the fallback implmentation.
Add an implementation for rint() and round() for compilers that do not
define one or both of them. Note that this file should be included
after config.h was included.