Commit Graph

163 Commits

Author SHA1 Message Date
Piotr Drąg
60ec788489 Fix minor typos 2013-08-21 04:15:52 +02: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
80513aa2c7 GtkBox: don't propagate the expand child property
The intention of the expand widget flags was to in fact propagate
legacy expand child properties as well. Due to implementation errors,
this was only happening in some cases, but not in others. To avoid
breaking old code assuming traditional expand flag behavior, this
commit removes all attempts to propagate GtkBox::expand.

This was discussed in
https://bugzilla.gnome.org/show_bug.cgi?id=698656 and
https://bugzilla.gnome.org/show_bug.cgi?id=628902

This patch was written by Tristan Van Berkom.
2013-05-25 14:46:09 -04:00
Benjamin Otte
6146bf7a32 gtkprivate: #define OPPOSITE_ORIENTATION
and use it
2013-05-01 16:41:11 +02:00
Alexander Larsson
43f1ac2b8f GtkBox: Add missing Since in docs 2013-04-23 05:58:08 +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
Cosimo Cecchi
61344219d4 Revert "box: Don't special-case RTL hbox child positions anymore"
This reverts commit 6f86e57c4f.

https://bugzilla.gnome.org/show_bug.cgi?id=694451
2013-02-23 14:53:24 -05:00
Benjamin Otte
6f86e57c4f box: Don't special-case RTL hbox child positions anymore
If you want to get rounded corners on an hbox, instead of
  :first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
  }
  :last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
you now need to write:
  :first-child, :last-child:dir(rtl) {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
  }
  :last-child, :first-child:dir(rtl) {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
2012-12-18 18:25:42 +01:00
Matthias Clasen
ffa42cb5bb Nuke GtkBoxAccessible
It didn't contain anything useful.
2012-11-07 20:17:30 -05:00
Stefano Facchini
fb18145c06 box: Fix typo
https://bugzilla.gnome.org/show_bug.cgi?id=683718
2012-09-11 21:40:46 +02:00
Cosimo Cecchi
f900df6f01 box: set orientation style classes when setting orientation
Since we override the property, we have to call the internal helper
manually.
2012-05-11 11:46:59 -04:00
Benjamin Otte
33f111a47c widget: Don't cache widget paths all the time
Add an internal API that allows GtkStyleContext to create a widget path
for the widget and with that bypassing gtk_widget_get_path() and that
  function caching the path.
2012-04-17 08:59:21 +02:00
Benjamin Otte
ece9d2fd92 gtk: Make widget only invalidate widget positions
Instead of resetting them completely
2012-04-17 08:59:10 +02:00
Benjamin Otte
461803e407 gtk: Get gtkwidgetpath.h includes out of the public headers
and include them in the C files instead.
2012-03-19 02:26:16 +01:00
Lionel Landwerlin
adf36e28d2 gtkbox: avoid warning when removing a widget with refcount of 1
If gtkbox is the only object having a reference on one of its child
and that we try to remove it from its container, we endup having a
warning when disconnecting a signal after having unparented the
widget.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=670176
2012-03-18 15:41:07 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Javier Jardón
8985ce3b72 gtkbox: Move private functions to private header 2011-10-02 21:30:42 +01:00
Javier Jardón
b0a7db76fb Replace some references to the GtkTable, use GtkGrid instead 2011-09-29 12:38:49 +01: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
Matthias Clasen
896769df69 Convert GailExpander to GtkExpanderAccessible
At the same time, drop the AtkText implementation.
Also, reintroduce a GtkBoxAccessible, since the previous
way of setting the role in get_accessible was affecting
GtkBox subclasses negatively.

Adjust expected test output to match.
2011-07-05 16:08:57 -04:00
Matthias Clasen
8bb24a936f Don't overwrite roles
Otherwise, every GtkBox subclass will have to override
get_accessible just to keep their roles.
2011-07-05 16:08:56 -04:00
Matthias Clasen
1ef996ca3c Remove GailBox
It was only setting a role, and we can do that just as well
in get_accessible().
2011-07-05 16:08:53 -04:00
Benjamin Otte
246a7ecbc9 box: Remove cache for sibling paths
We can't cache this path as widgets might dynamically add or remove
style classes without telling us. At which point the stored path does
not work.
2011-07-02 01:40:16 +02:00
Cosimo Cecchi
ef153a5fff box: follow children visibility when building the sibling path
This fixes nth-child not working for widgets which were not
visible before being added to the box, but it's also a better fix
for https://bugzilla.gnome.org/show_bug.cgi?id=652769
2011-07-01 11:48:22 -04:00
Cosimo Cecchi
e731caf8d0 Revert "gtkbox: Invalidate order on changes, even if the child is not visible"
This reverts commit 8cb0cc58e3.
2011-07-01 11:47:41 -04:00
Vincent Untz
8cb0cc58e3 gtkbox: Invalidate order on changes, even if the child is not visible
When we build the sibling path for the order, we do not skip hidden
children (since, quoting the comment, "we cannot reliably detect changes
in widget visibility"). So we need to invalidate the order when hidden
children are reordered and removed.

https://bugzilla.gnome.org/show_bug.cgi?id=652769
2011-06-30 09:11:28 +02:00
Matthias Clasen
9bb5077b90 GtkBox: don't reset styles too often 2011-06-16 22:15:50 -04:00
Matthias Clasen
2204405c9c Expand migration hints for h/v boxes 2011-06-10 17:40:16 -04:00
Murray Cumming
151bcc6dfa Box, etc: Improve docs after H* and V* deprecations.
Stop documenting the base class as just a base class for the
H and V specializations, copying the useful descriptions from
those H/V classes to the base class. Do not advise the use of
the H/V classes or refer to them unnecessarily.
2011-06-10 09:50:45 +02:00
Benjamin Otte
2bc0fca209 box: Add RTL support for sibling paths
We want the reverse path when the box is right-to-left.
2011-06-02 02:03:51 +02:00
Benjamin Otte
cd838480eb box: Add support for siblings in widget paths of box children 2011-06-02 02:03:51 +02:00
Benjamin Otte
bc9c43c1cb box: Only emit pack-type notify if the pack type really changed
This is not very useful in itself, but the code reorg will be useful
once we do style invalidation.
2011-06-02 02:03:51 +02:00
Matthias Clasen
6ca6691966 GtkBoxPrivate: Improve struct packing 2011-04-12 12:24:56 -04:00
Tristan Van Berkom
887142f1f5 Added GTK_SIZE_REQUEST_CONSTANT_SIZE to GtkSizeRequestMode
The constant size request mode defines a request mode where
height-for-width geometry is unneeded, thus optimizing GTK+
by reducing the overall amount of requests that need to be
performed and cached while resizing an interface.
2011-03-25 18:42:07 +09:00
Matthias Clasen
e2ba86289f Only count visible children during size request
This was causing spacing between image and label to be requested
in buttons, even though the image is invisible.
2011-03-05 23:27:26 -05:00
Matthias Clasen
fb860a9527 Add a note to ::fill and ::expand docs 2011-01-31 10:26:28 -05:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Matthias Clasen
16877b4d7b Reduce includes of gtktypeutils.h to a minimum 2011-01-04 12:05:05 -05:00
Tristan Van Berkom
eb5a500495 Changing GtkBox:fill child property default back to TRUE.
Since Havoc's patches introducing the GtkWidget halign/valign
properties, fill should always be TRUE. If the widget should
not fill its allocated space then it should set the halign or
valign properties for that purpose.

This also consequently fixes bug 634592.
2010-11-25 14:37:02 +09:00
Murray Cumming
764f627733 Fix tiny documetnation typo. 2010-11-02 10:43:42 +01:00
Michael Natterer
3a0afce509 gtk: remove "gboolean homogeneous" from gtk_box_new()
Because it's FALSE in virtually all use cases.
2010-10-31 19:22:28 +01:00
Javier Jardón
73bac5af3b Emphasize that GtkBox and GtkTable can be replaced by GtkGrid 2010-10-30 06:53:44 +02:00
Matthias Clasen
c750003168 Point to GtkGrid from the GtkBox and GtkTable docs 2010-10-22 19:59:29 +02:00
Matthias Clasen
a7465c3479 Fix a typo 2010-10-22 16:42:50 +02:00
Matthias Clasen
56e797397b Improve GtkBox and GtkTable docs a bit
This adds some details gleaned from the tutorial, before its
impending demise.
2010-10-15 10:58:35 -04:00
Havoc Pennington
8abb18f910 Support GtkWidget expand properties in GtkBox
This consists of:
* expand a child if either child->expand || gtk_widget_get_expand(child)
* override compute_expand so that child->expand will cause us to
  return TRUE for gtk_widget_get_expand()

https://bugzilla.gnome.org/show_bug.cgi?id=628902
2010-10-13 10:49:06 -04:00
Matthias Clasen
f53ad33994 Remove GtkObject completely 2010-09-26 22:18:19 -04:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Matthias Clasen
8204fe6036 GtkBox: let GtkContainer handle border width 2010-09-13 18:47:58 -04:00
Javier Jardón
1e5d7c0225 Use GtkFooPrivate instead GtkFooPriv 2010-08-27 04:48:23 +02:00