Commit Graph

36463 Commits

Author SHA1 Message Date
Matthias Clasen
902ebaafd5 gtk3-demo: avoid a resizing problem
Two changes that sneaked in during the GtkApplication port
made it so that the window would not let you shrink it again
after you've made it larger. This also yielded very surprising
results when unmaximizing the window: it would come back to
have a minimum width slightly larger than the screen, making
maximization fail from then on.
2014-01-11 18:06:06 -05:00
Tong Hui
c68feef583 Update Chinese simplified translation 2014-01-11 10:26:28 +08:00
Jasper St. Pierre
8a1fb19e88 gtkwindow: Rename get_decoration_size => get_shadow_width 2014-01-10 12:10:33 -05:00
Ignacio Casal Quinteiro
99ee1875ab gtkapplication: add missing annotation for set_accels_for_action 2014-01-10 15:19:05 +01:00
Alexander Larsson
ceaeb02ade README: Add note about gtk_text_view_add_child_in_window changes 2014-01-10 12:08:52 +01:00
Alexander Larsson
664fe89f6e GtkTextView: Fix scrolling of added children
The behaviour of gtk_text_view_add_child_in_window() used to be
quite broken. It scrolled with the window during scrolling, then
jumped to the absolute position when the widget resized. Furthermore,
in 3.10 we broke the first feature, making it always be fixed.

The "proper" way to handle this is to always follow scrolling. This
is what the only user so far (gedit) wants, and if you want some
kind of overlay you should use GtkOverlay instead.

So, this changes the behaviour to something that is internally consistent
and works. I.e. all added widgets scroll with the textview as needed.

https://bugzilla.gnome.org/show_bug.cgi?id=711826
2014-01-10 12:08:52 +01:00
Alexander Larsson
59bf558995 testtextview: Add test for gtk_text_view_add_child_in_window
https://bugzilla.gnome.org/show_bug.cgi?id=711826
2014-01-10 12:08:51 +01:00
Milo Casagrande
2544135d91 [l10n] Updated Italian translation. 2014-01-10 09:08:12 +01:00
Rico Tzschichholz
ed5d9b3c3e x11: Add/Fix '(type *)' g-i annotations 2014-01-09 21:47:04 +01:00
Ryan Lortie
7291d3e780 Simplify GtkActionHelper
Now that the last GMenuModel-based user of GtkActionHelper is gone, we
can substantially simplify it.

https://bugzilla.gnome.org/show_bug.cgi?id=721836
2014-01-08 18:21:26 -05:00
William Hua
649ff84d91 Use GtkMenuTracker for Quartz backend.
https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-08 18:16:05 -05:00
William Hua
2a109250d5 Move get_key_equivalent() to gdk quartz utils.
https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-08 17:42:19 -05:00
Christian Kirbach
92fcc31c8a Updated German translation 2014-01-08 23:26:41 +01:00
Ryan Lortie
d31bf779bb GtkMenuTracker: fix hidden-when='' vs. separators
Ensure that adding hidden-when='' to a menu item does not produce an
extra separator item as a side effect.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:31:16 -05:00
Ryan Lortie
2bcb4fc354 bloatpad: test hidden-when=''
Cook up some silly cases to test out the hidden-when='' attribute.

 - make sure hidden-when='action-missing' shows/hides items based on
   actions being created and destroyed

 - make sure hidden-when='action-disabled' shows/hides items based on
   actions being enabled and disabled

 - make sure hidden-when='action-missing' doesn't hide items when the
   action is merely disabled

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:21:19 -05:00
Ryan Lortie
2112af719a GtkMenuTracker: remove hidden items from the menu
Modify the tracker so that it manages the visibility of
GtkMenuTrackerItem by issuing insert and remove callbacks to the
user of the tracker.

This works by treating the GtkMenuTrackerItem as a virtual section which
contains 1 item when the item is visible and 0 items when it is hidden.

For efficiency reasons, we only employ this trick in the case that the
item has a hidden-when='' attribute set on it.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:21:19 -05:00
Ryan Lortie
2b1aa12f01 GtkMenuTrackerItem: add an internal 'visible' flag
Add an internal API for checking if a GtkMenuTrackerItem is visible,
along with a signal for reporting changes in that flag.  The item will
become invisible in situations according to the new hidden-when=''
attribute, which can be set to 'action-disabled' or 'action-missing'.

This new flag doesn't actually do anything yet, and none of the
consumers of GtkMenuTracker do anything with it (nor should they).  A
followup patch will address the issue.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:21:18 -05:00
Ryan Lortie
8efb1404cb GtkMenuTracker: rework action removal a bit
Refactor the code in the action observer remove function in order to
make way for the (efficient) handling of hiding of the item in the case
that hidden-when='' is given.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:21:18 -05:00
Ryan Lortie
8256b88eb1 GtkMenuTrackerItem: small logic tweak
Strictly speaking, can_activate should always be set back to FALSE when
the action disappears from the muxer (since we can't activate it
anymore) but we forgot to do that.

This 'bug' could never cause a problem because 'can_activate' is never
directly queried for anything at all and the item would get marked
insensitive anyway.  As soon as the action was re-added, can_activate
would be recalculated based on the new action before anything else could
happen.

All the same, this should be cleared here.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:21:18 -05:00
Ryan Lortie
fb14a78271 GtkMenuTracker: cache result of hash lookup
Remove a hash lookup from the separator sync logic (which is run every
time we change a menu).  Instead, we do the lookup when creating the
section and cache the result.

This refactor will also help us in a future commit to add support for
hiding menu items based on missing actions.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:21:17 -05:00
Ignacio Casal Quinteiro
75ef6096c1 colorbutton: fix crash when destroying the colorbutton from the color-set signal 2014-01-08 14:38:33 +01:00
Daniel Mustieles
e94152dfbe Updated Spanish translation 2014-01-08 12:44:09 +01:00
Alexander Larsson
d07913840a PixelCache: Ensure clean cairo_t state in draw
This adds save/restore calls to the clear-to-transparent call in
the pixel cache, to avoid changing the default color of the
cairo_t. It also removes a call set_operator call that is no longer
necessary (it was trying to manually restore the state).

https://bugzilla.gnome.org/show_bug.cgi?id=721480
2014-01-08 10:48:56 +01:00
Steve Langasek
256561db2f fix prototypes of signal callbacks in the test suite
The signal callbacks are defined to take pointers as their arguments, but the
callbacks found in testsuite/gtk/builder.c are passing a GParamSpec by value
as the second argument.  This confuses and angers the compiler on ppc64el,
resulting in segfaults after return from the function due to stack-smashing
by the (completely-unused) argument.

https://bugzilla.gnome.org/show_bug.cgi?id=721700
2014-01-08 10:43:52 +01:00
William Hua
6b865d5312 Add icon menu to bloatpad.
https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-08 02:20:21 -05:00
William Hua
fd13713230 GtkIconInfo: add gtk_icon_info_is_symbolic()
https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-08 02:10:14 -05:00
Ryan Lortie
146f3a988d gtkapplication-quartz: clean up inhibit code
When testing with bloatpad, the existing inhibit code seems not to be
working at all.  Replace it with a cleaner and simpler version that
works.

https://bugzilla.gnome.org/show_bug.cgi?id=720551
2014-01-07 23:08:45 -05:00
Ryan Lortie
99ebb1cad2 app window: test actiongroup across destroy
Make sure that we don't violate the interface contract of GActionGroup
just because gtk_widget_destroy() was called.

https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-07 20:30:57 -05:00
Ryan Lortie
2fd307fdb3 Fix GtkApplicationWindow action group implementation
GtkApplicationWindow frees its internal action group on dispose for the
usual reasons: to avoid the possibility of reference cycles caused by
actions referring back to the window again.

Unfortunately, if it happens to be inside of a GtkActionMuxer at the
time that it is disposed, it will (eventually) be removed from the muxer
after it has been disposed.  Removing an action group from a muxer
involves a call to g_action_group_list_actions() which will crash
because the internal action group to which we normally delegate the call
has been freed.

A future patch that reworks the quartz menu code will introduce a use of
GtkActionMuxer in a way that causes exactly this problem.

We can guard against the problem in a number of ways.

First, we can avoid the entire situation by ensuring that we are removed
from the muxer before we destroy the action group.  To this end, we
delay destruction of the action group until after the chain-up to the
dispose of GtkWindow (which is where the window is removed from the
GtkApplication).

Secondly, we can add checks to each of our GActionGroup and GActionMap
implementation functions to check that the internal action group is
still alive before we attempt to delegate to it.

We have to be careful, though: because our _list_actions() call will
suddenly be returning an empty list, people watching the group from
outside will have expected to see "action-removed" calls for the
now-missing items.  Make sure we send those. but only if someone is
watching.

https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-07 19:29:05 -05:00
Matthias Clasen
851d5f1c7d Add a reftest for GtkActionBar child ordering
This shows that GtkActionBar and GtkBox treat pack-start/-end
the same.
2014-01-07 19:05:40 -05:00
Piotr Drąg
980f3589f5 Updated POTFILES.in 2014-01-07 23:43:54 +01:00
Matthias Clasen
3efd0b2874 GtkActionBar: Just leave the center widget as NULL, initially
No need to construct a box that gets thrown away later.
Plus, this fixes the defaultvalue test for GtkActionBar.
2014-01-07 16:16:52 -05:00
Matthias Clasen
cc6ffd0481 Release-note the headerbar child order change 2014-01-07 13:46:08 -05:00
Matthias Clasen
0f9f3e8fa2 Make testsplitheaders more robust
Same empty string issue that I fixed in GtkHeaderBar a few days
ago.
2014-01-07 13:45:55 -05:00
Gabor Kelemen
41d59985d7 Updated Hungarian properties translation 2014-01-07 18:58:53 +01:00
Matthias Clasen
07f9b3ffa2 Add an action bar test
https://bugzilla.gnome.org/show_bug.cgi?id=721665
2014-01-07 08:46:37 -05:00
Matthias Clasen
b39f094b21 Fix order of pack-end widgets
https://bugzilla.gnome.org/show_bug.cgi?id=721665
2014-01-07 08:46:37 -05:00
William Jon McCann
51d462e927 widget-factory: add actionbar
https://bugzilla.gnome.org/show_bug.cgi?id=721665
2014-01-07 08:46:37 -05:00
William Jon McCann
0a95515bfe tests: use actionbar in headerbar test
This is a great example of where headerbar should not be used.

https://bugzilla.gnome.org/show_bug.cgi?id=721665
2014-01-07 08:46:37 -05:00
William Jon McCann
e72aca055d Add GtkActionBar
A widget intended to offer contextual actions for a given view.
It allows packing children into the start or end as well as offering
a single centered child box.

https://bugzilla.gnome.org/show_bug.cgi?id=721665
2014-01-07 08:46:37 -05:00
Daniel Mustieles
ce848c9bed Updated Spanish translation 2014-01-07 13:29:40 +01:00
Daniel Mustieles
506042ea2d Updated Spanish translation 2014-01-07 13:29:30 +01:00
Matthias Clasen
c3e91c7031 GtkHeaderBar: Fix positioning of pack-end widgets
This makes the positioning of pack-start and pack-end
widgets symmetric.
2014-01-06 23:37:18 -05:00
Matthias Clasen
c93182c416 Make testtitlebar more versatile
Test adding multiple custom widgets at each end. This exposes
that we're doing it wrong - the pack-end widgets are ordered
in the wrong way.
2014-01-06 23:37:05 -05:00
Baurzhan Muftakhidinov
6ac12df67f Update Kazakh translation 2014-01-07 08:33:22 +06:00
Matthias Clasen
ae4d82dc0c Avoid compiler warnings 2014-01-06 20:35:29 -05:00
Federico Mena Quintero
9538bc6221 filechooser: Document the settings XML 2014-01-06 17:16:16 -06:00
Matthias Clasen
2602372401 Be more careful when parsing gtk-decoration-layout
When the string is empty, breaking it at : will not give
us two tokens, and we were parsing garbage, leading to crash.
https://bugzilla.gnome.org/show_bug.cgi?id=721635
2014-01-06 17:07:21 -05:00
Ryan Lortie
feedf46ddc quartz: implement gdk_window_set_shadow_width()
Use the information to allow dragging windows all the way to the top of
the screen (ie: allow the top shadow to go under the menubar).

https://bugzilla.gnome.org/show_bug.cgi?id=720374
2014-01-06 15:27:28 -05:00
Ryan Lortie
394fe4b57e quartz: fix manual window move
We need to have gdk skip standard processing of events when we are in
manual move in addition to manual resize.

https://bugzilla.gnome.org/show_bug.cgi?id=720357
2014-01-06 15:27:28 -05:00