Commit Graph

125 Commits

Author SHA1 Message Date
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
Javier Jardón
d9b459dd64 gtk/gtkbox.c: use accessor functions to access GtkWidget 2010-08-22 22:56:16 +02:00
Tristan Van Berkom
0cb7aa9c7b GtkBox: Clipped values passed to gtk_distribute_natural_allocation() incase allocated less than requested. 2010-08-18 20:01:27 -04:00
Tadej Borovšak
35105ab2b4 Fix improperly unwinded loops 2010-08-06 20:08:32 -04:00
Tadej Borovšak
651bed57a4 Implement fair extra space allocation 2010-08-06 17:28:07 -04:00
Tristan Van Berkom
95b3e63057 Migrated old loops to use gtk_distribute_allocation(). 2010-08-05 12:50:25 -04:00
Carlos Garcia Campos
76267f9d06 Add _gtk_box_get_children() internal function
https://bugzilla.gnome.org/show_bug.cgi?id=625300
2010-08-05 09:51:15 +02:00
Javier Jardón
6852137e13 Move GtkBoxChild from the public .h to gtkbox.c
https://bugzilla.gnome.org/show_bug.cgi?id=624397
2010-07-20 02:58:36 +02:00
Paolo Borelli
0754f2d72f Do not use GtkBoxChild in GtkButtonBox.
Do not store the is_secondary bit in the deprecated parent struct, use a
simple flag on the object instead. Fixes bug #624367.
2010-07-15 22:42:07 +02:00
Javier Jardón
3a10216dd0 Use accessor functions to acces GtkContainer 2010-07-13 19:40:46 +02:00
Javier Jardón
0677bb2785 gtkbox: Move public members to private structure 2010-07-13 19:40:45 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Tristan Van Berkom
edd57602b8 Mass api change from GtkExtendedLayout --> GtkSizeRequest
This commit makes a few massive changes to the extended layout
code:
  a.) gtkextendedlayout.c --> gtksizerequest.c
  b.) _is_height_for_width --> get_request_mode()
  c.) get_desired_size(), get_desired_width(), get_desired_height() -->
      get_size(), get_width(), get_height()

This is the first partial commit and only effects portions
of the tree that have already been merged in master (in order to
easily cherry pick this commit).

Conflicts:

	gtk/Makefile.am
	gtk/gtk.h
	gtk/gtk.symbols
	gtk/gtkextendedlayout.h
2010-06-18 00:11:26 -04:00
Tristan Van Berkom
1b2e9124f0 Fixed negative allocations from gtk_box_size_allocate()
Fixed the allocation loop to check if it was allocated at least
enough space to hold its visible children before going and distributing
extra space among children. Fixes bgo #617444.
2010-06-15 14:27:12 -04:00
Matthias Clasen
294f810021 Docmentation improvements
Don't mention removed _defaults functions in the docs, also try
to clarify the situation around fill and expand defaults.
2010-06-15 01:23:30 -04:00
Matthias Clasen
700196f71e Update documentation for orientables
Don't document these as abstract anymore, since they are now
instantiatable.
2010-06-03 01:18:42 -04:00
Matthias Clasen
654bb6ca66 Simple typo fix 2010-05-30 02:17:51 -04:00
Matthias Clasen
b4e2ff3da3 Make orientable base classes instantiable
This commit adds constructors for GtkPaned, GtkBox, GtkButtonBox,
GtkRuler, GtkScale, GtkScrollbar and GtkSeparator and makes these
types instantiable.
2010-05-25 18:55:15 -04:00
Christian Dywan
0d7d1ae8dc Remove deprecated functions from GtkBox 2010-05-03 01:39:49 +02:00
Javier Jardón
0d85671bc9 Fix some compilation warnings 2010-05-01 03:52:03 +02:00
Matthias Clasen
db76c77b81 Merge branch 'native-layout-incubator'
Conflicts:
	configure.in
	docs/reference/gtk/tmpl/gtkaction.sgml
	docs/reference/gtk/tmpl/gtkbuilder.sgml
	gdk/directfb/gdkkeys-directfb.c
	gdk/gdk.symbols
	gdk/x11/gdkwindow-x11.c
	gtk/gtkalignment.c
	gtk/gtkbox.c
	gtk/gtkbutton.c
	gtk/gtkcelleditable.c
	gtk/gtkfilechooser.c
	gtk/gtkframe.c
	gtk/gtkinvisible.c
	gtk/gtklabel.c
	gtk/gtkscrolledwindow.c
	gtk/gtksearchenginetracker.c
	gtk/gtktextview.c
	gtk/gtktoolbutton.c
	gtk/gtktooltip.c
	gtk/gtkviewport.c
	gtk/gtkwidget.c
	gtk/gtkwindow.c
	po-properties/ca@valencia.po
	po-properties/es.po
	po-properties/kn.po
	po-properties/mr.po
	po/ca.po
	po/ca@valencia.po
	po/el.po
	po/es.po
	po/gl.po
	po/id.po
	po/kn.po
	po/lv.po
	po/mr.po
	po/th.po
2010-04-30 17:56:50 -04:00
Tadej Borovšak
ef4e7b2473 Move documentation to inline comments: GtkBox
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=611742

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-28 18:41:33 +02:00
Matthias Clasen
f285ed1348 Treat h and v boxes the same way
...we've got the money!
2010-04-25 17:12:15 -04:00
Matthias Clasen
ff0eb03201 Fix a regression in RTL flipping
This was only showing up with pack-end packing in horizontal boxes.
The RTL flipping has to be applied after moving the reference point
to the left edge of the child.
2010-04-25 16:23:01 -04:00
Tristan Van Berkom
9306a73dfd Added documentation, implemented gtk_extended_layout_is_height_for_width() where needed. 2010-04-21 01:32:55 -04:00
Tristan Van Berkom
35cc52f418 Compute the collective heights for the width of a horizontal box.
Introduce an algorithm to allocate children some virtual widths based on
their base widths returned by ->get_desired_width(), then return the
collective desired heights for each or thier virtually allocated width.

This will only work in the horizontal orientation.
2010-04-18 18:09:40 -04:00
Tristan Van Berkom
d2c35ec62a Mega commit to change ->get_desired_size() for ->get_desired_width/height().
This commit changes gtk_extended_layout_get_desired_size() for
per dimension variants. Furthermore this commit reverts the actions
done in size-groups for now as it needs a different approach.

The natural width/height parameters added to aux_info have been changed
for a per width cache for heights and a per height cache for widths.

gtk-demo is still working, currently sizegroups are not taken
into account as mentioned above - size groups need to be alerted both
when the widths and heights are updated independantly and then that
information needs to repropagate also to other extended layout implementors.
2010-04-12 22:21:46 -04:00
Tristan Van Berkom
6b89f05a99 Implemented gtk_extended_layout_is_height_for_width() and added another guess algorithm
This patch adds another commented algorythm to find the collective
minimum and natural height for a said width of a horizontally oriented
box (or the opposite). The algorithm works quite well and can be optimized
a bit more - currently its commented because GtkLabel cannot effectively
do width-for-height calculations (doh).

Further, this patch returns an is_height_for_width() preference depending
on the boxes orientation (vertical boxes are width-for-height).
2010-04-10 22:39:11 -04:00
Tristan Van Berkom
1041a186c7 Added get_height_for_width/get_width_for_height implementation to GtkBox.
In order for natural size information to cascade correctly up through
the ancestry GtkBox needs to report height-for-width and width-for-height,
this patch includes an implementation for both in both orientations, one
of them is commented for now as its much too cpu intensive to actually use.
2010-04-09 21:50:33 -04:00
Tristan Van Berkom
7304e4227f Fixed gtk_box_size_allocate() for homogeneous boxes
gtk_box_size_allocate() was forgetting to fetch the minimum
size for children when allocating in homogeneous mode and then
accessing the uninitialized allocated values in that case, fixed.
2010-04-08 21:45:07 -04:00
Tristan Van Berkom
68c38e0ffd Fixed classes to call gtk_extended_layout_get_desired_size_again()
The previous patch removes the ambiguous gtk_widget_get_desired_size().
2010-04-06 02:55:07 -04:00
Tristan Van Berkom
24ed2f8aa1 Fixed 2 bugs in gtk_box_size_allocate()
This commit fixes the loop to take into consideration the
child->padding that will be allocated to the child while calculating
full available size. Additionally it fixes the initial positioning
of child widgets when packed at the end (a special case because the
x position used starts from the end of the box).
2010-04-05 18:01:56 -04:00
Tristan Van Berkom
ae2c0b02c3 Refixed merge conflicts for GTK_WIDGET_MAPPED/GTK_WIDGET_VISIBLE 2010-04-03 21:35:18 -04:00
Javier Jardón
e2f79c33ff Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_NO_WINDOW)
Use new API instead: gtk_widget_set_has_window ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:59:02 -04:00
Javier Jardón
edc65ce1d2 Deprecate widget flag: GTK_WIDGET_VISIBLE
Use gtk_widget_get_visible() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:58:20 -04:00
Javier Jardón
24bafd8693 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_NO_WINDOW)
Use new API instead: gtk_widget_set_has_window ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-06 11:37:06 +01:00
Javier Jardón
214a023e91 Deprecate widget flag: GTK_WIDGET_VISIBLE
Use gtk_widget_get_visible() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 07:52:07 +01:00
Johannes Schmid
24c1a4f24b native-layout: Fix typo that brakes layout completely 2009-12-14 17:16:21 +01:00
Johannes Schmid
9724366289 native-layout: Don't expose extra gtk_widget_* function that are similar to the GtkExtendedLayout interface 2009-12-14 16:28:56 +01:00