Michael Natterer [Sat, 17 Sep 2011 18:05:33 +0000 (20:05 +0200)]
app: abstract which modifiers are used for extending and modifying selections
which are SHIFT and MOD2 on the Mac, and SHIFT and CONTROL otherwise.
Use the new define all over the place and rename variables and
members to not say "shift" or "control".
Michael Natterer [Fri, 16 Sep 2011 14:12:23 +0000 (16:12 +0200)]
gtk: allow to specify accelerators in a platform-independent way
Introduce <Primary> in accelerator strings, which resolves to
GDK_CONTROL_MASK on X11/Win23, and to GDK_META_MASK on quartz.
Also serialize CONTROL/META as <Primary> depending on the platform.
Michael Natterer [Fri, 16 Sep 2011 13:39:23 +0000 (15:39 +0200)]
gtk: enable setting virtual modifiers in GtkCellRendererAccel
Call gdk_keymap_add_virtual_modifiers() on event->state,
so virtual modifiers get added at all.
(cherry picked from commit be1eea612cb7beacffdc0b31e7158195004f5e2d)
Michael Natterer [Sun, 25 Sep 2011 22:46:16 +0000 (00:46 +0200)]
GtkBox: make get_path_for_child() work if there are internal children
Use foreach() instead of forall() to find the child's siblings
because internal children of subclasses have no sibling relation
to the box' children. Also deal with the subclass failing to
implement get_path_for_child(). This caused an infinite widget
path invalidation loop of sorts with GimpMessageBox, which is a
vertical box with a decorative icon to the left.
Michael Natterer [Sun, 25 Sep 2011 15:43:45 +0000 (17:43 +0200)]
GtkTreeViewColumn: fix x_offset returned by cell_get_position()
Fixes #640741 - gtk_tree_view_column_get_cell_position() seems to be broken
It is supposed to return the offset within the column, but returned
the offset within the tree, changed by allocation.x of the column's
button (which I don't really unserstand and was clearly not working).
The handling of the module lists is a bit confusing here. There is
a global list that is populated with initial modules from GTK_MODULES,
and then there is a second list that is suppposed to hold the modules
loaded from the gtk-modules xsetting, which we attach to the GtkSettings
object. The blacklisting caused us to put the wrong modules into the
second list, and mess up the module refcounts, eventually double-freeing
memory when the setting changes repeatedly.
Alban Crequy [Thu, 22 Sep 2011 20:39:06 +0000 (16:39 -0400)]
gtktreeviewaccessible: do not trigger an assertion
The following assertion was triggered in model_row_inserted() because
iterate_thru_children() modifies the parameter tree_model before passing it to
traverse_cells().
Benjamin Otte [Thu, 22 Sep 2011 16:00:37 +0000 (18:00 +0200)]
fontchooser: Set a fixed size on the preview cell
This way, all rows have the same height. It has 3 advantages:
1) No actual computation is necessary to compute the size of the cell.
This speeds up the list tremendously (filling out the list goes from
25s to 3s).
2) Buggy fonts don't mess up the list anymore with their weird sizes.
Instead, they are clipped / empty space is added.
3) Buggy fonts look more buggy. So their use is hopefully discouraged.
Benjamin Otte [Wed, 21 Sep 2011 18:31:06 +0000 (20:31 +0200)]
fontchooser: Use absolute size for the preview text in the list
With absolute sizes, Pango is way better at getting the actual sizes of
the fonts to match up. It's a bit harder to compute a proper value for
this, whcih makes the code ugly, but as long as it works better...
Benjamin Otte [Wed, 21 Sep 2011 03:44:22 +0000 (05:44 +0200)]
fontchooser: Only compare font descriptions when families match
This way, we can find fonts way quicker as we only need to create font
descriptions for fonts with matching families. Most importantly, we're
rather quick in the "the font doesn't exist" case.
Benjamin Otte [Tue, 20 Sep 2011 15:06:18 +0000 (17:06 +0200)]
fontchooser: Rename populate_list() function
Name it gtk_font_chooser_widget_load_fonts(). Also, don't take any
arguments, they were the same everywhere and they're member variables of
the font chooser anyway.
Benjamin Otte [Tue, 20 Sep 2011 14:49:49 +0000 (16:49 +0200)]
fontchooser: Make changing the preview text fast
Instead of reloading the font list, we now just queue a redraw. This
works, because the preview text is added using a cell data func instead
of a custom column.
Benjamin Otte [Mon, 19 Sep 2011 23:17:29 +0000 (01:17 +0200)]
fontchooser: Rewrite size changes
They now go through gtk_font_chooser_widget_take_font_desc(). The end
goal is to make all changes go through this function, so that all
updates that are happening are easy to track.
Another change is that the code now merges the font description instead
of just using the new one. This avoids weird situations when people set
the font "Bold" for example, which has neither a size nor a font family.