Commit Graph

18619 Commits

Author SHA1 Message Date
Sébastien Wilmet
67d1183ac9 Document GtkTextSearchFlags
Move the doc about the flags from gtk_text_iter_forward_search() to the
enum.

https://bugzilla.gnome.org/show_bug.cgi?id=390048
2013-06-25 13:21:08 +02:00
William Jon McCann
02c793f24a Start migrating internals away from GtkStock 2013-06-24 22:20:49 -04:00
William Jon McCann
2b571f41e2 Remove more discontinued ChangeLogs
They are all in git.
2013-06-24 19:53:08 -04:00
Ryan Lortie
c79a21e1dd menu model: set separator label conditionally
When creating separators we were binding the "label" property on the
tracker to the "label" property on the GtkSeparatorMenuItem.

This was problematic for two reasons.

First, it was pointless.  The section header label will never change.

Second, it was causing problems: doing the binding caused the value to
be initially synced up, even if it was NULL.  Doing this caused
GtkMenuItem to create a GtkAccelLabel and add it as a child, which
prevented the separator from being shown normally.

Change the code a bit so that we just call gtk_menu_item_set_label()
when creating the item, if we find the label to be non-NULL.

Also, show() the separator item at first.  GtkMenu manages visibility of
separators internally, but it seems "more correct" to show it ourselves
at first.
2013-06-24 18:05:27 -04:00
Ryan Lortie
d498e9b588 GtkMenuTracker: fix leak when creating submenus 2013-06-24 18:05:27 -04:00
Benjamin Otte
830691bdce treeview: Ensure we first validate the visible area when validating
This invariant stopped being guaranteed when we moved the visible area
validation from a high priority idle to a tick callback.

Fixes redrawing bugs like row expanding sometimes not having any visual
effect.
2013-06-24 20:19:11 +02:00
Benjamin Otte
2008148303 treeview: Reorder code
This just moves a function and is in preparation for the next commit.
2013-06-24 20:19:05 +02:00
Benjamin Otte
f54e37a23b treeview: Actually remove presize handler when we presize
Avoids multiple calls to it.
2013-06-24 20:19:05 +02:00
Sébastien Wilmet
ea4e88df86 textiter: bug fix in forward_search() and backward_search()
When the search is case sensitive, g_utf8_normalize() is not called, so
the skip_decomp argument of the function forward_chars_with_skipping()
must be FALSE.

To verify that, when searching "éb", the count parameter of
forward_chars_with_skipping() have a different value:
- case sensitive: count = 2
- case insensitive: count = 3 (g_utf8_normalize() has been called)

The commit adds unit tests that didn't pass before, and that now pass
(without known regression, obviously).

https://bugzilla.gnome.org/show_bug.cgi?id=702977
2013-06-24 20:14:39 +02:00
William Jon McCann
99fa59c961 Add missing allow-none annotations 2013-06-24 13:46:56 -04:00
Ryan Lortie
1107935d2b GMenuModel -> GtkMenu binding: show submenu items
In the non-submenu case we bind the 'visibility' attribute to the
tracker, which takes care of showing the item.  In the submenu case, we
don't bind all of the properties, so we miss this one.

Deal with it by just show()ing the submenu item.

https://bugzilla.gnome.org/show_bug.cgi?id=702332
2013-06-22 09:35:59 -04:00
Federico Mena Quintero
32e75adf6a GtkFileChooserButton: Also emit 'file-set' when changing the selection through the combo box
https://bugzilla.gnome.org/show_bug.cgi?id=696498
2013-06-21 19:14:36 -05:00
Federico Mena Quintero
9162589b5a GtkFileChooserEntry: don't inline-complete if the entry doesn't have the focus
When the file chooser changes directories, it tells the GtkFileChooserEntry to
change its base folder (i.e. the folder from which relative pathnames are resolved).
GtkFileChooserEntry then starts loading a GtkFileSystemModel asynchronously.
In the finished_loading_cb(), however, it would always ask the GtkEntryCompletion
to insert the completion prefix, since that finished_loading_cb() is what is also used
while the user is typing *in the entry*.

But when the entry doesn't have the focus (e.g. the user changed directories by double-clicking
on the file list in the file chooser), there's no reason to insert completions at all.

https://bugzilla.gnome.org/show_bug.cgi?id=672271
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-06-21 18:35:28 -05:00
William Jon McCann
1b3f9df361 Remove rest of gtk-show-input-method-menu and gtk-show-unicode-menu
They are no longer used.
2013-06-21 08:59:32 -04:00
Jonh Wendell
c27ddc66c5 GtkEntry: ellipsize placeholder text
The placeholder string is truncated when there's no
room for it in entry's width.

So, by ellipsizing it, the user can notice the text
was truncated so that they can workaround that by,
for example, maximizing the window.

https://bugzilla.gnome.org/show_bug.cgi?id=702763
2013-06-21 09:29:15 -03:00
Benjamin Otte
8623d73c11 filechooser: Actually return a value 2013-06-21 02:59:23 +02:00
Benjamin Otte
5c61e457c8 treeview: Remove duplicate function 2013-06-21 02:59:23 +02:00
Sébastien Wilmet
08d49fdd58 Fix gtk_text_iter_forward_to_tag_toggle() for end iter
The function must return TRUE only if there is a tag toggle _after_ the
iter, not _at_ the iter. So for the end iter, the function must always
return FALSE.

Add also unit tests for gtk_text_iter_forward_to_tag_toggle().

https://bugzilla.gnome.org/show_bug.cgi?id=691266
2013-06-20 20:22:56 +02:00
Timothy Arceri
555e0a785d filechooser: Fix misleading documentation for gtk_file_chooser_set_preview_widget()
https://bugzilla.gnome.org/show_bug.cgi?id=701174
2013-06-20 12:29:02 -05:00
Sébastien Wilmet
38d78f48b5 Improve doc of gtk_text_iter_forward_search()
It was not possible to know if the @limit was for @match_start or
@match_end. It was documented for backward_search(), but not for
forward_search().

https://bugzilla.gnome.org/show_bug.cgi?id=390048
2013-06-20 12:39:24 +02:00
Claudio Saavedra
0540edcf9c gtkfilechooserbutton: fix documentation typo
https://bugzilla.gnome.org/show_bug.cgi?id=702695
2013-06-20 11:48:51 +03:00
Jonh Wendell
84b4910b39 filechooser: Add gtk_file_chooser_get_current_name()
Currently you can only set the current filename, but not
get it. It's useful to be able to get it in save
dialogs, where the user has typed the desired filename
and you are not in a real directory (recent used, for
example).

https://bugzilla.gnome.org/show_bug.cgi?id=702497
2013-06-19 13:37:35 -05:00
Alexander Larsson
159cccfe7b IconTheme: Move changed emission to an idle
By delaying the emission to an idle we avoid a lot of tricky
reentrancy issues. For instance, a normal gtk_icon_theme_choose_icon()
call could in very rare cases (when a user updated an icon theme) emit
a signal which could affect the icon currently being looked up.  This
kind of reentrancy is very hard to test against, especially when it is
so rare, so we're better of avoiding it.

There is no real value to get the change signal directly anyway. All
it can do is affect which icon is rendered the next frame, and we will
handle the queued emission before rendering. Not to mention that icon
theme change detection is polled anyway, so it is already delayed.

https://bugzilla.gnome.org/show_bug.cgi?id=694755
2013-06-19 11:15:37 +02:00
Alexander Larsson
1ee36713fe IconTheme: Clear caches when reloading theme
When we're reloading the theme in ensure_valid_themes (due to noticing
that a theme dir has changed) we need to also clear the icon cache
as it will not be valid for the new theme.

We already do this in do_theme_change(), but ensure_valid_themes()
was missing this.

https://bugzilla.gnome.org/show_bug.cgi?id=702598
2013-06-19 09:40:19 +02:00
Alexander Larsson
280d606cd4 IconCache: Keep a ref on the GtkIconData
The icon data in GttkIconInfo->data is currently owned by the
IconThemeDir->icon_data hashtable. However, on e.g. a theme change
blow_themes() destroys the dirs and thus the data, meaning any
outstanding GtkIconInfo points to stale data.

We solve this by adding a refcount to GtkIconData and reffing it
from GtkIconInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=702598
2013-06-19 09:40:19 +02:00
Ryan Lortie
7554c15e7b GtkBuilder: add new constructor APIs
Add new APIs gtk_builder_new_from_{file,resource,string}() and encourage
their use over the older _add_from_...() APIs.

https://bugzilla.gnome.org/show_bug.cgi?id=679930
2013-06-18 10:21:27 -04:00
Ryan Lortie
1bc7359123 docs: GtkBuilder: warn about unusual GError use
GtkBuilder returns GError for _add_from_{file,resource,string}(),
implying that the user should be able to recover from these errors.
Mention in the docs that it's unreasonable to try to do this.

https://bugzilla.gnome.org/show_bug.cgi?id=679930
2013-06-18 10:17:34 -04:00
Alexander Larsson
242d0c5d22 Revert "GtkWindow: Move cairo_save/restore from marshaller"
This reverts commit 6c7689506f.

This is not right as we need to save/restore around *each*
callback, not just each emission.
2013-06-18 11:32:18 +02:00
Alexander Larsson
207703155b listbox: handle moving mouse out of widget with button down
Unset active row, etc when mousing out of the widget totally.
2013-06-17 15:15:07 +02:00
Alexander Larsson
3513981e1e listbox: Properly handle double click
We never want to handle GDK_2BUTTON_PRESS like a normal first click.
2013-06-17 15:15:07 +02:00
Alexander Larsson
e4a981eef2 listbox: Rewrite coords from child windows
If button events are from child windows we need to rewrite
the coordinates to our window.
2013-06-17 15:15:07 +02:00
Matthias Clasen
65f0e194e0 Fix a small memory leak 2013-06-15 23:35:25 -04:00
Matthias Clasen
5707e81c81 GtkBuilder: don't leak callbacks
This was noticed while running the testsuite under valgrind.
2013-06-15 23:33:51 -04:00
Matthias Clasen
c9ec4ba5a1 GtkImage: Fix the initial value of icon-size
Since we are pulling the icon-size out of the icon helper now,
we should set its icon-size when constructing it.
2013-06-15 20:23:01 -04:00
Matthias Clasen
87190233ef GtkListBox: cosmetics
Clean up formatting trivia, adjust includes to gtk conventions,
use P_() for properties, etc.
2013-06-15 12:32:59 -04:00
Bastien Nocera
3d11b9b758 GtkSearchBar: Mention we don't handle Ctrl+F for the app
There's probably an expectation from the app developers that
Ctrl+F or similar common shortcuts for starting a search will
be handled by the widget, when this is not the case. Explicitely
mention it in the docs to avoid confusion.

https://bugzilla.gnome.org/show_bug.cgi?id=701523
2013-06-14 19:10:39 +02:00
Bastien Nocera
19c5b37d9d GtkHeaderBar: Fix buildable function names
It's a GtkHeaderBar, not GtkHeader.

https://bugzilla.gnome.org/show_bug.cgi?id=701346
2013-06-14 19:10:39 +02:00
Bastien Nocera
8a45cb5762 GtkHeaderBar: Make labels creation available privately
So it can be reused in subclasses

https://bugzilla.gnome.org/show_bug.cgi?id=701345
2013-06-14 19:10:39 +02:00
Alexander Larsson
264cbc9e35 GtkStack: Switch order on left/right up/down transitions.
When the new child is on the left, scroll right. This makes the
thing look physically "real".
2013-06-13 20:55:05 +02:00
Alexander Larsson
418ac673a3 GtkStack: Fix drawing of sliding
We were not drawing the view window, so the old widget
was clipped for the sliding transitions.
2013-06-13 20:50:41 +02:00
Erick Pérez Castellanos
33a1c4d6e0 GtkStack: Add position-dependent slide transitions
These go left/right or up/down depending on the relative
order of the children being switched between.
2013-06-13 20:33:42 +02:00
Benjamin Otte
0d55d9b96b treeview: Use gtk_adjustment_configure()
... instead of manually setting all the values. Makes for nicer code and
less signal emissions.
2013-06-13 15:31:35 +02:00
Alexander Larsson
61f44628d6 GtkListBox: Consider width of filtered rows
Without this lists keep shrinking in width as they are filtered, whic
looks really bad.
2013-06-13 12:17:08 +02:00
Alexander Larsson
220eb45ef0 GtkListBox: Protect against reentrancy.
Activating a row may destroy the widget, so keep a ref since
we're doing thing to the listbox after emission.
2013-06-13 12:17:08 +02:00
Alexander Larsson
0f93b7f6c4 GtkListBox: minor fix
Move the check inside the existing chech which also checks
for active_row != NULL for extra safety.
2013-06-13 12:17:08 +02:00
Alexander Larsson
1dd0b468a7 GtkListBox: Add style classes for lists and rows 2013-06-13 12:17:07 +02:00
Alexander Larsson
3bb2d15195 GtkListBox: Add getter for activate_on_single_click 2013-06-13 12:17:07 +02:00
Alexander Larsson
90ff262df6 GtkListBox: Rename reXXX to invalidate_XXX
This is lets us later move to a setup where the rows are not
immediately resorted but queued until next layout.
2013-06-13 12:17:07 +02:00
Alexander Larsson
caacce6d44 GtkListBox: Add placeholder widget support 2013-06-13 12:17:07 +02:00
Alexander Larsson
b0b746b2ea GtkListBox: Track the number of visible children 2013-06-13 12:17:07 +02:00