Commit Graph

18392 Commits

Author SHA1 Message Date
David King
402985077b docs: Add (inout) to requisition of gtk_menu_item_toggle_size_request()
https://bugzilla.gnome.org/show_bug.cgi?id=675571
2013-04-29 07:18:54 +01: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
Matthias Clasen
13858fde29 GtkGrid: Undo a size allocation tweak
Revert 5e1a06d1b1

This change caused empty rows to 'open up', which was not
intended and causes problems as seen in bug 698660.
2013-04-28 18:46:41 -04:00
Matthias Clasen
1f17efb81c Add some tests for GtkWindow
These tests may have some assumptions on reasonable window manager
behaviour.  For now, we just test that the default size of the
window ends up as the allocated size of the content. This test
currently fails with client-side decorations, because we are
not properly discriminating between overall window size and
content size.
2013-04-27 13:41:17 -04:00
Paolo Borelli
d35596fe92 GtkImage: do not leak metrics in baseline align
https://bugzilla.gnome.org/show_bug.cgi?id=699020
2013-04-27 13:59:29 +02:00
Rico Tzschichholz
b957e16695 gtk: Add COMPOSITE_TEMPLATES to EXTRA_DIST 2013-04-26 09:25:44 +02:00
Matthias Clasen
8dc090b9b1 GtkStack: improve docs 2013-04-24 22:07:09 -04:00
Matthias Clasen
a8a41b52ad GtkStackSwitcher: unset tooltip
It was pointed out to me that we leave the tooltip behind
when setting and unsetting an icon.
2013-04-24 20:10:05 -04:00
Matthias Clasen
af49dd33cf GtkNotebook: Consistent boolean handling
Normalize boolean parameters in gtk_notebook_set_tab_reorderable and
gtk_notebook_set_tab_detachable before comparing them. Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=697196
2013-04-24 19:58:22 -04:00
Cosimo Cecchi
06c8e8fa43 docs: fix some typos in newly introduced methods 2013-04-24 13:10:54 -04:00
Benjamin Otte
174664b235 overlay: Silence gcc warnings 2013-04-23 14:13:51 -04:00
Owen W. Taylor
0032b2dc5a GtkSpinButton: don't constantly recreate style contexts for buttons
Cache the style contexts for the up and down panels, instead of recreating
them each time they are drawn or size requested. GtkSpinButtons were
many times slower to draw than other widgets because of the constant
style matching.

https://bugzilla.gnome.org/show_bug.cgi?id=698682
2013-04-23 14:04:39 -04:00
Federico Mena Quintero
d9b9ba5da0 Merge branch 'places-sidebar' 2013-04-23 13:58:09 -04:00
Alexander Larsson
316d450421 Handle non-baseline supporting subclasses overriding baseline supporting classes
If a subclass (say a child of GtkButton) overrides the non-baseline
size request methods we need to call these, rather than the new
get_height_and_baseline_for_width method.

In order to handle this we make the default for this method to be
NULL, and instead check at runtime which method to call. If any
non-baseline vfunc has changed in a class but the baseline one
hasn't, then we can't use the baseline one.
2013-04-23 05:58:48 +02:00
Alexander Larsson
e8d4bfd04b Add baseline alignment functions to gtk.symbols 2013-04-23 05:58:08 +02:00
Alexander Larsson
e253a414b0 GtkLabel: Minor cleanup
Make sure we always compare for a set baseline in the same way.
I.e. baseline != -1, never baseline >= 0.
2013-04-23 05:58:08 +02:00
Alexander Larsson
ac8817d34b GtkWidget: Add missing Since docs 2013-04-23 05:58:08 +02:00
Alexander Larsson
c630804647 GtkImage: Reuse previously calculated baseline_align in draw()
No need to recalculate this every time we draw.
2013-04-23 05:58:08 +02:00
Alexander Larsson
43f1ac2b8f GtkBox: Add missing Since in docs 2013-04-23 05:58:08 +02:00
Alexander Larsson
ebbc7791dd GtkGrid: Add missing Since docs 2013-04-23 05:58:07 +02:00
Alexander Larsson
f354cef61b GtkDialog: Baseline align buttons in action area 2013-04-23 05:58:07 +02:00
Alexander Larsson
8fbd6e2edc GtkEventBox: Support baseline alignment
This allows baselines to propagate from the child of the eventbox.
2013-04-23 05:58:07 +02:00
Alexander Larsson
e64c1f8929 GtkButtonBox: Support baseline alignment 2013-04-23 05:58:07 +02:00
Alexander Larsson
1df8d18ad2 GtkCheckButton and GtkRadioButton: Implement baseline alignment 2013-04-23 05:58:07 +02:00
Alexander Larsson
433c0c2134 GtkSpinButton: Support baseline alignment 2013-04-23 05:58:07 +02:00
Alexander Larsson
627685e2a2 GtkGrid: Support baseline alignment in GtkGrid
We support a local baseline in each row, as well as selecting
a specific row for the global baseline of the entire GtkGrid.
2013-04-23 05:58:07 +02:00
Alexander Larsson
72cd8b4dab GtkEntry: Support baselines 2013-04-23 05:58:06 +02:00
Alexander Larsson
d6684b5748 GtkButton: Add baseline align support 2013-04-23 05:58:06 +02:00
Alexander Larsson
7523b25942 GtkImage: Support baselines
This uses the current font metrics to guess the baseline of the image.
Without this any non-centered baseline in buttons with images look weird.
2013-04-23 05:50:38 +02:00
Alexander Larsson
6acc8c0817 GtkAlignment: Support baselines
We now report any baselines from the child, and allocate it.
Also, in the case of a baselign aligned child we ignore yscale/yalign
as that is not supportable.
2013-04-23 05:50:38 +02:00
Alexander Larsson
9a42942afb GtkBox: Add baseline alignment for horizontal boxes
Report a baseline based height and baseline whenever there
are children with ALIGN_BASELINE.

Assign baseline to childen in size_allocate. Either the one inherited
from the parent if set, or otherwise calculate one based on any
ALIGN_BASELINE children.
2013-04-23 05:50:38 +02:00
Alexander Larsson
1e1cf89e4f GtkLabel: Support baseline
Report the baseline in get_preferred_height_and_baseline_for_width().
2013-04-23 05:50:37 +02:00
Alexander Larsson
5ad618cb95 GtkSizeRequestCache: Don't store baselines in horizontal case
This saves memory for every widget (maximum 48 bytes per widget) at
a cost of a few duplicated codepaths in the size request cache.
2013-04-23 05:50:37 +02:00
Alexander Larsson
77e0f18eda Add GTK_DEBUG=baselines support
This draws red lines to show where the baselines are
2013-04-23 05:50:37 +02: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
Alexander Larsson
f15bc7818e Add GTK_ALIGN_BASELINE to GtkAlign
Setting this means baseline aware containers should align the widget
according to the baseline. For other containers this behaves like
FILL.

In order to not suprise old code with a new enum value we always
return _FILL for _BASELINE unless you specifically request it via
gtk_widget_get_valign_with_baseline().
2013-04-23 05:47:31 +02:00
John Ralls
655c781b6e Fix automake warning about CFLAGS etc. being user variables 2013-04-22 15:48:35 -07:00
Benjamin Otte
315261260c button: Implement height-for-width
https://bugzilla.gnome.org/show_bug.cgi?id=698433
2013-04-22 18:29:21 -04:00
Benjamin Otte
3450388ff0 sizerequest: Split out a common function 2013-04-22 18:29:01 -04:00
Cosimo Cecchi
009aadf378 window: remove unused code
We don't need to add these style classes.
2013-04-22 18:10:22 -04:00
Cosimo Cecchi
7bbbb01ff5 window: rework the CSD theming layer
Instead of having three different boxes and style classes, we can just
get away with the regular background box, plus a window-frame, which
contains the external frame, together with the window drop shadows.

GtkWindow now has special code to ensure the backing actual window is
allocated big enough to accomodate the shadows (using the shadow size
calculations introduced in the previous commit). We also use the margin
value to determine the size of the invisible borders (which can then be
different than the shadow).
2013-04-22 18:10:22 -04:00
Cosimo Cecchi
a44d6816d3 cssshadow: add a method to get the size of a shadows value
The method returns the size of each side of a GtkCssShadowsValue.
2013-04-22 18:10:21 -04:00
Cosimo Cecchi
7846bedebd window: factor out a gtk_window_get_maximized() function
Simplify code that does this same check over and over.
2013-04-22 18:10:21 -04:00
Cosimo Cecchi
87922575d3 window: remove title_border
We don't actually need this additional title border.
2013-04-22 18:10:21 -04:00
Federico Mena Quintero
0c1423d962 Remove GtkPlacesSidebar from our private Glade catalog
Now, Glade already knows about GtkPlacesSidebar AND MY MAD ICONS.
2013-04-22 17:00:08 -04:00
Ryan Lortie
ca0a18918c GtkModelMenuItem: add support for 'icon' attribute
Add support for icons on a GMenuModel.

https://bugzilla.gnome.org/show_bug.cgi?id=688820
2013-04-22 15:55:08 -04:00
Federico Mena Quintero
5322420145 Use friendlier property names for Glade 2013-04-22 15:46:59 -04:00
Matthias Clasen
15bba87e9a Add new symbols
Add the GtkRevealer functions to gtk.symbols
2013-04-22 12:42:39 -04:00
Matthias Clasen
8ff96b3bb2 Do rtl flipping for GtkRevealer transitions 2013-04-22 12:42:39 -04:00
Matthias Clasen
aec62e1c10 Add docs for GtkRevealer 2013-04-22 12:42:38 -04:00