Commit Graph

564 Commits

Author SHA1 Message Date
Matthias Clasen
65d844f074 Be more careful when creating gcs, also emit change notification.
2006-08-06  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_set_grid_lines)
	(gtk_tree_view_set_enable_tree_lines): Be more careful
	when creating gcs, also emit change notification.
	(gtk_tree_view_unrealize): Free the gcs here.  (#349834,
	Chris Wilson)
2006-08-06 05:44:03 +00:00
Kristian Rietveld
36329391a7 Fix for #335012, reported by Matteo Nastasi.
2006-07-18  Kristian Rietveld  <kris@imendio.com>

	Fix for #335012, reported by Matteo Nastasi.

	* gtk/gtktreeview.c (gtk_tree_view_real_start_editing): if the
	requested space of the editable is smaller than the cell area,
	put it up above the middle of the cell area.

	* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_start_editing):
	configure the inner border to cover the cell area if the
	entry requisition is smaller than the cell_area.
2006-07-18 13:33:28 +00:00
Kristian Rietveld
61f4d77d55 Another fix for #164884.
2006-07-18  Kristian Rietveld  <kris@imendio.com>

	Another fix for #164884.

	* gtk/gtktreeprivate.h: add in_grab field.

	* gtk/gtktreeview.c (gtk_tree_view_button_press): only save press
	to possibly begin a drag when there's no grab pending,
	(gtk_tree_view_grab_notify): toggle in_grab field.
2006-07-18 12:33:25 +00:00
Kristian Rietveld
6ca1b1e685 use MAX priv->width, alloc.width when allocating the bin_window,
2006-07-18  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktreeview.c (gtk_tree_view_realize): use MAX
	priv->width, alloc.width when allocating the bin_window,
	(gtk_tree_view_bin_expose): don't overrun bin_window when drawing
	the flat box.
2006-07-18 10:15:37 +00:00
Kristian Rietveld
e39a71dceb check if the iter still has children after running the test-expand-row
2006-07-17  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktreeview.c (gtk_tree_view_build_tree): check if the iter
	still has children after running the test-expand-row func,
	(gtk_tree_view_real_expand_row): ditto. (#302127, Billy Biggs).
2006-07-17 13:57:38 +00:00
Matthias Clasen
f8794cccca Improve consistency of signal and property names 2006-07-06 05:14:03 +00:00
Matthias Clasen
982a5768ec Don't leak dash_list. (#346639, Christian Persch)
2006-07-05  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_set_enable_tree_lines): Don't
	leak dash_list.  (#346639, Christian Persch)
2006-07-05 16:29:46 +00:00
Kristian Rietveld
542ac19eef cancel the expand collapse timeout when unsetting the model (Fixes
2006-06-27  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_set_model): cancel the
	expand collapse timeout when unsetting the model (Fixes #327164,
	reported by Daichi Kawahata).
2006-06-27 09:28:48 +00:00
Matthias Clasen
49a025bbdc Fix the registration of the grid-lines property (#345456, Murray Cumming)
2006-06-21  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_class_init): Fix the registration
	of the grid-lines property  (#345456, Murray Cumming)
2006-06-21 15:04:44 +00:00
Kristian Rietveld
e472c2af45 Allocate space for the grid lines when they are enabled.
2006-06-21  Kristian Rietveld  <kris@imendio.com>

	Allocate space for the grid lines when they are enabled.

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): make sure the cell
	area does not overlap with the grid lines, also draw the line for
	"the next cell" in the last loop iteration, make sure the cursor falls
	in between the grid lines,
	(validate_row): request extra space for the grid lines.
2006-06-21 11:11:20 +00:00
Matthias Clasen
2406a5b256 Better fix.
2006-06-20  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_set_column_drag_info): Better
	fix.
2006-06-20 14:12:15 +00:00
Matthias Clasen
103bba09e4 (gtk_tree_view_set_column_drag_info): Don't crash if the
column_drop_func says always no.  (#344850, Christian Weiske)
2006-06-20 03:28:36 +00:00
Matthias Clasen
a5aaf6b8a5 Don't leak dash_list.
2006-06-19  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_set_grid_lines): Don't leak
	dash_list.
2006-06-20 01:57:26 +00:00
Matthias Clasen
400101a108 Fix 344838 2006-06-14 13:32:49 +00:00
Kristian Rietveld
7a6a6ebcff Introduce grid and tree lines in GtkTreeView. (#106406, Martyn Russell).
2006-06-12  Kristian Rietveld  <kris@imendio.com>

	Introduce grid and tree lines in GtkTreeView. (#106406,
	Martyn Russell).

	* gtk/gtktreeprivate.h: add new fields to GtkTreePrivate.

	* gtk/gtkenums.h: add GtkTreeViewGridLines.

	* gtk/gtktreeview.[ch] (gtk_tree_view_set_grid_lines),
	(gtk_tree_view_get_grid_lines),
	(gtk_tree_view_set_enable_tree_lines),
	(gtk_tree_view_get_enable_tree_lines): new API,
	(gtk_tree_view_class_init): new properties,
	(gtk_tree_view_init), (gtk_tree_view_{get,set}_property),
	(gtk_tree_view_realize), (gtk_tree_view_draw_grid_lines),
	(gtk_tree_view_bin_expose): implement.

	* gtk/gtk.symbols: update.
2006-06-12 18:17:35 +00:00
Kristian Rietveld
f6c583f74e Rubber banding for GtkTreeView, #80127. Uses same method as GtkIconView.
2006-06-02  Kristian Rietveld  <kris@imendio.com>

	Rubber banding for GtkTreeView, #80127.  Uses same method as
	GtkIconView.

	* gtk/gtktreeview.c (gtk_tree_view_class_init),
	(gtk_tree_view_init), (gtk_tree_view_get_property),
	(gtk_tree_view_set_property), (gtk_tree_view_set_rubber_banding),
	(gtk_tree_view_get_rubber_banding): add property,
	(gtk_tree_view_button_press): start rubber banding if enabled and
	press is on a non-selected node,
	(gtk_tree_view_button_release): stop rubber banding,
	(gtk_tree_view_motion_bin_window), (scrool_row_timeout): enable/update
	the rubber band,
	(gtk_tree_view_bin_expose): draw rubber band if active,
	(gtk_tree_view_stop_rubberband),
	(gtk_tree_view_update_rubber_band_selection_range),
	(gtk_tree_view_update_rubber_band_selection),
	(gtk_tree_view_update_rubber_band),
	(gtk_tree_view_paint_rubber_band): new functions.

	* gtk/gtktreeview.h: add new set/get function for rubber banding
	property.

	* gtk/gtktreeprivate.h: add a bunch of new private fields.
2006-06-02 20:40:33 +00:00
Kristian Rietveld
29018576b7 revert fix of #164884 because it's not a problem in gtk+ but in
2006-06-02  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktreeview.c (gtk_tree_view_leave_notify)P: revert fix of
	#164884 because it's not a problem in gtk+ but in applications and
	it breaks starting drags from the edge of a row.
2006-06-02 19:06:09 +00:00
Kristian Rietveld
a70e666423 Separate sensitive/selectable properties.
2006-06-02  Kristian Rietveld  <kris@imendio.com>

	Separate sensitive/selectable properties.

	* gtk/gtktreeselection.c (tree_column_is_sensitive): remove,
	(_gtk_tree_selection_row_is_selectable): remove checks to see if at
	least one column is sensitive,
	(gtk_tree_selection_real_select_node): remove code which enables
	insensitive rows to always be unselected.

	* gtk/gtktreeview.c (gtk_tree_view_row_changed): remove code
	that unselects a node if it just became insensitive.

	* gtk/gtkcombobox.c (gtkcombo_box_list_select_func): new function,
	based on the at least one column sensitive check from
	_gtk_tree_selection_row_is_selectable(),
	(gtk_combo_box_list_setup): set selection function on tree selection.
2006-06-02 18:55:59 +00:00
Matthias Clasen
3c6de40578 Document signals. (#302556, Stefan Kost)
2006-05-31  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_class_init): Document
	signals.  (#302556, Stefan Kost)
2006-05-31 19:17:16 +00:00
Johan Dahlin
743c6be7e4 Add a space 2006-05-29 21:51:01 +00:00
Kristian Rietveld
05a0b0b4fb select the current focus row if nothing is selected and ctrl is not
2006-05-29  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_move_cursor_up_down): select
	the current focus row if nothing is selected and ctrl is not pressed.
	(Fixes #324480, Murray Cumming/Srirama Sharma).
2006-05-28 23:34:47 +00:00
Kristian Rietveld
3c6fb8881c refactor to work correctly in RTL mode.
2006-05-28  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_cell_focus): refactor
	to work correctly in RTL mode.

	* gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): make
	cursor movement to left/right work correctly in RTL mode.
2006-05-28 21:51:04 +00:00
Kristian Rietveld
8ac6ef2176 broken pipe 2006-05-28 00:20:05 +00:00
Kristian Rietveld
ff8eeb3c1d set the sizing type of the new column to FIXED,
2006-05-28  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_insert_column): set the sizing
	type of the new column to FIXED,
	(gtk_tree_view_insert_column_with_attributes): likewise. (#341898,
	Dan Winship).
2006-05-27 22:39:46 +00:00
Kristian Rietveld
b97fea2c26 really fix #333284.
2006-05-27  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_queue_draw_arrow): really fix
	#333284.
2006-05-27 21:09:59 +00:00
Kristian Rietveld
4f88a172cb broken pipe 2006-05-27 16:20:20 +00:00
Kristian Rietveld
e230adcfa0 queue a redraw for the full width of the row, not just the width we got
2006-05-26  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_queue_draw_arrow): queue a redraw
	for the full width of the row, not just the width we got allocated.
	(Fixes #333284, reported by Benjamin Berg).
2006-05-26 00:25:44 +00:00
Kristian Rietveld
7bae68f0b7 set dy to page_size + height in the event dy + page_size is about to
2006-05-26  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_top_row_to_dy): set dy to
	page_size + height in the event dy + page_size is about to become
	bigger than height.
2006-05-26 00:00:50 +00:00
Matthias Clasen
48f4f383f3 Fix an RTL problem with toggles in expander columns. (#341896, Roozbeh
2006-05-15  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_button_press): Fix
	an RTL problem with toggles in expander columns.
	(#341896, Roozbeh Pournader)
2006-05-16 01:38:53 +00:00
Søren Sandmann
6cb19cf3ad gtk/gtklayout.c (gtk_layout_realize), gtk/gtkiconview.c
Mon May 15 15:12:05 2006  Søren Sandmann  <sandmann@redhat.com>

	* gtk/gtklayout.c (gtk_layout_realize),
	* gtk/gtkiconview.c (gtk_icon_view_realize),
	* gtk/gtktreeview.c (gtk_tree_view_realize): Set the background of
	the clip windows to NULL, since they are generally invisible and
	don't have EXPOSURE set, which means they temp-unvlicker code
	doesn't apply to them.

	* gdk/x11/gdkgeometry-x11.c (_gdk_window_move_resize_child): Unset
	the background of the parent window during resizing. Invalidate
	the uncoered area of the parent window. Bug 341332.
2006-05-15 19:17:30 +00:00
Matthias Clasen
113f364a37 More of the same 2006-05-14 04:25:34 +00:00
Matthias Clasen
f26aad1916 Boilerplate reduction 2006-05-02 23:56:43 +00:00
Kristian Rietveld
33cddd12d7 set tmpnode to the return value of the _gtk_rbtree_insert* functions,
2006-05-02  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktreeview.c (gtk_tree_view_row_inserted): set tmpnode to
	the return value of the _gtk_rbtree_insert* functions, since that
	is the node we really want to check for visibilty.
2006-05-02 15:50:58 +00:00
Kristian Rietveld
9fd0d4b8b9 Fix for #340200, spotted by Torsten Schoenfeld.
2006-04-30  Kristian Rietveld  <kris@imendio.com>

	Fix for #340200, spotted by Torsten Schoenfeld.

	* gtk/gtktreeview.c (gtk_tree_view_get_cell_area): fix up logic
	calculating the level indentation,
	(gtk_tree_view_start_editing): remove code calculating the
	level indentation, since _get_cell_area() takes care of this for us.
2006-04-30 15:49:25 +00:00
Matthias Clasen
373cbb13be Don't force the standard DND icon if the user has a custom DND source.
2006-04-28  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_drag_begin): Don't force
	the standard DND icon if the user has a custom DND source.
	(#339522, Joe Wreschnig)
2006-04-28 14:32:09 +00:00
Kristian Rietveld
3ec54866c3 new function, (validate_visible_area): when a node is validated, only
2006-04-26  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktreeview.c (node_is_visible): new function,
	(validate_visible_area): when a node is validated, only queue a
	redraw for that node, not for the entire widget (a redraw for the
	entire widget is only needed when the sizes change, and
	_queue_resize() will take care of that),
	(do_validate_rows): do not queue a redraw, redraws are only needed
	for changes in the visible area and validate_visible_area() takes
	care of that,
	(gtk_tree_view_row_inserted): for fixed height mode, only queue
	a resize and redraw if the node is visible, else no redraw is needed.
2006-04-26 14:10:01 +00:00
Kristian Rietveld
d09c7c67af If this new "row-ending-details" property is turned on, more detailed
2006-04-26  Kristian Rietveld  <kris@imendio.com>

	If this new "row-ending-details" property is turned on, more
	detailed "details" will be passed to the theme engine for drawing
	the background, drop indicator and focus rectangle.  Requirement is
	that the theme engine supports these details. (#333760).

	* gtk/gtktreeview.c (gtk_tree_view_class_init): add row-ending-details
	style property,
	(gtk_tree_view_bin_expose): pass more detailed detail to
	gtk_paint_flat_box() if the property is turned on,
	(gtk_tree_view_bin_expose): likewise for the drop indicator,
	(gtk_tree_view_bin_expose): likewise for the focus rectangle.
2006-04-26 12:48:03 +00:00
Kristian Rietveld
ebe22cb38a (broken pipe) 2006-04-26 12:39:25 +00:00
Matthias Clasen
0d10969b9f Match parameter names with the headers.
2006-04-24  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkclipboard.h:
	* gtk/gtkprinter.c:
	* gtk/gtkprintsettings.h:
	* gtk/gtkprintsettings.c: Match parameter names with the headers.

	* gtk/gtkprintoperation-unix.c (gtk_print_run_page_setup_dialog):
	Add docs.

	* gtk/gtktextbufferrichtext.c (gtk_text_buffer_deserialize):
	* gtk/gtkstatusicon.c (gtk_status_icon_get_storage_type):
	* gtk/gtktreeview.c (gtk_tree_view_set_search_position_func):
	* gtk/gtktreeview.c (gtk_tree_view_get_headers_clickable):
	* gtk/gtkcellrendererspin.c (gtk_cell_renderer_spin_new):
	* gtk/gtkmenu.c (gtk_menu_get_for_attach_widget): Fix the docs.
2006-04-24 05:42:12 +00:00
Matthias Clasen
7b19dcbe79 Reorganize slightly to avoid a possible NULL dereference. (Coverity)
2006-04-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_header_focus): Reorganize slightly
	to avoid a possible NULL dereference.  (Coverity)
2006-04-13 04:31:51 +00:00
Matthias Clasen
3014a278ed Don't allow passing NULL for x1 or x2, adjust callers.
2006-04-12  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_get_arrow_xrange): Don't
	allow passing NULL for x1 or x2, adjust callers.
2006-04-13 03:40:48 +00:00
Matthias Clasen
e12d6657ee Remove some unused variables.
2006-04-11  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextview.c (selection_motion_event_handler): Remove
        some unused variables.

        * gtk/gtktreeview.c ((gtk_tree_view_search_position_func): Apply
        a patch from David Trowbridge to improve the positioning of the
        search popup.  (#338047)
2006-04-12 02:48:43 +00:00
Matthias Clasen
8a1478a58f Remove some accidentally committed stuff 2006-03-22 20:06:16 +00:00
Matthias Clasen
3fb3db9f7a Use fg_gc to draw the inter-row drop highlight. Also draw the line all the
2006-03-22  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Use fg_gc to
	draw the inter-row drop highlight. Also draw the line all the
	way across, and flip it in RTL mode. (#334906, Ian McDonald)
2006-03-22 18:46:08 +00:00
Federico Mena Quintero
bb7fd9549b Make Shift-P and Shift-N activate typeahead in GtkTreeView (i.e. they are
2006-03-10  Federico Mena Quintero  <federico@novell.com>

	Make Shift-P and Shift-N activate typeahead in GtkTreeView
	(i.e. they are just normal capital letters).  Fixes bug #334098.

	* gtk/gtktreeview.c (gtk_tree_view_add_move_binding): Add an
	"add_shifted_binding" argument which determines whether we'll add
	the same binding with GDK_SHIFT_MASK.
	(gtk_tree_view_class_init): Use add_shifted_binding=FALSE for GDK_p
	and GDK_n; use TRUE for all the rest.
2006-03-10 17:16:50 +00:00
Kristian Rietveld
2e6ba401cc rename to _gtk_tree_selection_row_is_selectable and export internally,
2006-03-01  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktreeselection.c (row_is_selectable): rename to
	_gtk_tree_selection_row_is_selectable and export internally,
	(gtk_tree_selection_real_select_node): changed so it is always
	possible to unselect insensitive nodes, changed the logic a bit to
	be more clear.

	* gtk/gtktreeprivate.h: add _gtk_tree_selection_row_is_selectable.

	* gtk/gtktreeview.c (gtk_tree_view_row_changed): Unselect a row if
	it became insensitive.
2006-03-01 12:18:57 +00:00
Kristian Rietveld
236760d04e fix compiler warning.
2006-02-06  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_get_search_entry): fix compiler
	warning.
2006-02-06 18:32:59 +00:00
Kristian Rietveld
58e77fe25b #322591, Jonathan Blandford.
2006-01-24  Kristian Rietveld  <kris@gtk.org>

	#322591, Jonathan Blandford.

	* gtk/gtktreeview.[ch] (gtk_tree_view_get_search_entry),
	(gtk_tree_view_set_search_entry),
	(gtk_tree_view_get_search_position_func),
	(gtk_tree_view_set_search_position_func): New functions,
	and small adaptions to the tree view code to allow for setting
	the entry and search position function.

	* gtk/gtktreeprivate.h: Removed GtkTreeViewSearchDialogPositionFunc
	typedef, which is now in gtktreeview.h as
	GtkTreeViewSearchPositionFunc.  Add/update fields.

	* gtk/gtk.symbols: Add new functions.

	* tests/testtreesort.c: Add a little test for _set_search_entry().
2006-01-24 10:49:29 +00:00
Kristian Rietveld
be80745aac Revert previous commit after more searching in the bugzilla archives (see
2006-01-22  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Revert previous
	commit after more searching in the bugzilla archives (see #309221).
2006-01-22 16:04:02 +00:00
Kristian Rietveld
d1337e1012 Remove second call to gtk_tree_view_column_cell_set_cell_data, since we
2006-01-22  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Remove second call
	to gtk_tree_view_column_cell_set_cell_data, since we also set the
	cell data before iterating over the columns for exposure. (Fixes
	#322471, Duncan Coutts).
2006-01-22 15:50:31 +00:00