Commit Graph

1488 Commits

Author SHA1 Message Date
Cosimo Cecchi
232a5c7b3b app-chooser-button: change the API approach for custom items
Introduce a 'custom-item-activated' on the widget, which behaves
similairly to GtkEntryCompletion::action-activated, i.e. is emitted when
a custom item is chosen from the dropdown list.
Clients can use the name provided when adding the item as a detail for
the signal, to get notified when that specific item is activated, or use
the signal without details to get notifications for all custom items.
2010-11-29 16:04:59 +01:00
Emmanuele Bassi
0cd0e4091f Add GtkSwitch, a "light-switch" like widget
The GtkSwitch widget is a simple UI control that has two states: on and
off. Toggling between the states is possible by clicking the widget or
by dragging the handle.

https://bugzilla.gnome.org/show_bug.cgi?id=634987
2010-11-29 12:52:10 +00:00
Cosimo Cecchi
06f501fa07 app-chooser-button: rename GtkAppChooserComboBox -> GtkAppChooserButton 2010-11-29 12:19:18 +01:00
Tristan Van Berkom
c1cbc8790e Removed gtk_cell_area_context_sum_preferred_width/height apis.
Turns out theres not much reason to do this in a separate api,
now we just sum up the sizes of aligned cell groups in GtkCellAreaContextBox
when pushing the group size.
2010-11-29 10:55:50 +09:00
Tristan Van Berkom
5df7dab3cf Changed all the flush apis on GtkCellAreaContext for a single "reset" api. 2010-11-27 16:05:14 +09:00
Tristan Van Berkom
08cc318946 Fixed CellAreaScaffold for new gtk_cell_area_context_allocate() api. 2010-11-26 21:38:29 +09:00
Cosimo Cecchi
ef9543e978 tests: fix indentation 2010-11-25 17:32:13 +01:00
Cosimo Cecchi
67e842be87 app-chooser-combobox: add a method to trigger the GtkAppChooserDialog
It's an optional special item in the combobox, turned off by default.
2010-11-25 17:30:01 +01:00
Tristan Van Berkom
57a94bfb53 Merge branch 'master' into treeview-refactor 2010-11-25 15:07:47 +09:00
Matthias Clasen
a498d9a9ba Coding style fixups
This commit adjusts the app chooser code to GTK+ coding style:
- line up prototypes
- remove some excess {}
- remove tabs and trailing whitespace
- add docs
2010-11-24 18:32:05 -05:00
Matthias Clasen
f64448473e Coding style fixes 2010-11-24 16:50:00 -05:00
Matthias Clasen
964b684455 Improve packing in testappchooser 2010-11-24 16:47:15 -05:00
Cosimo Cecchi
183d75b812 app-chooser-combobox: make refresh properly work with custom items
The refresh implementation leaves the custom items in place, and just
refreshes the recommended applications.
2010-11-24 19:08:17 +01:00
Cosimo Cecchi
2a95707b4c app-chooser-combobox: add an initial implementation
GtkAppChooserCombobox is an implementation of GtkAppChooser inside a
combobox that shows recommended applications for a given content type.
2010-11-24 18:45:42 +01:00
Benjamin Otte
e0fb7a86e5 gtk: Remove GtkRuler
It is really bad code, mostly unused and no one stepped up to fix it.

Note that Gtk developers do not object to a ruler widget in priciple,
just to the current implementation. If someone wants to propose a sane
version, please don't hesitate.

https://bugzilla.gnome.org/show_bug.cgi?id=613942
2010-11-24 16:56:10 +01:00
Cosimo Cecchi
783b36398e tests: remove radio mode from the test 2010-11-24 15:50:08 +01:00
Michael Natterer
fb5dd9f72f Move all GdkDevice members to private and add one missing accessor 2010-11-23 20:25:13 +01:00
Cosimo Cecchi
05bb715c51 app-chooser: rename GtkOpenWith to GtkAppChooser 2010-11-23 17:50:15 +01:00
Cosimo Cecchi
44ef183fa1 tests: update to the new API 2010-11-23 16:53:22 +01:00
William Jon McCann
076e851c5f Add some window border to test open with 2010-11-23 16:51:40 +01:00
William Jon McCann
04452df476 Add a default file to open with test 2010-11-23 16:51:40 +01:00
Cosimo Cecchi
f8a6ac5429 tests: update to new API 2010-11-23 16:51:39 +01:00
Cosimo Cecchi
cf25ec8fa7 open-with: first attempt to split the dialog into a widget + interface
Like GtkFileChooser does; GtkOpenWith is a generic interface, which is
now implemented by both GtkOpenWithDialog and GtkOpenWithWidget (and in
the future also by GtkOpenWithComboBox).
2010-11-23 16:51:39 +01:00
Cosimo Cecchi
9d6055d0c8 tests: use new open with mode in the tests 2010-11-23 16:51:39 +01:00
Cosimo Cecchi
df8ccfb800 open-with: change the API to make it symmetric for GFile or content-type
It's much more convenient this way.
2010-11-23 16:51:39 +01:00
Cosimo Cecchi
3a6b936573 tests: rewrite the GtkOpenWithDialog test to make it more interactive
Now you can play with all the options provided by GtkOpenWithDialog API.
2010-11-23 16:51:39 +01:00
Cosimo Cecchi
be18ca45f0 open-with: initial implementation of GtkOpenWithDialog 2010-11-23 16:51:38 +01:00
Chris Kühl
fad1bc0de4 tests: Fixed argument naming inconsistancy 2010-11-23 10:49:44 +01:00
Tristan Van Berkom
d56babefb4 Removed cell margin apis and now deal with "focus-line-width". 2010-11-23 16:26:46 +09:00
Javier Jardón
f427d6998d gtkoffscreenbox.c: Replace size_request by get_preferred_width/height 2010-11-17 23:58:53 +01:00
Tristan Van Berkom
92dc7f31d4 Cleaned up cell editing api in GtkCellArea
Now layouting widgets need only concern themselves with
the "add-editable" and "remove-editable" signals, also added
lots of gtk-doc comments.
2010-11-14 23:33:26 +09:00
Tristan Van Berkom
1bca6349fb Mass rename GtkCellAreaIter --> GtkCellAreaContext 2010-11-13 16:23:01 +09:00
Tristan Van Berkom
e7c4ede64c Fixed some background area related bugs in CellAreaScaffold, cleanup testcellarea 2010-11-13 15:09:36 +09:00
Tristan Van Berkom
eda16a096d Fixed some errors in testcellarea testcases. 2010-11-12 23:09:57 +09:00
Tristan Van Berkom
51b75ef44b Added tests to reflect proper treatment of background area.
CellAreaScaffold now also reflects how cell_area should be
passed to gtk_cell_area_activate() and gtk_cell_area_event()
and how the background area for gtk_cell_area_renderer() should
be created.
2010-11-12 21:55:28 +09:00
Tristan Van Berkom
47d55c4a4b Added orientation control to testcellarea's focus/editing test 2010-11-12 19:44:45 +09:00
Tristan Van Berkom
38666b406f Ironed out the kinks in editing apis for GtkCellArea
- Added gtk_cell_area_aligned_cell_area() to get the aligned
   internal area use by a cell (for focus painting and for
   event areas).

 - Provide the event area in "editing-started" signal

 - Fire "remove-editable" when editing is canceled by the user,
   an implementing layouting widget need only catch "editing-started"
   and "remove-editable" now.

 - CellAreaScaffold/testcellarea now edit textrenderers.
2010-11-12 19:25:07 +09:00
Tristan Van Berkom
33db66e728 Added event handling to GtkCellAreaBox
Now GtkCellAreaBox handles the click event to activate renderers
and checks if the area is in a sibling of a focus renderer, possibly
activating the proper focus sibling renderer.

Also GtkCellArea gains a "focus-changed" signal to allow it to
change the currently focused row according to the button events.
2010-11-11 18:13:54 +09:00
Tristan Van Berkom
f330b40521 GtkCellArea now paints focus on cells
Added concept of "Focus Siblings" to GtkCellArea so that some
static text/icon may be included in the focus/click area of
an activatable or editable cell, implemented focus drawing
as well, updated testcellarea to reflect the changes.
2010-11-11 16:13:06 +09:00
Tristan Van Berkom
524110f902 Focus driving in GtkCellArea now works.
- Fixed focus driving in GtkCellArea with refined apis
 - Added gtk_cell_area_activate() to be called when the area has focus
   (to activate or start editing the focused cell)
 - Added support for this in cellareascaffold
 - testcellarea now watches the "toggled" signal for a toggle renderer
   and updates the model state accordingly, this currently works with
   keyboard navigation, however focus is still not painted on cells.
2010-11-10 22:25:13 +09:00
Tristan Van Berkom
4643d90c5f Committing new (and simplified) focus handling approach for GtkCellArea.
Also adding missing file cellareascaffold.h
2010-11-10 19:17:06 +09:00
Tristan Van Berkom
f85938a211 Changed testcellarea
Changed testcellarea to watch the iter for size changes and queue resizes
instead of explicitly queueing resizes when controls change.
2010-11-09 14:09:47 +09:00
Tristan Van Berkom
e03b280757 Adding expand/align controls to testcellarea. 2010-11-09 13:50:53 +09:00
Tristan Van Berkom
2a3ae8da3a Added orientation control on testcellarea test
shows vertical orientation of cells lined up horizontally instead
of horizontal orientation of cells stacked up vertically.
2010-11-09 13:23:12 +09:00
Tristan Van Berkom
85d6aa1627 Added test and scaffolding widget for GtkCellArea. 2010-11-09 01:26:38 +09:00
Matthias Clasen
e5c0d40d94 Make GtkFileChooserButton behave as expected when expanding 2010-11-08 11:31:03 +09:00
Cosimo Cecchi
99144330a0 tests: fix the build
gtk_box_new() changed API recently.
2010-11-08 11:31:01 +09:00
Cosimo Cecchi
c068e988a1 tests: add a test for pixbufs implementing the GIcon interface
https://bugzilla.gnome.org/show_bug.cgi?id=634060
2010-11-08 11:31:01 +09:00
Matthias Clasen
9dfeee8127 Make GtkFileChooserButton behave as expected when expanding 2010-11-07 11:22:07 -05:00
Cosimo Cecchi
c69075f170 tests: fix the build
gtk_box_new() changed API recently.
2010-11-05 17:01:34 +01:00
Cosimo Cecchi
fcfd494b78 tests: add a test for pixbufs implementing the GIcon interface
https://bugzilla.gnome.org/show_bug.cgi?id=634060
2010-11-05 16:28:32 +01:00
Michael Natterer
8979855f60 tests: missed these two gtk_box_new() which sneaked in by rebasing... 2010-11-02 12:04:35 +09:00
Michael Natterer
260ccdfebe gtk: remove "gboolean homogeneous" from gtk_box_new()
Because it's FALSE in virtually all use cases.
2010-11-02 12:04:35 +09:00
Matthias Clasen
c50f790417 Add content size test for scrolled window 2010-11-02 12:04:35 +09:00
Michael Natterer
240e1b4b59 tests: missed these two gtk_box_new() which sneaked in by rebasing... 2010-10-31 20:01:28 +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
Matthias Clasen
81d7dd0774 Add content size test for scrolled window 2010-10-31 14:10:41 -04:00
Javier Jardón
c15ef6405c Use gtk_box_new() instead gtk_[v|h]box_new() 2010-10-30 17:37:03 +09:00
Javier Jardón
6c301d4b0a Use gtk_scrollbar_new() instead gtk_[v|h]scrollbar_new() 2010-10-30 17:37:03 +09:00
Javier Jardón
234553c093 Use gtk_scale_new() instead gtk_[v|h]scale_new() 2010-10-30 17:37:03 +09:00
Javier Jardón
d03d2943d2 Use gtk_scale_new_with_range() instead gtk_[v|h]scale_new_with_range() 2010-10-30 17:37:03 +09:00
Javier Jardón
cdf4b4bbd5 Use gtk_paned_new() instead gtk_[v|h]paned_new() 2010-10-30 17:37:03 +09:00
Javier Jardón
524e704147 Use gtk_ruler_new() instead gtk_[v|h]ruler_new() 2010-10-30 17:37:02 +09:00
Javier Jardón
821c3c6578 Use gtk_separator_new() instead gtk_[v|h]separator_new() 2010-10-30 17:37:02 +09:00
Javier Jardón
2615ebf37e Use gtk_button_box_new() instead gtk_[v|h]_button_box_new() 2010-10-30 17:37:02 +09:00
Vincent Untz
e0d1652a99 Port tests to GtkScrollable API instead of deprecated GtkLayout API
https://bugzilla.gnome.org/show_bug.cgi?id=633374
2010-10-30 17:37:01 +09:00
Matthias Clasen
5e0451de3a Use correct icon name in testtoolbar 2010-10-30 17:35:20 +09:00
Javier Jardón
a9894d4cf4 Use gtk_box_new() instead gtk_[v|h]box_new() 2010-10-30 05:22:58 +02:00
Javier Jardón
570b90e218 Use gtk_scrollbar_new() instead gtk_[v|h]scrollbar_new() 2010-10-30 02:26:24 +02:00
Javier Jardón
217036975a Use gtk_scale_new() instead gtk_[v|h]scale_new() 2010-10-30 02:26:24 +02:00
Javier Jardón
8177ad320e Use gtk_scale_new_with_range() instead gtk_[v|h]scale_new_with_range() 2010-10-30 02:26:23 +02:00
Javier Jardón
b3a7d401a1 Use gtk_paned_new() instead gtk_[v|h]paned_new() 2010-10-30 02:26:23 +02:00
Javier Jardón
f00f120fd7 Use gtk_ruler_new() instead gtk_[v|h]ruler_new() 2010-10-30 02:26:23 +02:00
Javier Jardón
8d008790be Use gtk_separator_new() instead gtk_[v|h]separator_new() 2010-10-30 02:26:23 +02:00
Javier Jardón
e31304fb7b Use gtk_button_box_new() instead gtk_[v|h]_button_box_new() 2010-10-30 02:26:23 +02:00
Vincent Untz
4f9f52a6ea Port tests to GtkScrollable API instead of deprecated GtkLayout API
https://bugzilla.gnome.org/show_bug.cgi?id=633374
2010-10-28 12:18:28 -04:00
Matthias Clasen
cb34d4036d Use correct icon name in testtoolbar 2010-10-27 10:14:25 -04:00
Javier Jardón
49c409c498 tests: use accessor functions to access GtkToogleButton 2010-10-26 05:02:19 +02:00
Tristan Van Berkom
209715f0ef Missed adding the scrolled window test in previous commit, added scrolled window test. 2010-10-26 11:35:04 +09:00
Tristan Van Berkom
3fe0fb4ed9 Added GtkScrollablePolicy property to scrollable interface
This patch adds the GtkScrollablePolicy type property to GtkScrollable
and implements it in all subclasses. GtkScrolledWindow observes this
property to make a good guess about when to show/hide scrollbars for
height-for-width content.

Most scrollable children do not do height-for-width *yet* but
most certainly will (toolpalette, treeview, iconview, textview
widgets all TODO), for scrollable widgets that do have a minimum
and natural size, it's important for them to observe the state
of this property in order to properly drive the scroll adjustments
according to the desired GtkScrollablePolicy. This patch makes
GtkViewport do this.

Patch also adds tests/testscrolledwindow.c to display the effects
of this property.
2010-10-26 10:15:56 +09:00
Matthias Clasen
bcb23945f6 Bring back lost functionality
Double-click to mark/unmark was lost a while ago.

Also add easy RTL testing.
2010-10-24 14:43:04 -04:00
Alberto Garcia
d6a73fd5b0 Assign all g_signal_connect() and friends to gulong variables
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=87821
2010-10-22 18:58:47 +02:00
Tristan Van Berkom
d26ac6421b Fixed problems with combination of height-for-width apis and
alignment/margin vfuncs adjust_size_request/allocation

Now get_height_for_width() will internally update the for_width
before passing it to the real height_for_width() vfunc, allowing
margins and extra space for alignments to be stripped, thus requesting
sufficient height for greater than natural widths (and also accounting
for margins properly). Test case adjusted in testadjustsize to ensure
proper behavior.
2010-10-23 00:11:37 +09:00
Matthias Clasen
8f0ae8e8a3 Add GtkGrid
GtkGrid is a container similar to GtkTable, without legacy
properties and unnecessary restrictions.
It does height-for-width geometry management.
2010-10-22 16:42:50 +02:00
Michael Natterer
283f7ddd6c tests: gdk_device_get_history() takes "gint *n_events" again, not guint 2010-10-20 12:50:21 +02:00
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