Commit Graph

15254 Commits

Author SHA1 Message Date
Michael Natterer
87cc0dc79f gtk: use the new modifier API instead of GTK_DEFAULT_ACCEL_MOD_MASK
in gtkimcontextsimple and gtktreeview, which are the easy places,
but also true bugfixes, because on OSX we can't use the virtual META
here, we needs MOD2 as delivered in key events.
2011-10-07 09:33:07 +02:00
Tristan Van Berkom
2677a7d5b9 GtkComboBox: Add the format-entry-text signal.
This provides more control over how the selected item is shown in
the entry.
Bug #631167
2011-10-06 11:14:38 +02:00
Kjell Ahlstedt
f920ded541 GtkTreeViewColumn: dispose: Remove from the treeview
This handles the case (with gtkmm) that the GtkTreeViewColumn is
destroyed before the GtkTreeView is destroyed.
Bug #659672
2011-10-06 11:02:02 +02:00
John Ralls
37f71d71cd Bug 628936: Minimal change to pass introspection.
gobject_introspection's G-ir-scanner doesn't like the -xobjective-c
option needed to compile ObjectiveC features in quartz implementations
of certain gtk functions. This rearranges the compiler flag environment
variables in Makefile so that G-ir-scanner doesn't see them.
2011-10-04 16:45:54 -07:00
Tristan Van Berkom
00d79fdb61 Fixed gtk_cell_area_stop_editing() to properly notify when editing is not canceled
This fixes bug 653289, in gtk+-2 gtk_tree_view_stop_editing() was previously
responsible for notifying with gtk_cell_editable_editing_done(), this detail
was missed when porting the cell renderer management to GtkCellArea.
2011-10-04 14:15:21 -04:00
Cosimo Cecchi
1f2cfb5619 all: add an 'only-child' pseudo-class selector
Add an :only-child pseudo-class selector, which selects single children
of a parent container.

https://bugzilla.gnome.org/show_bug.cgi?id=660833
2011-10-04 11:47:47 -04:00
Cosimo Cecchi
3a6996ea83 appchooser: make the "Find applications online" follow search state
Set the button as insensitive while searching, so that it can't be
accidentally clicked twice.

https://bugzilla.gnome.org/show_bug.cgi?id=651818
2011-10-04 11:34:10 -04:00
Cosimo Cecchi
569b5ffd5b appchooser: add a GCancellable to the search operation
So that we can cancel it when the dialog is destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=651818
2011-10-04 11:34:10 -04:00
Kristian Rietveld
0e3a4b73ca Fix commit 61d6c73f18
Where the commit suggested "somebody should review it [the test]",
it would have been useful to test this particular commit instead...
2011-10-03 22:59:40 +02:00
Kristian Rietveld
bbc1e883a8 Bug 659022 - gtk_tree_model_filter_clear_cache_helper: assertion failed
This bug is resolved by fixing two things in
gtk_tree_model_filter_row_deleted():

  (1) It is possible for an elt to have elt->visible_siter == NULL, when
  it is deleted.  Only call g_sequence_remove() if this pointer is
  non-NULL.

  (2) For the case len (level->seq) > 1, free the elt->children level
  if non-NULL.  Failing to do this means the level will stick around.
  If this child level was not referenced, it will still have a zero
  ref count on its parent which cannot be removed!

For both bugs unit tests have been added in the preceding commit.
2011-10-03 22:59:40 +02:00
Kristian Rietveld
e8323e2abc Add two more unit tests for bug 659022
Both pointing out problems in gtk_tree_model_filter_row_deleted().
2011-10-03 22:59:40 +02:00
Kristian Rietveld
f646ed6f76 Fix first part of bug 659022
Push creation of path into if clause, the path cannot be created anyway
(and would be meaningless otherwise) if the parent is not visible.
2011-10-03 22:59:40 +02:00
Kristian Rietveld
6fdf882eb4 Add unit test for part 1 of bug 659022
This tests a case where gtk_tree_model_filter_row_changed() is run
for a node with visible_siter != NULL, however its parent has
visible_iter == NULL. For this case, no valid paths can be generated
as the node cannot be accessed (because the parent is invisible).
2011-10-03 22:59:40 +02:00
Cosimo Cecchi
e1f79e8275 box: add some missing includes 2011-10-03 16:54:09 -04:00
Benjamin Otte
78ddecab0c iconcache: Fix gcc warning 2011-10-03 18:29:53 +02:00
Benjamin Otte
e97b05acbd filesystemmodel: Add a missing check
Paths with depth > 1 should return FALSE instead of pretending the depth
is 1.
2011-10-03 18:29:21 +02:00
Chun-wei Fan
eb8c2dfae2 Bug 660730: Use GStatBuf for portability
Thanks to Kean Johnston for pointing this out.

There are a few places in GTK that use "struct stat",
and then g_stat(), rather than using GStatBuf.This breaks things on
Windows. Since the size of struct stat can vary depending on other
flags specified, this has the potential to cause overwrites and is
trivial to fix.

Based on patch submitted by Kean Johnston
2011-10-03 23:25:33 +08:00
Antoine Jacoutot
f44b8465f1 __SIZEOF_INT__ and __SIZEOF_POINTER__ may not be defined.
Protect __SIZEOF_INT__ and __SIZEOF_POINTER__ with an ifdef to prevent
warnings about them not being defined when including gtktextattributes.h.

https://bugzilla.gnome.org/show_bug.cgi?id=660619
2011-10-03 09:11:50 +02:00
Javier Jardón
8985ce3b72 gtkbox: Move private functions to private header 2011-10-02 21:30:42 +01:00
Benjamin Otte
fcd4d8a208 uimanager: Deprecate add-tearoffs property
Don't use it. Please.
2011-10-01 05:59:04 +02:00
Benjamin Otte
b13544171a menu: Deprecate GtkTearoffMenuItem 2011-10-01 05:59:04 +02:00
Rui Matos
2720574ab9 gtkwindow: Clean up gtk_window_map()
Remove unneeded variable and delete trailing whitespace.
2011-10-01 01:28:30 +01:00
Benjamin Otte
85b79fbd26 handlebox: Deprecate 2011-09-30 23:23:36 +02:00
Benjamin Otte
a36b05fed7 a11y: Don't include gtkx when not needed 2011-09-30 23:23:36 +02:00
Benjamin Otte
4a43034761 a11y: Remove useless check 2011-09-30 23:23:36 +02:00
Benjamin Otte
61d6c73f18 tests: Fix a bunch of set-but-unused warnings in the filtermodel test
The whole test doesn't seem to unref any memoery, somebody should review
it.
2011-09-30 00:26:22 +02:00
Benjamin Otte
58d9c7e53e docs: Fix typo in treeview docs 2011-09-30 00:26:22 +02:00
Javier Jardón
28bffa4f27 gtktable: Fix gtk-doc notation 2011-09-29 12:42:38 +01:00
Javier Jardón
b0a7db76fb Replace some references to the GtkTable, use GtkGrid instead 2011-09-29 12:38:49 +01:00
Cosimo Cecchi
bdfa05bc81 notebook: don't forget to prepare the tab style context before drawing
The previous commit a9affcdd3f
accidentally removed the call to notebook_tab_prepare_style_context()
2011-09-29 01:49:55 -04:00
Benjamin Otte
a9affcdd3f notebook: Remove unused variables 2011-09-29 04:24:02 +02:00
Benjamin Otte
11e17601b3 combobox: Remove unused define 2011-09-29 04:24:02 +02:00
Cosimo Cecchi
fb488d49b2 GtkTreeViewColumn: initialize a variable
Shut up valgrind complaining about uninitialized values

==5330== Conditional jump or move depends on uninitialised value(s)
==5330==    at 0x624FF4C: gdk_window_move_resize_internal
(gdkwindow.c:6037)
==5330==    by 0x62502C3: gdk_window_move_resize (gdkwindow.c:6274)
==5330==    by 0x5E4FBB5: _gtk_tree_view_column_allocate
(gtktreeviewcolumn.c:2169)
==5330==    by 0x5E3846B: gtk_tree_view_size_allocate_columns
(gtktreeview.c:2631)
==5330==    by 0x5E43D76: gtk_tree_view_size_allocate
(gtktreeview.c:2686)
==5330==    by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330==    by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330==    by 0x7F20256: g_signal_emit_valist (gsignal.c:3003)
==5330==    by 0x7F20421: g_signal_emit (gsignal.c:3060)
==5330==    by 0x5E6DFBE: gtk_widget_size_allocate (gtkwidget.c:4886)
==5330==    by 0x5D94ADD: gtk_scrolled_window_allocate_child
(gtkscrolledwindow.c:1506)
==5330==    by 0x5D95299: gtk_scrolled_window_size_allocate
(gtkscrolledwindow.c:1704)
==5330==    by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330==    by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330==    by 0x7F20256: g_signal_emit_valist (gsignal.c:3003)
==5330==    by 0x7F20421: g_signal_emit (gsignal.c:3060)
==5330==    by 0x5E6DFBE: gtk_widget_size_allocate (gtkwidget.c:4886)
==5330==    by 0x5C62708: gtk_box_size_allocate (gtkbox.c:658)
==5330==    by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330==    by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330==  Uninitialised value was created by a stack allocation
==5330==    at 0x5E4FA8D: _gtk_tree_view_column_allocate
(gtktreeviewcolumn.c:2139)
2011-09-28 20:20:20 -04:00
Benjamin Otte
08d578dfcb table: Deprecate GtkTable for GtkGrid 2011-09-29 01:51:46 +02:00
Benjamin Otte
80462c7cfd docs: Make infobar code example use GtkGrid instead of GtkTable 2011-09-29 01:51:46 +02:00
Benjamin Otte
88a7942198 print: Convert custom paper dialog from GtkTable to GtkGrid 2011-09-28 05:29:50 +02:00
Cosimo Cecchi
5cf0450c69 toolbutton: don't force the icon widget to be a GtkMisc
There's really no reason the icon widget must be a GtkMisc. You might
want to use e.g. a GtkSpinner.
2011-09-27 17:31:11 -04:00
Cosimo Cecchi
63124e81b6 notebook: vborder/hborder deprecations are Since: 3.4, not 3.2 2011-09-27 13:46:01 -04:00
Cosimo Cecchi
c2f5d3d8b0 notebook: add top/bottom/left/right style classes to the tab region
When we use the style context to get information for the tab region,
also add a style class to indicate its position, so that the relevant
information is pulled off from the theme.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Cosimo Cecchi
8d3f7e3a4a stylecontext: add style classes for top/bottom/right/left areas
This is useful to e.g. theme notebook tabs differently according to
their position directly from the CSS sheet.

GtkNotebook support in a separate commit.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Cosimo Cecchi
d6a58e5bd3 notebook: unconditionally apply padding to the tab content
Not only when on left or top, otherwise the other position look
off-centered.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Cosimo Cecchi
34ee6d08bb notebook: really deprecate tab_vborder and tab_hborder
The setter for this was deprecated in 2.x and removed in 3.0.
I don't see any reason why we should hardcode 2px for this value;
instead, deprecated the getter and make it always return zero, and stop
using the variables internally.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Cosimo Cecchi
2500a95fad notebook: allow using different padding values for the active tab state
The code before was basically adding and removing the same padding value
in two different places during the allocation cycle.
Instead, what we want to do is to offset the inactive tab allocation by
the difference with the active tab padding, to ensure the tab content is
always drawn centered and in the right position.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Cosimo Cecchi
d4f83cdfb6 notebook: use the current state to get the padding values
We want to enable the use of different padding values between active and
inactive tabs, so that the two are completely separated (but limited by
the active tab size).
This way themes can decide how bigger the active tab is drawn compared
to the normal one just specifying a different padding value from the
CSS, like this:

.notebook tab {
  padding: 2;
}

.notebook tab:active {
  padding: 4;
}

As a first step, fetch the padding values with the right state flags
from GtkStyleContext.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Cosimo Cecchi
82710adc24 mountoperation: fix the build
2d3db3421f has a typo which broke the
build on master.
2011-09-27 12:51:54 -04:00
Michael Natterer
2d3db3421f Bug 659406 - Abstract what triggers a context menu
Add gdk_event_triggers_context_menu(), using the new modifier
abstraction API. Remove _gtk_button_event_triggers_context_menu()
and port all callers.
2011-09-27 15:45:18 +02:00
Michael Natterer
27cbbc4a7d GtkSettings: fix compile warnings on != X11 2011-09-27 14:21:09 +02:00
Michael Natterer
11f8c1ba6f gtk: remove the private GTK_EXTEND/MODIFY_SELECTION_MOD_MASK
and use the new public modifier abstraction API instead.
2011-09-27 12:06:10 +02:00
Michael Natterer
0abe8ce27b gtk: remove the private GTK_NO_TEXT_INPUT_MOD_MASK
and use the new public modifier abstraction API.
2011-09-27 11:34:19 +02:00
Michael Natterer
4a7a67339a Bug 659602 - Provide an abstraction for the platform's use of modifier keys
Add enum GdkModifierIntent which identifies use cases for modifier masks
and GdkKeyMap::get_modifier_mask(). Add a default implementation which returns
what is currently hardcoded all over GTK+, and an implementation in the
quartz backend. Also add gtk_widget_get_modifier_mask() which simplifies
things by doing widget->display->keymap->get_modifier_mask().
2011-09-27 09:56:25 +02:00
Benjamin Otte
aebd859ef9 toolbar: Fix widget path creation code
- Ensure arrow button is always included
- Invalidate list when direction changes
2011-09-27 05:37:14 +02:00
Benjamin Otte
276a9d7567 container: Warn if an invalid widget path is created
This makes it quite a bit easier to debug things.
2011-09-27 05:37:14 +02:00
Michael Natterer
b663f3a00b Bug 659406 - Abstract what triggers a context menu
Add _gtk_button_event_triggers_context_menu() and use it instead
of checking for event->button == 3, so context menus are invoked
correctly on the Mac.
2011-09-26 16:01:50 +02:00
Michael Natterer
0955a59563 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".
2011-09-26 16:01:50 +02:00
Michael Natterer
286fff4e5f gtk: use GTK_NO_TEXT_INPUT_MOD_MASK also in gtkfilechooserdefault.c
(cherry picked from commit b057a311e7)
2011-09-26 16:01:50 +02:00
Michael Natterer
24a42839ba 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.
2011-09-26 16:01:50 +02:00
Michael Natterer
2a8be23d17 gtk: fix entering of Option-foo symbols on the Mac
define GTK_NO_TEXT_INPUT_MOD_MASK in gtkprivate.h
and use it in the IM contexts, so Option-foo is no longer
filtered away.
2011-09-26 16:01:50 +02:00
Michael Natterer
d3df4678ca gtk: use GTK_DEFAULT_ACCEL_MOD_MASK instead of GDK_CONTROL_MASK in gtkstock.c 2011-09-26 16:01:50 +02:00
Michael Natterer
c50063397f gtk: disable mnemonics in gtkrc.key.mac, they don't exist on the Mac
(cherry picked from commit d83c86d42e)
2011-09-26 16:01:50 +02:00
Michael Natterer
3fd7dbc940 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 be1eea612c)
2011-09-26 16:01:50 +02:00
Benjamin Otte
b01e20f1d1 cssprovider: Remove unused enums 2011-09-26 16:00:26 +02:00
Benjamin Otte
1e36e40e29 styleproperty: Allow 'transparent' keyword for background-color 2011-09-26 16:00:26 +02:00
Benjamin Otte
205d0eb4da styleproperty: Default to transparent background-color 2011-09-26 16:00:26 +02:00
Benjamin Otte
61525f0662 styleproperty: Use the long form to register background-color
We want to set a default value.
2011-09-26 16:00:25 +02:00
Matthias Clasen
5ff8fe6971 Documentation fixes
Mostly making sure that return values and varargs don't loose
their docs.
2011-09-25 21:04:49 -04:00
Michael Natterer
a6151ebb95 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.
2011-09-26 00:52:28 +02:00
Michael Natterer
c7cf1f531d 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).
2011-09-25 17:45:57 +02:00
Michael Natterer
33f7754a71 GtkTreeViewColumn: fix return value of gtk_tree_view_column_cell_get_position()
Return FALSE again if the passed in cell is not part of the column.
It was always returning TRUE since GtkCellArea was introduced.
2011-09-25 14:55:23 +02:00
Matthias Clasen
dd82b30433 Fix module blacklisting
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.

https://bugzilla.gnome.org/show_bug.cgi?id=659966
2011-09-23 16:42:45 -04:00
Benjamin Otte
bd8e9085ab textview: Fix comparison being the wrong way
Keynav failed when the position did _not_ change.
2011-09-23 22:24:00 +02:00
Alban Crequy
6ab7b87a02 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().

Gtk-CRITICAL **: gtk_tree_path_compare: assertion `b->depth > 0' failed

The stack with the bug was:

  #0  gtk_tree_path_compare at gtktreemodel.c
  #1  traverse_cells at gtktreeviewaccessible.c
  #2  model_row_inserted at gtktreeviewaccessible.c

This patch calls iterate_thru_children() with a copy of the path so that the
original is not modified.
2011-09-23 12:04:39 -04:00
Bastien Nocera
a0fc947f89 GtkAssistant: Fix problems with gtk_widget_show_all()
gtk_widget_show_all() would have shown every single item inside
the GtkAssistant sidebar, as well as all the navigation buttons.

https://bugzilla.gnome.org/show_bug.cgi?id=659826
2011-09-23 12:45:09 +01:00
Christian Persch
370f0d1d86 Disable font fallback in the fontchooser preview
The preview is should show the selected font, not whatever
font contains glyphs for the preview text.
2011-09-23 00:32:44 +02:00
Benjamin Otte
7c675b34c5 fontbutton: Properly display absolute sizes
Display them the same way as Pango does.
2011-09-22 21:44:06 +02:00
Benjamin Otte
d5bc1b66d2 fontbutton: Properly update label after property changes
Previously, the font wasn't properly updated after some changes.
2011-09-22 21:44:05 +02:00
Benjamin Otte
19623af04e fontbutton: Display the same text as elsewhere
In particular, display names of families that don't have an installed
font.
2011-09-22 21:44:05 +02:00
Benjamin Otte
18a6d9803e fontchooser: Use fixed height mode for the font face list
Now that we enforce same height anyway, this just further speeds things
up.
2011-09-22 21:44:05 +02:00
Benjamin Otte
1892c64acc 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.
2011-09-22 21:44:05 +02:00
Benjamin Otte
59fbfd6205 fontchooser: Split out computing of the preview text attributes 2011-09-22 21:44:05 +02:00
Benjamin Otte
c1958ae9f2 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...
2011-09-22 21:44:05 +02:00
Benjamin Otte
14154dac31 fontchooser: Set cell data as text + attributes instead of markup
This is quite a bit uglier, but allows more freedom.
2011-09-22 21:44:05 +02:00
Benjamin Otte
38af387ee3 fontchooser: Reselect font when it's unfiltered 2011-09-22 21:44:05 +02:00
Benjamin Otte
c9ef2d019e 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.
2011-09-22 21:44:05 +02:00
Benjamin Otte
7d5d0a19e7 fontchooser: Only create font descriptions on demand
pango_font_describe() is expensive, so try not to use it.
2011-09-22 21:44:05 +02:00
Benjamin Otte
a40d0b44e1 fontchooser: Make all setters go through merge_font_desc()
Don't special case cursor_changed anymore.
2011-09-22 21:44:05 +02:00
Benjamin Otte
af8c3fe98e fontchooser: Update range marks properly
Range marks weren't updated previously when the font was set
programmatically. Also, setting the range marks could cause the font
size to change.
2011-09-22 21:44:05 +02:00
Benjamin Otte
59298d9e82 fontchooser: Reorganize code a bit
The main reason is so that we have a new function that we can use from
the cursor_changed_cb.
2011-09-22 21:44:05 +02:00
Benjamin Otte
132ccf021f fontchooser: Don't store the current face and family anymore
They can be queried on-demand from the font list.
2011-09-22 21:44:05 +02:00
Benjamin Otte
7cf53a9f60 fontchooser: Take font description from model
... instead of taking face and constructing it from there.
2011-09-22 21:44:05 +02:00
Benjamin Otte
2b83d03604 fontchooser: Sanitize variable declarations
- no empty lines between variables
- no unnecessary casts
- use glib-style casts
- no spaces
2011-09-22 21:44:05 +02:00
Benjamin Otte
5a5737e3b6 fontchooser: Fix leak
the path variable is set, not filled in.
2011-09-22 21:44:05 +02:00
Benjamin Otte
a124d17825 fontchooser: Store an iter to the current font
Note that we cannot use GtkTreeSelection for this, because when the font
list is filtered the current font may not be visible.
2011-09-22 21:44:05 +02:00
Morten Welinder
9d96830571 cssprovider: Remove outdated docs 2011-09-22 21:44:05 +02:00
Benjamin Otte
6499088f7f fontchooser: Store tree model member variables as GtkTreeModel
... and remove the now unnecessary treemodel casts everywhere.

Just code cleanup.
2011-09-22 21:44:05 +02:00
Benjamin Otte
3d87ee7716 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.
2011-09-22 21:44:04 +02:00
Benjamin Otte
6cbbc789d5 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.
2011-09-22 21:44:04 +02:00
Benjamin Otte
5834691e69 fontchooser: Use a cell_data_func for the font list
This way, we don't have to store the preview text in the list.
2011-09-22 21:44:04 +02:00
Benjamin Otte
3a77b7e005 fontchooser: Don't scroll in the populate_list() function 2011-09-22 21:44:04 +02:00
Benjamin Otte
ded10365a1 fontchooser: Remove needless scroll calls
Previous functions take care of scrolling already.
2011-09-22 21:44:04 +02:00
Benjamin Otte
3af04c1dce fontchooser: Introduce gtk_font_chooser_find_font()
... which looks up the font in the list of fonts. This then can be used
to select an actual font upon changes.

Also fixes cases where the get_family() and get_face() functions would
return outdated data when set_font() had been called.
2011-09-22 21:44:04 +02:00
Benjamin Otte
fe8ed0a3f6 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.
2011-09-22 21:44:04 +02:00
Benjamin Otte
af5f593b6d fontchooser: Fix size computation 2011-09-22 21:44:04 +02:00
Benjamin Otte
8f33324750 fontchooser: Fix gcc warnings 2011-09-22 21:44:04 +02:00
Antoine Jacoutot
3d165c1a90 gtkmountoperation-x11: unbreak compilation on OpenBSD.
Add missing header to prevent undeclared definitions.
Bug #659565
2011-09-21 16:02:33 +02:00
Xavier Claessens
0561c7a68d GtkTreeModelFilter: Fix build warnings
https://bugzilla.gnome.org/show_bug.cgi?id=659441
2011-09-20 09:06:54 +02:00
Benjamin Otte
34f9e6a0f3 fontchooser: Remove special case for a single signal handler 2011-09-19 22:11:06 +02:00
Benjamin Otte
a4c3271854 fontchooser: Remove useless code
gtk_adjustment_set_value() clamps itself, no need to do the clamping.

But I was impressed at the amount of comments.
2011-09-19 22:11:06 +02:00
Benjamin Otte
e465023051 fontchooser: Don't store the size separately
Instead, use the font description's size.
2011-09-19 22:11:06 +02:00
Benjamin Otte
6552a8245b fontchooser: Don't reload the fonts on style changes
It's not necessary, because nothing changes.
2011-09-19 22:11:06 +02:00
Benjamin Otte
64d3350264 fontchooser: Assume NULL screen means the default screen
... and update the font list only when the screen actually changes.
2011-09-19 22:11:06 +02:00
Benjamin Otte
ae5f82e455 fontchooser: Store the font description in the model
It's actually expensive to create (>5ms per font with >1000 fonts
installed), so better cache it.
2011-09-19 22:11:06 +02:00
Benjamin Otte
6d8010d3d4 fontchooser: Move the filter func to the visibility func
... instead of rereading all the fonts every time.

With this change, the liststore now contains every font face known to
GTK, so we can actually walk it for matching fonts.
2011-09-19 22:11:06 +02:00
Benjamin Otte
d88b7a6d6b fontchooser: Fix code to make it not look like GTK 0.9 2011-09-19 22:11:06 +02:00
Benjamin Otte
b95bbb5e39 fontchooser: List font description as font description
Otherwise there will be two properties listed as "Font" in property
selectors (in Glade or testfontchooser).
2011-09-19 22:11:05 +02:00
Benjamin Otte
a5f516c818 fontchooser: Family or face can never be NULL
... so there's no need to special-case those situations.
2011-09-19 22:11:05 +02:00
Benjamin Otte
fb2bc139bb fontchooser: Use gtk_list_store_insert_with_values()
... instead of append() + set_values()
2011-09-19 22:11:05 +02:00
Benjamin Otte
824aeb77c6 fontchooserwidget: Simplify function
- Don't do unnecessary casts
- Fix weird variable declaration indenting
- Fix loop indentation
- Use a for loop for iterating over a list, instead of a while loop
- Casefold font name only once, instead of every iteration
- Remove needless true_var = true_var && TRUE assignment
2011-09-19 22:11:05 +02:00
Chris Coulson
22cd009ef7 GtkPaned: Create the child window at the correct position
When there is only a single child, create its window at the correct position
https://bugzilla.gnome.org/show_bug.cgi?id=659241
2011-09-19 12:28:59 +01:00
Kristian Rietveld
e1ede022f8 treemodelfilter: add additional asserts to MODEL_FILTER_DEBUG mode 2011-09-17 06:09:35 +02:00
Kristian Rietveld
25a514da8a Remove left-over calls to dump function 2011-09-17 06:09:35 +02:00
Bastien Nocera
3c2eb053d6 link-button: Reset the mouse cursor when destroyed
If clicking on a link destroys the link button, and keeps the
same GdkWindow then the cursor stays as a hand in the rest of
the interface.

https://bugzilla.gnome.org/show_bug.cgi?id=659247
2011-09-16 15:06:28 +01:00
Cosimo Cecchi
e9de907f9e iconview: add support for prelight cells
Render GtkIconView cell items with the prelight state flag when they're
being mouse hovered.
This works basically in the same way it's done for GtkTreeView cells,
and e.g. GtkCellRendererPixbuf will need to have its follow-state
property to opt in to prelight rendering.

https://bugzilla.gnome.org/show_bug.cgi?id=615501
2011-09-15 09:34:04 -04:00
Ryan Lortie
f86351c05f GtkApplication: chain up ::startup 2011-09-14 14:04:10 -04:00
Benjamin Otte
9ddc11fbb5 iconview: Don't rturn TRUE from draw handler 2011-09-14 16:10:14 +02:00
Benjamin Otte
9e8b2f2521 treeview: Return FALSE from draw handler
... like every widget should.

https://bugzilla.gnome.org/show_bug.cgi?id=658981
2011-09-14 16:10:14 +02:00
Matthias Clasen
07cecfc601 Fix a parameter name mismatch 2011-09-13 17:36:24 -04:00
Federico Mena Quintero
432b7ee2bc Merge branch 'bgo593793-filechooser-recent-folders-master' 2011-09-13 15:24:37 -05:00
Federico Mena Quintero
c132b6cfc7 bgo#658600 - Don't try to focus the location entry in Recent-files mode
We don't ever start up in Search mode, so we don't need an extra check for that mode, yet.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-09-13 15:24:29 -05:00
Christian Persch
71c16bad33 Take font size also from the font description 2011-09-13 12:55:34 +02:00
Christian Persch
d82895127e Remove some unnecessary casts 2011-09-13 12:55:34 +02:00
Christian Persch
8219a413ff Clarify conditions when get_font_{family,face} return NULL 2011-09-13 12:55:34 +02:00
Christian Persch
b1ff243c57 Fix implementation of GtkFontButton:get_font_{family,face}
Returns a PangoFont{Family,Face} even when the font dialogue
has never been popped up.
2011-09-13 12:55:34 +02:00
Christian Persch
6902813a11 Rename gtk_font_chooser_get_{family,face,size}
... to gtk_font_chooser_get_font_{family,face,size}, in order to
avoid naming conflicts in bindings.
2011-09-13 12:55:33 +02:00
Christian Persch
abd9242f33 Add GtkFontChooser:font-desc property
Add a way to set/get the font as a PangoFontDescription.
2011-09-13 12:55:33 +02:00
Christian Persch
1b818f2e46 Remove GtkFontChooser:[sg]et_font
Now that the setter doesn't return a value anymore, we can just use
g_object_[sg]et instead of having these vfuncs.
2011-09-13 12:55:22 +02:00
Christian Persch
0b7db6888a Setters should not return a boolean
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.
2011-09-13 12:55:22 +02:00
Matthias Clasen
cf14868619 Cosmetic doc fixes 2011-09-13 12:55:22 +02:00
Matthias Clasen
bdcb8558e3 Trivial: Fix up function name in the docs 2011-09-13 12:55:22 +02:00
Christian Persch
85e95a765d Mark string for translation 2011-09-13 12:55:22 +02:00
Christian Persch
ca4152995a GtkFontChooser implementation for GtkFontButton 2011-09-13 12:55:21 +02:00
Christian Persch
eb9efc9fd2 Rename GtkFontChooser:font-name to :font
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.
2011-09-13 12:55:21 +02:00
Christian Persch
5452525143 Make GtkFontChooser an interface
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
2011-09-13 12:55:21 +02:00
Murray Cumming
7eeebd4311 gtk_assistant_remove_page() docs: Fix typo. 2011-09-13 10:08:48 +02:00
Matthias Clasen
7466f846b7 GtkSearchEngineTracker: port to tracker 0.12
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
2011-09-12 21:35:31 -04:00
Matthias Clasen
353c7c622e GtkFileChooserButton: Expand like other 'pickers'
Reported in bug 658774.
2011-09-12 21:33:11 -04:00
John Ralls
7550157d66 bgo#514843 - [filechooser] Deal with corrupted .gtk-bookmarks gracefully
We weren't checking for the lines in that file being valid UTF-8 strings.
2011-09-12 14:30:44 -05:00
Kristian Rietveld
3fc80381fd Add unit test for Bug 657353
This is to verify that Bug 657353 has been fixed.
2011-09-11 20:19:56 +02:00
Kristian Rietveld
7c0526e9b2 treemodelfilter: bring if-condition in sync
Bring the if-condition in sync with the other if-conditions in the
function where the "path" variable is used.
2011-09-11 20:19:56 +02:00
John Ralls
7cff8c4403 Quartz: gtk_drag_highlight_draw(): Set the GtkStyleContext to the widget.
Otherwise there's no actual context to save and restore.
2011-09-11 10:49:54 -07:00
Kristian Rietveld
3db7344f33 treemodelfilter: correct forgotten unref of parent on level destroy
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.
2011-09-11 16:53:27 +02:00