Commit Graph

411 Commits

Author SHA1 Message Date
Matthias Clasen
7371e3f7cf Convert GailComboBox to GtkComboBoxAccessible 2011-07-05 16:08:56 -04:00
Javier Jardón
bf0d8402f5 gtk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Matthias Clasen
b9a59c2ad6 Clean up more includes
Mainly removing unused h/v includes, but also adding some that
will be necessary as replacements.
2011-06-07 20:54:23 -04:00
Matthias Clasen
4cd9009c57 Trivial NULL vs 0 confusion 2011-06-01 00:05:06 -04:00
Javier Jardón
fb9e4c2c37 all: avoid boxed structs copying where possible (and 2)
Use the GtkStyleContext accessors for boxed properties where possible,
to reduce allocations.
2011-05-31 19:18:11 +02:00
Cosimo Cecchi
c8a59a6f92 all: avoid boxed structs copying where possible
Use the GtkStyleContext accessors for boxed properties where possible,
to reduce allocations.

https://bugzilla.gnome.org/show_bug.cgi?id=650420
2011-05-18 10:27:21 -04:00
Matthew Barnes
7ae4a06d1f GtkComboBox: Improve gtk_combo_box_set_active_id
- Passing a NULL ID string should be equivalent to
  gtk_combo_box_set_active (combo_box, -1).
- Use g_strcmp0() instead of strcmp() when comparing
  ID strings to avoid a crash when an ID is NULL.
- Return a boolean indicating if the ID was found or not.

https://bugzilla.gnome.org/show_bug.cgi?id=647806
2011-04-26 07:59:53 -04:00
Cosimo Cecchi
1263fdbd67 combobox: always give the full allocation to the button in menu mode
The button is what draws the background/frame outline of the combobox,
and padding is defined as the spacing *inside* the widget between the
border and the content.

https://bugzilla.gnome.org/show_bug.cgi?id=646882
2011-04-12 17:14:36 -04:00
Cosimo Cecchi
6116bcb78e combobox: rename border->padding for code clarity
https://bugzilla.gnome.org/show_bug.cgi?id=646882
2011-04-12 17:14:35 -04:00
Cosimo Cecchi
cfb54d81bd combobox: allocate the right border to the arrow and not to the label
When the combobox is in menu mode, the right padding of the togglebutton
inside, should be allocated to its rightmost children, which is the
arrow.

https://bugzilla.gnome.org/show_bug.cgi?id=646882
2011-04-12 17:14:34 -04:00
Cosimo Cecchi
bb038d4dd4 combobox: don't use the border as a padding
This causes the combobox to behave badly from the theme.

https://bugzilla.gnome.org/show_bug.cgi?id=646882
2011-04-12 17:14:33 -04:00
Cosimo Cecchi
2613e412d7 combobox: don't add the button style class to the whole widget
It already has a toggle button inside, and this way we cannot theme them
separately.

https://bugzilla.gnome.org/show_bug.cgi?id=646882
2011-04-12 17:14:32 -04:00
Benjamin Otte
f2441c08f1 combobox: Don't set the menu's name twice 2011-03-27 00:48:25 +01:00
Cosimo Cecchi
0ff4fdb233 combobox: add an arrow-scaling property to GtkComboBox 2011-03-03 17:48:25 -05:00
Tristan Van Berkom
4164a49b84 Added documentation to "cell-area" construct-only properties.
Indicate what kind of area will be used by default if none is
provided by the user.
2011-02-24 16:05:41 +09:00
Matthias Clasen
beb8c290d1 Always chain up in ::style-updated
This was not handled consistently, but the default handler
does useful things, so we should always chain up.
2011-02-07 07:30:37 -05:00
Carlos Garnacho
42778894c0 s/state_changed/state_flags_changed/ in GtkComboBox 2011-02-06 11:21:42 +01:00
Matthias Clasen
726b0d8736 Bandaid fix for icon view subclassing
I've decided that it is isn't feasible to make cell areas runtime-settable
in the time we have left before 3.0, therefore, I'm going with the
approach to allow init() functions to instantiate the default cell area
and issue a warning if a construct property is ignored.

This is not ideal, but it keeps existing icon view and combo box
subclasses working.

https://bugzilla.gnome.org/show_bug.cgi?id=639139
2011-01-31 17:39:42 -05:00
Matthias Clasen
f941f7b123 Fix keynav issue in menu mode
Skipping insensitive and separator rows was broken in menu mode.
https://bugzilla.gnome.org/show_bug.cgi?id=639845
2011-01-20 23:40:14 -05:00
Pavel Holejsovsky
374e76a19d [GI] Mark unintrospectable constructs as (skip)
Also adds 'Rename to:' annotation to some constructs replacing the
skipped ones.
2011-01-20 13:57:21 +01:00
Benjamin Otte
a41402c455 combobox: Update adjustment usage for sealing 2011-01-05 23:50:22 +01:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Milan Bouchet-Valat
52e1722f35 GtkComboBox(Text): Add documentation about the entry 2011-01-04 10:36:08 -05:00
Tristan Van Berkom
68aa336f5f Removed TABs and trailing whitespace from GtkComboBox and GtkTreeMenu 2011-01-05 00:14:25 +09:00
Tristan Van Berkom
4ff893979b Fixed conflicts after rebasing master into combo-refactor branch. 2011-01-04 23:37:14 +09:00
Tristan Van Berkom
d681aa7977 Fixed GtkComboBox to properly set tearoff state on delegate GtkTreeMenu.
This breakage was also the cause of not correctly positioning the child
menu over the selected item.
2011-01-04 23:37:13 +09:00
Tristan Van Berkom
7b2d6e5cdf Make GtkTreeMenu a private class:
- Removed GtkTreeMenu from gtk-docs.sgml
  - Removed GtkTreeMenu from gtk3-sections.txt
  - Removed GtkTreeMenu from gtk.symbols
  - Make GtkTreeMenu apis prefixed with '_' (including _get_type()).
  - Updated GtkComboBox sources to use the private apis
  - Updated GtkCellView to not mention #GtkTreeMenu in gtk-doc statements
  - Updated tests/testtreemenu to not use a GtkTreeMenu but still
    show a very fancy GtkComboBox
  - Moved gtktreemenu.h to private headers section in the makefile.
  - Removed include of gtktreemenu.h from gtk.h
2011-01-04 23:37:13 +09:00
Tristan Van Berkom
57857f13df Added new constructors gtk_combo_box_new_with_area and gtk_combo_box_new_with_area_and_entry. 2011-01-04 23:37:13 +09:00
Tristan Van Berkom
b3ff60db71 Fixed GtkComboBox to let the cell-layout implementation handle <cell-packing> 2011-01-04 23:37:13 +09:00
Tristan Van Berkom
01981311da Removed GtkComboBoxPrivate->minimum/natural_width members.
And updated gtk_combo_box_list_position() which is still waiting
for GtkTreeView to report natural width in order to properly do
non fixed width dropdown menus.
2011-01-04 23:37:12 +09:00
Tristan Van Berkom
ee02ac5863 Re-refactored GtkComboBox to not reorder the file.
Turns out reordering the file the way I did before put
me in an unmergable situation, now re-refactored the
combo and list-mode works again.
2011-01-04 23:37:12 +09:00
Tristan Van Berkom
f3de78a023 Fixing GtkComboBox breakage after merge, completing hand-merge of style-context GtkBorder issues (now it works again). 2011-01-04 23:37:11 +09:00
Tristan Van Berkom
83c69f4cf3 Implementing GtkComboBox using GtkTreeMenu !
First iteration at implementing combo box using a delegate
treemenu, almost everything is working. Still need to finalize
sensitivity issues in GtkTreeMenu (and should go ahead and pass
through GtkComboBox code with a fine comb...).
2011-01-04 23:37:08 +09:00
Kristian Rietveld
c659542333 Check for NULL pointer 2010-12-24 14:45:47 +01:00
Matthias Clasen
2ed81aa57c Remove sealed members from GtkMenuShell 2010-12-23 18:21:53 -05:00
Matthias Clasen
c5b020e628 Remove sealed members from GtkMenu 2010-12-23 15:51:20 -05:00
Javier Jardón
e92da3e166 gtkcombobox.c: Use accessor functions to access GtkTreeSelection 2010-12-19 01:27:41 +00:00
Kristian Rietveld
faf35d708b Fix size allocation for list mode combo box 2010-12-17 16:53:46 +01:00
Kristian Rietveld
21fc66f120 Set cell_view to NULL immediately after unparenting
This way we are sure no invalid pointer will be accessed in between.
2010-12-17 16:53:46 +01:00
Kristian Rietveld
81515f7183 Check if popup_window is mapped, not popup_widget
Before hide_all was used on popup_window, which means popup_widget
was also unmapped.  This is now no longer the case.  This fixes
subsequent pop ups for appears-as-list == 1.
2010-12-17 16:53:46 +01:00
Tristan Van Berkom
4038cd76b3 Removed GtkTreeViewPrivate from gtktreeprivate.h and added a few more accessors.
This actually much simplifies interaction with GtkTreeSelection
(at least reduces code size where dealing width the treeview anchor path).
2010-12-05 22:11:37 +09:00
Javier Jardón
d351b40a0b Add internal accessor for GtkEntry->is_cell_renderer
This fixes commit fb3429e507
2010-12-04 22:06:02 -05:00
Carlos Garnacho
cf0bd12e6c GtkStyleProperties: Turn border-width into a GtkBorder property.
All current users of this CSS property have been updated to deal
with a GtkBorder.

Also a 0 border width has been set in the default CSS to ensure
GtkStyleContext and GtkThemingEngine always provide a non-NULL
pointer for this property.
2010-12-04 15:39:52 +01:00
Carlos Garnacho
1d5a6b687e GtkComboBox: Use style context for rendering 2010-12-04 15:39:40 +01:00
Carlos Garnacho
0e25b19515 GtkComboBox: Set widget state as state flags. 2010-12-04 15:38:30 +01:00
Ryan Lortie
922324553b Bug 619148 - "active ID" properties (GtkComboBox)
Based on a patch by Matthias, add an "active-id" property for
GtkComboBox and add some convenience API for GtkComboBoxText.

Also, add a test case to gtk-demo.
2010-11-30 00:29:16 -05:00
Matthias Clasen
2451e6f690 Small doc fixup 2010-11-29 11:25:10 -05:00
Michael Natterer
fb5dd9f72f Move all GdkDevice members to private and add one missing accessor 2010-11-23 20:25:13 +01:00
Javier Jardón
4e3db2e3a8 gtkcombobox: Use accessor functions to access GtkTreeViewColumn 2010-11-19 08:38:12 +01:00
Javier Jardón
fb3429e507 gtkcombobox: Do not access GtkEntry internals
It's not needed anymore
2010-11-19 06:15:27 +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
a9894d4cf4 Use gtk_box_new() instead gtk_[v|h]box_new() 2010-10-30 05:22:58 +02:00
Javier Jardón
8d008790be Use gtk_separator_new() instead gtk_[v|h]separator_new() 2010-10-30 02:26:23 +02:00
Matthias Clasen
ac3fe174f7 GtkComboBox: Add a constructor that takes a model and adds an entry
https://bugzilla.gnome.org/show_bug.cgi?id=633050
2010-10-29 12:28:42 -04:00
Matthias Clasen
520a6aeb8f Fix up docs 2010-10-23 23:41:08 +02:00
Matthias Clasen
7651c231e0 Revert the id-column patch
It didn't quite turn out as I wanted it.
I'll put it in bug 619148 for now.
2010-10-23 19:34:20 +02:00
Matthias Clasen
9fb36fff36 Add a way to associate numeric ids with combobox values
This will let us use combo boxes as property editors for
GSettings enmerations easily.
2010-10-23 02:31:30 +02: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
Matthias Clasen
0219eea4d7 Remove GtkComboBoxEntry and the combo box text api 2010-10-20 11:02:03 +02:00
Matthias Clasen
d1a9d764a8 Remove gtk_widget_hide_all()
it's useless and a trap for programmers

https://bugzilla.gnome.org/show_bug.cgi?id=438318
2010-10-19 19:31:38 +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
Matthias Clasen
a62e1b95bc Fix some GtkComboBoxText problems 2010-10-16 08:16:55 -04:00
Christian Dywan
d70b7f49b6 Use property system to coerce model data to G_TYPE_STRING
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=423201
2010-10-15 17:00:13 -04:00
Matthias Clasen
50cbd23d5b docs: cross-reference to GtkComboBoxText 2010-10-15 16:58:28 -04:00
Matthias Clasen
43250e8faf Deprecate the old combobox text convenience api 2010-10-15 16:58:27 -04: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
Matthias Clasen
8353754c17 docs: adjust Since tags 2010-10-15 16:58:26 -04: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
Javier Jardón
5a30dad531 docs: Move documentation to inline comments: GtkComboBox 2010-10-04 02:37:42 +02:00
Benjamin Otte
7adeca53b2 combobox: Fix compilation warnings - missing cast 2010-09-28 18:24:14 +02:00
Matthias Clasen
f53ad33994 Remove GtkObject completely 2010-09-26 22:18:19 -04:00
Javier Jardón
eac1959d2c Move destroy signal to GtkWidget
Also make GtkWidget derive from GInitiallyUnowned
2010-09-26 22:18:18 -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
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
1f640d127e combobox: Port to draw vfunc 2010-09-26 15:11:38 +02:00
Matthias Clasen
e0aa12eb0a Tons of transfer annotations 2010-09-21 00:18:11 -04:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00
Havoc Pennington
c29f0a1392 Fix more SizeRequest implementations to avoid recursive calls to wrapper API
GtkFrame, GtkComboBox, GtkExpander, GtkMenu, GtkWrapBox

These are all the examples I could find so far.

https://bugzilla.gnome.org/show_bug.cgi?id=628829
2010-09-12 21:47:10 -04:00
Colin Walters
913cdf3be7 GDK: Prefix key names with KEY_
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.

For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.

Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
2010-09-08 18:51:44 -04:00
Matthias Clasen
2766cd14ad Remove depth restriction from gtk_combo_box_set_active_iter docs
While it may not work perfectly in menu mode, it works fine for
list mode. Bug 627843.
2010-08-24 21:51:17 -04:00
Javier Jardón
42a0a8143b gtk/gtkcombobox.c: use accessor functions to access GtkWidget 2010-08-22 22:56:13 +02:00
Tristan Van Berkom
005e8a6c2f Changed combo box's menu position function to use child menu
item's allocation instead of a complex calculation to guess
it's height for width.
2010-08-20 19:26:10 -04:00
Tristan Van Berkom
9c26bd525f Added height-for-width management for GtkComboBox/GtkCellView
now GtkComboBox (and GtkCellView) request and allocate children/cells
in a height-for-width manner.
2010-08-18 20:01:28 -04:00
Javier Jardón
8b2108a8a4 gtkcombobox: Only use the child if It is a GtkCellLayout
This error was introduced in
commit 4427760bcc

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=625104
2010-08-08 06:22:45 +02:00
Javier Jardón
63d3b197c2 Add _gtk_bin_set_widget() internal function 2010-07-13 19:40:47 +02:00
Javier Jardón
4427760bcc Use GtkBin accessors 2010-07-13 19:40:47 +02:00
Javier Jardón
3a10216dd0 Use accessor functions to acces GtkContainer 2010-07-13 19:40:46 +02:00
Javier Jardón
56cc11a416 gtkcombobox: unseal private pointer 2010-07-13 19:40:46 +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
Philip Withnall
0b51abbfdf Add (out) annotations to GtkTreeIter parameters 2010-07-07 18:20:37 +02:00
Colin Walters
905f988166 Revert "Add length to gtk_tree_path_get_indices"
This reverts commit eebb16eb1a.

Was an accidental commit.
2010-06-28 14:15:10 -04:00
Colin Walters
eebb16eb1a Add length to gtk_tree_path_get_indices
The old version wasn't introspectable as it didn't have a length
return parameter.  Also, delete gtk_tree_path_get_indices_with_depth,
since it's no longer needed.
2010-06-28 13:50:36 -04:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Javier Jardón
b18b33ae82 Revert "Forward-port a GtkAdjustment compatibility fix"
In the early 2.14.x releases, GtkAdjustment was changed to enforce
that values are restricted to the range [lower, upper - page_size].
This has always been the documented behaviour, and the recommended
practice is to set page_size to 0 when using adjustments for simple
scalar values, like in a slider or spin button.
Due to the large number of applications that are affected by this
change, the behaviour has been reverted to the old behaviour in
2.14.3, with an explicit warning that this change will be
reintroduced in 2.90.

This reverts commit e6373738fc.

https://bugzilla.gnome.org/show_bug.cgi?id=619474
2010-05-24 15:39:30 +02:00
Javier Jardón
32b9aeaadd Don't use GTK_WIDGET_STATE in internal code anymore
Use gtk_widget_get/set_state() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-09 02:40:17 +01:00
Javier Jardón
16a59ad912 Deprecate widget flag: GTK_WIDGET_REALIZED
Use gtk_widget_get_realized() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:41:05 +01:00
Javier Jardón
1fe7d3cefd Deprecate widget flag: GTK_WIDGET_MAPPED
Use gtk_widget_get_mapped() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:19:03 +01:00
Javier Jardón
483a5a9e1a Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_CAN_FOCUS)
Use new API instead: gtk_widget_set_can_focus ()
2010-03-02 04:42:54 +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