Commit Graph

1353 Commits

Author SHA1 Message Date
Ryan Lortie
ab5fb5dee5 GtkApplication rewrite 2010-10-19 01:31:09 +02:00
Christian Dywan
6db62c6617 Use new GtkComboBoxEntry in all tests 2010-10-18 09:13:44 +02:00
Tristan Van Berkom
31abdf723a Allow GtkComboBox popup to be wider than the combo itself.
This patch adds a GtkComboBox:popup-fixed-width to decide if the
popup's width should be a fixed width matching the combo's allocated width.

The patch includes a kindof hack to work around treeviews currently
not supporting height-for-width geometry (for list-mode only), this
hack can be safely removed once treeviews start reporting natural
widths properly.
2010-10-17 14:11:27 +09:00
Javier Jardón
e7f51ef6a4 Use the new GtkComboBoxText API
Also remove mentions of the old text convenience API from the docs,
and point to GtkComboBoxText instead.
2010-10-15 16:58:27 -04:00
Michael Natterer
9d9742f1e5 Bug 631599 - Allow to use arbitrary surfaces for offscreen windows
Add signal GdkWindow::create-surface which allows to use any
surface type as storage for offscreen windows.

Test the new signal in tests/gdkoffscreenbox.c
2010-10-14 13:25:23 +02:00
Tristan Van Berkom
9612c64817 Deprecate GtkComboBoxEntry in favor of added properties to GtkComboBox
GtkComboBox now sports a construct-only "has-entry" property which
decides if it uses a GtkEntry to allow additional user input. Also
it has a new "entry-text-column" to fetch strings for the entry
from the model.

This patch deprecates the GtkComboBoxEntry and updates the rest of GTK+
to use the new semantics on GtkComboBox instead.

GtkComboBoxEntry will be removed altogether before GTK+ 3, in a
later commit.
2010-10-13 21:52:27 -04:00
Matthias Clasen
29ce9e679a Add a GtkTable testcase 2010-10-13 10:49:06 -04:00
Havoc Pennington
7597a35477 add tests/testexpand.c used to test the expand props on GtkWidget
There are two colored boxes with toggle buttons nested
inside several GtkBox. Toggling these to expand mode
should automatically propagate expansion up through
the several GtkBox such that resizing the window
results in resizing the colored boxes.

https://bugzilla.gnome.org/show_bug.cgi?id=628902
2010-10-13 10:49:04 -04:00
Tristan Van Berkom
e3cc39cb98 Removed all traces of GtkWrapBox from GTK+. 2010-10-13 22:26:44 +09:00
Owen W. Taylor
a4a7a611f2 GtkWindow: Allow setting size from geometry
If you set a geometry widget via gtk_window_set_geometry_hints() it
becomes very hard to compute appropriate toplevel sizes in pixels
to make the window a particular size. Synthesizing strings and passing
them to gtk_window_parse_geometry() is possible, but to avoid
avoid such ugliness, add functions:

 gtk_window_set_default_geometry()
 gtk_window_resize_to_geometry()

That act like gtk_window_set_default_size() and
gtk_window_resize() but are in terms of the resize increments of the
geometry widget.

https://bugzilla.gnome.org/show_bug.cgi?id=631796
2010-10-11 14:06:16 -04:00
Owen W. Taylor
88cf547029 Fix handling of the geometry widget
The geometry widget feature of gtk_window_set_geometry_hints() has
never really worked right because the calculation that GTK+ did to
compute the base size of the window only worked when the geometry
widget had a larger minimum size than anything else in the window.

Setup:
* Move the GtkSizeGroup private functions to a new private header
  gtksizegroup-private.h
* Add the possibilty to pass flags to _gtk_size_group_queue_resize(),
  with the flag GTK_QUEUE_RESIZE_INVALIDATE_ONLY to suppress adding
  the widget's toplevel to the resize queue.
* _gtk_container_resize_invalidate() is added to implement that feature
* _gtk_widget_override_size_request()/_gtk_widget_restore_size_request()
  allow temporarily forcing a large minimum size on the geometry
  widget without creating resize loops.

GtkWindow:
* Compute the extra width/height around the geometry widget
  correctly; print a warning if the computation fails.
* Always make the minimum size at least the natural minimum
  size of the toplevel; GTK+ now fails badly with underallocation.
* Always set the base size hint; we were failing to set it
  properly when the specified minimum size was overriden, but
  it's harmless to always set it.

Tests:
* New test 'testgeometry' that replaces the 'gridded geometry' test
  from testgtk. The new test is roughly similar but creates a bunch
  of windows showing different possibilities.
* The testgtk test is removed. No need to have both.

https://bugzilla.gnome.org/show_bug.cgi?id=68668
2010-10-11 14:05:29 -04:00
Cody Russell
fe9a45c413 Remove uses of gtk_statusbar_set_has_resize_grip()
This function is going away.
2010-10-08 02:14:19 -04:00
Benjamin Otte
2a1650843d Revert "testgtk: Remove snapshot test"
This reverts commit 99c82af20a and fixes
up things to compile again. Of course, the snapshotting now uses
gtk_widget_draw() instead.
2010-10-05 23:22:55 +02:00
Michael Natterer
a472d1a400 tests: don't call gtk_widget_get_allocation() on NULL children 2010-10-05 13:05:56 +02:00
Javier Jardón
e141bd3287 testtext: Use gtk_widget_destroy() instead gtk_object_destroy() 2010-09-29 05:58:02 +02:00
Javier Jardón
b072ea220c Remove unneded casts
As gtk_adjustment_new() returns a GtkAdjustment* now

https://bugzilla.gnome.org/show_bug.cgi?id=630731
2010-09-29 01:18:10 +02:00
Javier Jardón
42f480a537 gtk_adjustment_new() should return a GtkAdjustment*
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=630731
2010-09-29 01:18:10 +02:00
Benjamin Otte
bf81be51eb testgtk: Use gtk_widget_set_visual() 2010-09-28 19:11:46 +02:00
Tristan Van Berkom
7047502d84 Fix erroneous usage of height-for-width apis in gtk_widget_real_adjust_size_allocation().
When fitting a widget into its allocation, the second dimension
is always dependent on the first, so gtk_widget_get_preferred_size()
cannot be used directly (because we want the natural height for
the allocated width, not the natural height for the natural width,
which is generally a smaller height than the height-for-minimum-width
or height-for-allocated-width).

Added test to testadjustsize to ensure proper behaviour.
2010-09-27 21:15:16 +09:00
Tristan Van Berkom
e4a0a39a56 Fixing tests/ build for removal of GtkObject type. 2010-09-27 15:10:23 +09:00
Matthias Clasen
f53ad33994 Remove GtkObject completely 2010-09-26 22:18:19 -04:00
Javier Jardón
3b8184cfee Move classes that currently derive from GtkObject to GInitiallyUnowned 2010-09-26 22:18:13 -04:00
Benjamin Otte
f15860fb31 tests: Port testadjustsize to draw vfunc 2010-09-27 00:50:14 +02: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
Benjamin Otte
aa70d351c4 tests: Get rid of gdk_drawable_get_size() usage in testwindows 2010-09-26 15:11:45 +02:00
Benjamin Otte
cdba1f6519 tests: Get rid of gdk_drawable_get_size() usage in offscreenbox 2010-09-26 15:11:45 +02:00
Benjamin Otte
15497825c0 testgtk: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00
Benjamin Otte
45836db7a5 test: Port offscreen test to draw vfunc 2010-09-26 15:11:42 +02:00
Benjamin Otte
e194bc14fd testgtk: Use draw signal in layout test 2010-09-26 15:11:42 +02:00
Benjamin Otte
5442f5b9f2 testgtk: Use draw signal in scrolling test 2010-09-26 15:11:42 +02:00
Benjamin Otte
0ab6956579 testgtk: Use draw signal in cursors example 2010-09-26 15:11:41 +02:00
Benjamin Otte
87940287aa testgtk: Remove non-existing property from frame constructor 2010-09-26 15:11:41 +02:00
Benjamin Otte
38c932ace6 testgtk: Use draw signal in gridded geometry example 2010-09-26 15:11:41 +02:00
Benjamin Otte
c42f6ff4bf testgtk: Make big windows test not use expose events
Instead, use gdk_window_set_background().
2010-09-26 15:11:41 +02:00
Benjamin Otte
e1571a5936 testgtk: Use draw signal in resize grips example 2010-09-26 15:11:41 +02:00
Benjamin Otte
ba21d3e687 tests: Use draw vfunc in print-editor 2010-09-26 15:11:41 +02:00
Benjamin Otte
e65b1cfd76 testoffscreen: Connect to draw signal 2010-09-26 15:11:41 +02:00
Benjamin Otte
9cd83da6dc tests: Use draw signal in testinput 2010-09-26 15:11:41 +02:00
Benjamin Otte
c6f28c3dbc testtooltips: Connect to draw signal 2010-09-26 15:11:41 +02:00
Benjamin Otte
07d0c0b921 testtooltips: Don't call gdk_window_get_pointer() in expose events 2010-09-26 15:11:41 +02:00
Benjamin Otte
b8ebcdd0e0 testgtk: Connect to draw signal in "rotated text" example 2010-09-26 15:11:41 +02:00
Benjamin Otte
7af767333e testgtk: Connect to draw signals in "composited window" example 2010-09-26 15:11:41 +02:00
Benjamin Otte
ec604d11ec testgtk: Connect to draw signal in alpha test
Test still behaves weird, no idea why though.
2010-09-26 15:11:41 +02:00
Benjamin Otte
dfd0ceab1c tests: Connect to draw signal in testimage 2010-09-26 15:11:40 +02:00
Benjamin Otte
f8b420783d tests: Connect to draw signal in testoffscreenwindow 2010-09-26 15:11:40 +02:00
Benjamin Otte
0ad2f57332 tests: Connect to draw signal in testellipsise
The test seems broken, not sure why.
2010-09-26 15:11:40 +02:00
Benjamin Otte
9c980372d2 testcairo: Connect to draw signal 2010-09-26 15:11:40 +02:00
Benjamin Otte
c85f91e14c tests: Remove ability to set backend from testfilechooser
There's no backends anymore
2010-09-26 15:11:35 +02:00
Benjamin Otte
fc52c9daf3 testgtk: Check visual, not colormap for RGBA availability 2010-09-26 15:11:32 +02:00