Commit Graph

325 Commits

Author SHA1 Message Date
Matthias Clasen
ecfcb3e2cc Make gtk_container_remove work on popover menus
Extend the hack we have in place for composite containers to
GtkPopoverMenu.
2014-11-16 02:30:19 -05:00
Matthias Clasen
1f81c83fd8 Add GtkPopoverMenu
GtkPopoverMenu is a GtkPopover subclass that has a menu-like stack
built-in.
2014-10-29 06:49:58 -04:00
Matthias Clasen
aa3020a39e GtkContainer: Support focus chain in GtkBuilder
This adds support for a <focus-chain> element which can be
used to specify a custom focus order for the children of
a container.

https://bugzilla.gnome.org/show_bug.cgi?id=582799
2014-09-29 23:59:21 -04:00
Sébastien Wilmet
c104c64436 Better mark GtkAlignment as deprecated
- Move the class to the Deprecated section.
- Warning at the bottom of the class description.
- A missing property was not marked as deprecated.
- Update doc of gtk_container_set_border_width() to not mention
  GtkAlignment.

https://bugzilla.gnome.org/show_bug.cgi?id=736622
2014-09-17 15:02:50 +02:00
Matthias Clasen
327b097725 Trivial: Use g_clear_object more
It no longer has atomic overhead, so we can use it everywhere.
2014-08-09 10:16:27 +02:00
Matthias Clasen
ac2329b842 Mark GtkContainer::resize-mode as deprecated
The setter was deprecated a while ago, do the same for the property.
2014-06-09 13:39:38 -04:00
Matthias Clasen
d6cae074a6 GtkContainer: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:30:54 -04:00
Evan Nemerson
54ec42f035 gtk: port many nullability annotation fixes from Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-30 13:24:20 -07:00
Matthias Clasen
7bf3d9d0ab Fix doc syntax
End-of-comment tags don't take an @ - thats only for parameters.
2014-05-19 06:58:18 -04:00
Benjamin Otte
f191c13a27 API: Deprecate gtk_container_set_reallocate_redraws() 2014-05-18 16:09:21 +02:00
Matthias Clasen
02cd5737f6 Don't let themes override explicit border-width in dialogs
This fixes an issue where the theme-provided border-width prevents
dialog contents from lining up properly with the headerbar. To make
this work in message dialogs, we have to explicitly set the border-
width of the action area to 0.
2014-03-24 10:26:31 -04:00
Matthias Clasen
7da97a3642 Revert "Don't let themes override explicit border-width in dialogs"
This reverts commit 6e4567e73b.

For some reason, this causes buttons in message dialogs to have an
unwanted border.
2014-03-24 08:38:59 -04:00
Matthias Clasen
6e4567e73b Don't let themes override explicit border-width in dialogs
This fixes an issue where the theme-provided border-width prevents
dialog contents from lining up properly with the headerbar.
2014-03-21 15:41:13 -04:00
Benjamin Otte
38d1999f7b container: guard container variable by reffing it
vte destroys the container during removal of a child. Don't crash in
that case due to recent a11y refactoring.

https://bugzilla.gnome.org/show_bug.cgi?id=726369
2014-03-19 13:23:38 +01:00
Benjamin Otte
66fae0330c a11y: Don't use signals
Instead, call functions directly. Fixes the fact that the signals
weren't disconnected even when the accessible was destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=725733
2014-03-13 02:02:50 +01:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
37a8ee6e95 docs: fully break lines in examples
Try to do a better job of keeping example content
from being too wide. It is often rendered as <pre>
text so the only time we can wrap it is in the source.

It is best to full break lines at all punctuation and
to try to keep the width under 70 chars or so.
2014-02-12 18:42:50 -05:00
William Jon McCann
d0a654e4b9 Add new ActionBar
https://bugzilla.gnome.org/show_bug.cgi?id=723929
2014-02-12 08:08:03 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
William Jon McCann
fa3f1e1488 docs: use apostrophe in *'ve 2014-02-07 13:38:26 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
0ce016650b docs: Use markup for links 2014-02-07 09:42:12 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
William Jon McCann
3b3d8ca456 docs: Use "#" for refsect2 instead of ## 2014-02-04 21:00:58 -05:00
Matthias Clasen
09d1b28249 docs: Convert to markdown
Specifically, switch to using markdown syntax for sections.
2014-02-02 00:30:27 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
2d003553e8 docs: don't use <emphasis>
It is a little heavy handed. The text can speak for itself.
2014-01-28 02:02:05 -05:00
William Jon McCann
bf35c77f14 docs: use () instead of <function> tags 2014-01-27 23:08:08 -05:00
William Jon McCann
84dca6cc86 docs: don't try to link vfuncs 2014-01-21 18:57:39 -05:00
Volker Sobek
a4d69e7f14 docs/comments: Fix spelling of 'explicitly'
This replaces all occurrences of 'explicitely' with 'explicitly'. Only
code comments and gtk-doc statements are affected.

https://bugzilla.gnome.org/show_bug.cgi?id=722429
2014-01-18 03:47:46 +01:00
Jasper St. Pierre
ddb4034e8e Fix GI warnings 2013-10-09 14:19:54 -04:00
Benjamin Otte
67260eec22 container: Deprecate resize mode
Resize modes don't work anymore, both because nobody ever uses them and
because the frame clock changed the way things work quite a bit. So we
don't want to advertise them as a good idea.

https://bugzilla.gnome.org/show_bug.cgi?id=708787
2013-10-05 15:09:53 +02:00
Matthias Clasen
5abff7bd4c Improve gtk_container_add docs
Mention that some containers add intermediate children automatically.
2013-09-30 20:53:19 -04:00
Matthias Clasen
e5317f0f9a Improve struct packing in various places 2013-09-21 23:50:55 -04:00
Matthias Clasen
13f92834f7 Fix a regression in GtkAssistant child property handling
GtkAssistant is bending the rules about child properties
of non-direct children, and the recent fix to accomodate
GtkInfoBar changes broke things. The effect was that child
properties of assistant pages in ui files were just not
applied, so all pages ended up without titles and with
the normal page type, leading to broken assistants all
over the place.

https://bugzilla.gnome.org/show_bug.cgi?id=706756
2013-08-28 11:51:19 -04:00
Matthias Clasen
e6a8848d0c Be more forgiving about child properties
Packing properties in ui files are parsed and handled by
the container, which assumes that the child is a direct
descendant. For internal children, this is inconvenient,
because we don't want to reconstruct the entire internal
structure between the container and the child in the ui
file.

It would be best to not specify packing properties
in that case, but since existing ui files do this for
GtkInfoBar and we are about to change the internal
structure of GtkInfoBar, be more forgiving here.
2013-08-03 09:04:47 +02:00
Kjell Ahlstedt
16c08ae135 Fix some inconsistent deprecations
Some functions had only a deprecation comment in the .c file, or only a
deprecation annotation in the .h file. Add the missing parts.

https://bugzilla.gnome.org/show_bug.cgi?id=703616
2013-07-09 06:54:26 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Matthias Clasen
c0c752fab1 Cosmetics 2013-07-06 23:11:19 -04:00
Kalev Lember
a37450110b Fix string allocation handling with GtkBuilder translations
Use g_string_assign to avoid issues with assigning GString's internal
buffer back to the same string. This can happen when no translations are
available and _gtk_builder_parser_translate returns back the same
pointer that was passed in.

This fixes a regression from commit e9f182e37a
that caused GtkComboBoxText <items> from GtkBuilder to show up empty if
no translations are available.

https://bugzilla.gnome.org/show_bug.cgi?id=700629
2013-06-08 10:54:25 +02:00
Benjamin Otte
299714dd1a container: Don't use to-be-deprecated API
Instead, do what that API does manually.
2013-05-30 20:02:05 +02:00
Alexander Larsson
c3973e8468 GtkContainer: Propagate draws in GdkWindow order
Now that we're not drawing the GdkWindows by themeselves we need to
propagate into children in the same order as the windows were painted
otherwise apps can't rely on stacking order to overlay children.

This is still not 100% the same as the old behaviour, because we're
treating all windows that are part of a window at the same time (to allow
e.g. opacity groups), and we're only looking at order for the main
windows of a widget. However, this fixes at least the ordering
of the gnome-boxes fullscreen overlay toolbar.

https://bugzilla.gnome.org/show_bug.cgi?id=699970
2013-05-15 12:47:05 +02:00
Alexander Larsson
d22fd7223c Only handle exposes on native window, propagate to children via draw()
We now consider non-native windows non-opaque, which means any invalid
area in a subwindow will also be invalid all the way up to the nearest
native windows. We take advantage of this by ignoring all expose events
on non-native windows (which typically means just the toplevel) and instead
propagating down the draw() calls to children directly via
gtk_container_propagate_draw.

This is nice as it means we always draw widgets the same way, and it
will let us do some interesting ways in the future.

We also clean up the GtkWidget opacity handling as we can now always
rely on the draing happening via cairo.

We can't really just draw by walking down the widget hierarchy, as
this doesn't get the clipping right (so e.g. widgets doing cairo_paint
may draw outside the expected gdkwindow subarea) nor does it let
us paint window backgrounds.

So, we now do multiple draws for each widget, once for each GdkWindow,
although we still do it on the same base cairo_t that we get for the
toplevel native window. The difference is only the clipping, the rendering
order, and which other widgets we propagate into.

We also collect all the windows of a widget so we can expose them inside
the same opacity group if needed.

NOTE: This change neuters gtk_widget_set_double_buffered for
widgets without native windows. Its impossible to disable
the double buffering in this model.
2013-05-07 16:33:01 +02:00
Matthias Clasen
ed5ef04127 Fix setting child properties
This was broken in e9f182e37a
2013-05-03 22:29:20 -04:00
Matthias Clasen
e9f182e37a Fix a few memory leaks wrt to translations
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=699016
The fix here is slightly different. We make
_gtk_builder_parser_translate return a const char * instead of
a dup'ed string, and fix up the callers.
2013-04-28 21:43:49 -04:00
Alexander Larsson
852cbb62b8 Initial support for baselines
This modifies the size machinery in order to allow baseline support.

We add a new widget vfunc get_preferred_height_and_baseline_for_width
which queries the normal height_for_width (or non-for-width if width
is -1) and additionally returns optional (-1 means "no baseline")
baselines for the minimal and natural heights.

We also add a new gtk_widget_size_allocate_with_baseline() which
baseline-aware containers can use to allocate children with a specific
baseline, either one inherited from the parent, or one introduced due
to requested baseline alignment in the container
itself. size_allocate_with_baseline() works just like a normal size
allocation, except the baseline gets recorded so that the child can
access it via gtk_widget_get_allocated_baseline() when it aligns
itself.

There are also adjust_baseline_request/allocation similar to the
allocation adjustment, and we extend the size request cache to also
store the baselines.
2013-04-23 05:50:37 +02:00
Owen W. Taylor
ce835dee74 GtkContainer: fix disconnection from frame clock
We need to disconnect the frame clock when we unrealize (at which
point the old clock is still alive) not in destroy(). Since there
is no common unrealize for containers, trigger this from GtkWidget.
2013-02-14 17:19:53 -05:00
Owen W. Taylor
c4545cc5d4 GdkFrameClock: Make the phase explicit when requesting the frame
Instead of having gdk_frame_clock_request_frame() have
gdk_frame_clock_request_phase() where we can say what phase we need.
This allows us to know if we get a frame-request during layout whether
it's just a request for drawing from the layout, or whether another
layout phase is needed.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:48 -05:00