Commit Graph

497 Commits

Author SHA1 Message Date
Matthias Clasen
463aab93dd Various cleanups. (#315360, Kjartan Maraas)
2005-09-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/*.c: Various cleanups.  (#315360, Kjartan Maraas)
2005-09-13 19:57:42 +00:00
Matthias Clasen
676b09e798 Silently return NULL if the widget is not realized. (#316023, Guillaume
2005-09-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon):
	* gtk/gtkiconview.c (gtk_icon_view_create_drag_icon): Silently
	return NULL if the widget is not realized.  (#316023,
	Guillaume Cottenceau)
2005-09-13 13:33:01 +00:00
Matthias Clasen
af89d145f7 Use gdk_atom_intern_static_string() where appropriate.
* gtk/*.c:  Use gdk_atom_intern_static_string() where
	appropriate.
2005-09-11 05:48:27 +00:00
Matthias Clasen
d8b026adb0 Document memory handling. (#314975, Torsten Schoenfeld)
2005-09-09  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_get_visible_range): Document
	memory handling.  (#314975, Torsten Schoenfeld)
2005-09-09 16:24:49 +00:00
Matthias Clasen
94eec04267 Intern some more strings.
2005-09-01  Matthias Clasen  <mclasen@redhat.com>

        * gdk/*.c: Intern some more strings.
        * gtk/gtkintl.h:
        * gtk/*.c: Define an I_() macro and use it instead of the
        bulky g_intern_static_string().
2005-09-01 05:11:46 +00:00
Matthias Clasen
f4bbe8f0de Also intern static strings passed to g_object_set_data() 2005-08-31 17:58:55 +00:00
Matthias Clasen
c09cc89317 Intern type names in code generated by glib-mkenums, too.
2005-08-31  Matthias Clasen  <mclasen@redhat.com>

	* gdk/Makefile.am:
	* gtk/Makefile.am: Intern type names in code generated by
	glib-mkenums, too.

	* gtk/*.c:
	* gdk/x11/*.c:
	* gdk/*.c: Intern type names before registering the type to avoid
	unnecessary copies.
2005-08-31 16:53:43 +00:00
Jonathan Blandford
320c78ce86 clear scroll_to_path if the model changes.
Sat Aug 20 16:12:14 2005  Jonathan Blandford  <jrb@redhat.com>

        * gtk/gtktreeview.c (gtk_tree_view_set_model): clear
        scroll_to_path if the model changes.

        * gtk/gtkiconview.c: (gtk_icon_view_destroy),
        (gtk_icon_view_size_allocate), (gtk_icon_view_set_cursor),
        (gtk_icon_view_scroll_to_path): Handle scrolling to a path before
        we're realized, #312798
        (gtk_icon_view_set_model): clear scroll_to_path if the model
        changes.
2005-08-20 20:16:34 +00:00
Matthias Clasen
445b61e3e7 Return FALSE if the tree is empty. (#313891, Guillaume Cottenceau)
2005-08-19  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_get_visible_range): Return
	FALSE if the tree is empty.  (#313891, Guillaume Cottenceau)
2005-08-19 14:05:32 +00:00
Kristian Rietveld
48729ed118 queue a draw for the entire widget if any column changes width. (Fixes
2005-08-11  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_size_allocate_columns): queue
	a draw for the entire widget if any column changes width. (Fixes
	#311026, reported by Frederic Crozat).
2005-08-11 17:47:18 +00:00
Kristian Rietveld
a6ecb70b14 new function. (fixes #105252, suggestion from Mikael Hallendal).
2005-07-14  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.[ch] (gtk_tree_view_get_visible_range): new
	function. (fixes #105252, suggestion from Mikael Hallendal).
2005-07-13 23:05:27 +00:00
Kristian Rietveld
7a02c5b508 paint a flat box on the area the treeview got allocated extra vertically
2005-07-13  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): paint a flat box
	on the area the treeview got allocated extra vertically (fixes
	#142063, reported by Brian Bober).

	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
	make this function calculate real_cell_area and real_background_area
	correctly. (fixes #309249, reported by Bernd Demian).
2005-07-13 19:14:15 +00:00
Kristian Rietveld
faf2d31864 let's take the MIN of width and max_width here, not width and max_width !=
2005-07-13  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_new_column_width): let's take
	the MIN of width and max_width here, not width and max_width != -1.
	(fixes #144480, reported by Mikael Magnusson).
2005-07-13 14:28:02 +00:00
Kristian Rietveld
22554a161f when !separator, don't add the focus_line_width to width/height (happens
2005-07-13  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (validate_row): when !separator, don't add
	the focus_line_width to width/height (happens in
	_column_cell_get_size), but do add the vertical-separator to height,
	we weren't taking this into account before.

	* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
	take vertical-separator into account. (#309137, Ross Burton).
2005-07-13 11:57:10 +00:00
Kristian Rietveld
78c52d7141 add binding entry for ctrl + backspace (move focus to parent without
2005-07-11  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_class_init): add binding entry
	for ctrl + backspace (move focus to parent without affecting
	selection),
	(gtk_tree_view_real_select_cursor_parent): implement ctrl+backspace
	and simplify the function a bit. (#309296, Kathy Fernandes).
2005-07-11 18:52:33 +00:00
Kristian Rietveld
4b28e78a48 remove unneeded check for negative window_y.
2005-07-10  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): remove
	unneeded check for negative window_y.
2005-07-10 17:19:01 +00:00
Kristian Rietveld
53db7cc902 also move to the next match when ctrl+g is pressed. (#156657, Matt T.
2005-07-10  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_search_key_press_event): also move
	to the next match when ctrl+g is pressed. (#156657, Matt T. Proud).
2005-07-10 15:55:10 +00:00
Kristian Rietveld
2ebd7d1567 rework function to make page up/down behave the same as in GtkTextView.
2005-07-10  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): rework
	function to make page up/down behave the same as in GtkTextView.
	(Fixes #101220, Owen Taylor).
2005-07-10 15:47:18 +00:00
Kristian Rietveld
6a5ac16898 when open_all is TRUE, traverse the newly built tree to emit row_expanded
2005-07-09  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_real_expand_row): when
	open_all is TRUE, traverse the newly built tree to emit
	row_expanded for the subitems. (rev 1.444, patch in #172319
	broke this). Fixes #305582, reported by Billy Biggs.
2005-07-09 13:20:10 +00:00
Kristian Rietveld
7f5b9100ed Fixes #165034, reported by Jorn Baayen.
2005-07-08  Kristian Rietveld  <kris@gtk.org>

	Fixes #165034, reported by Jorn Baayen.

	* gtk/gtkrbtree.[ch] (_gtk_rbtree_set_fixed_height): add a
	mark_valid parameter (so we can mark all nodes as valid when we
	are setting them to the fixed height).

	* gtk/gtktreeview.c (initialized_fixed_height_mode): mark all
	nodes as valid when setting the fixed height,
	(do_validate_rows): update call to _set_fixed_height,
	(gtk_tree_view_row_inserted): mark node as valid when fixed
	height mode is enabled and a height has been set,
	(gtk_tree_view_build_tree): if fixed height mode is enabled,
	mark new nodes as valid in addition to setting the height.
2005-07-08 19:17:10 +00:00
Kristian Rietveld
45c7c2b0ca in the 'main' expose loop, add back the calls to _set_cell_data removed
2005-07-05  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): in the
	'main' expose loop, add back the calls to _set_cell_data
	removed earlier. (#309221, Matthias Clasen).
2005-07-05 21:11:32 +00:00
Matthias Clasen
6cc79068cf Stop column header drag operations if the grab is broken.
2005-06-26  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_grab_broken): Stop column
	header drag operations if the grab is broken.
2005-06-26 06:51:55 +00:00
Matthias Clasen
a7c8b44628 Change the keynav for header reordering and resizing to Alt-arrows and
2005-06-23  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_key_press): Change the
	keynav for header reordering and resizing to Alt-arrows and
	Shift-Alt-arrows, following a proposal by the keynav
	authority. (#308666, Calum Benson)
2005-06-23 20:19:21 +00:00
Kristian Rietveld
d7cfee4b16 added a check which avoids processing updates on bin_window and scrolling
2005-06-19  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_clamp_node_visible): added a
	check which avoids processing updates on bin_window and scrolling
	if the node is already visible. (#170600, Billy Biggs).
2005-06-19 19:22:46 +00:00
Kristian Rietveld
1bdf71943f only keep the row at the same position if the full row is visible.
2005-06-19  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (validate_visible_area): only keep the
	row at the same position if the full row is visible. (#304623,
	Jorn Baayen).
2005-06-19 18:40:35 +00:00
Kristian Rietveld
9d1a05c3b9 set dy to zero if treeview's height is smaller than the current page_size
2005-06-19  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_size_allocate): set dy to zero
	if treeview's height is smaller than the current page_size (just
	like we do elsewhere).
2005-06-19 18:00:56 +00:00
Kristian Rietveld
e02fe68aeb Make mousewheel scrolling possible in typeahead mode, suggestion from
2005-06-19  Kristian Rietveld  <kris@gtk.org>

	Make mousewheel scrolling possible in typeahead mode, suggestion
	from Reinout van Schouwen (#307898).

	* gtk/gtktreeview.c (gtk_tree_view_ensure_interactive_directory):
	connect treeview search window to scroll_event signal,
	(gtk_tree_view_search_scroll_event): implement.
2005-06-19 17:37:07 +00:00
Kristian Rietveld
afc4b03c73 pass the event on to treeview, so it has a change of selecting a row, etc.
2005-06-19  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_search_button_press_event): pass
	the event on to treeview, so it has a change of selecting a row, etc.
	(#169677, Kirk Bridger).
2005-06-19 13:42:13 +00:00
Kristian Rietveld
d4fdc6b7a9 This commit includes a fix for #169463, Stefan Kost.
2005-06-19  Kristian Rietveld  <kris@gtk.org>

	This commit includes a fix for #169463, Stefan Kost.

	* gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_get_size):
	when cell_area is set, return cell_area width/height as width/height,
	so the focus rectangle will be drawn correctly.

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): drop unneeded get
	of focus-line-width property,
	(validate_row): take focus_line_width into account.

	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
	also take focus_line_width into account when calculating the cell_area
	y and height (before, we only took it into account when calculating
	x and width).
2005-06-19 12:44:12 +00:00
Kristian Rietveld
6db99a9b8f undo merging of the separate loop setting cell data with cell drawing loop
2005-06-18  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): undo merging
	of the separate loop setting cell data with cell drawing loop
	(introduced in revision 1.280), since this breaks focus handling
	wrt special cells.
2005-06-18 12:11:26 +00:00
Manish Singh
2122756189 remove unused variable height_old.
Sat Jun 18 04:21:58 2005  Manish Singh  <yosh@gimp.org>

        * gtk/gtktreeview.c (do_presize_handler): remove unused variable
        height_old.
2005-06-18 11:22:44 +00:00
Matthias Clasen
7645a361ba Typo fixes 2005-06-18 05:33:55 +00:00
Kristian Rietveld
015b3c5671 Fix #160281, testcase from Peter Bloomfield.
2005-06-17  Kristian Rietveld  <kris@gtk.org>

	Fix #160281, testcase from Peter Bloomfield.

	* gtk/gtktreeview.c (do_presize_handler): always size request
	and update adjustments in fixed height mode,
	(gtk_tree_view_build_tree): if a fixed height is set, set this
	height on newly added nodes.
2005-06-17 19:44:53 +00:00
Kristian Rietveld
0771297449 make sure the row above 'above_path' is always in a validated state, so it
2005-06-17  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (validate_visible_area): make sure the row
	above 'above_path' is always in a validated state, so it does
	not mess up scrolling. (#303319, testcase from Billy Biggs).
2005-06-17 17:34:40 +00:00
Kristian Rietveld
b060f6e12d don't try to update the top_row rowref ourselves here, but just have
2005-06-17  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (validate_visible_area): don't try to update
	the top_row rowref ourselves here, but just have _dy_to_top_row()
	do it,
	(gtk_tree_view_scroll_to_cell): handle scrolling via
	validate_visible_area() if the treeview is not visible or needs
	reallocation. (#165246, Nickolay V. Shmyrev).
2005-06-17 14:11:19 +00:00
Kristian Rietveld
51f11dd497 Fixes #307914 (Alexander Larsson), fixing some breakage caused by my
2005-06-17  Kristian Rietveld  <kris@gtk.org>

	Fixes #307914 (Alexander Larsson), fixing some breakage caused
	by my previous commit.

	* gtk/gtktreeview.c (validate_visible_area): force dy to be zero
	when it fits on a single page,
	(scroll_sync_handler): same here.
2005-06-17 11:38:22 +00:00
Kristian Rietveld
5641d252be Patch for #163214 (reported by Tommi Komulainen) and fixes some other
2005-06-15  Kristian Rietveld  <kris@gtk.org>

	Patch for #163214 (reported by Tommi Komulainen) and fixes some
	other scrolling/validation related bugs along the why.

	* gtk/gtktreeview.c (gtk_tree_view_size_request): run
	do_validate_rows once and don't queue a size request there,
	(gtk_tree_view_size_allocate): don't update vadj value without
	reason, sync top_row/dy after the window sizes and adjustments
	are in sync again,
	(validate_visible_area): always update dy when scrolling,
	manually set top_row here after changing the vadj (don't depend
	on _adjustment_changed and top_row/dy sync to do this), since we
	now always set top_row here correctly, we can always free
	scroll_to_path at the end which avoids infinite expose loops,
	(do_validate_rows): add queue_resize boolean, remove top_row/dy
	sync here, we cannot do it safely at this place since the
	window sizes and adjustments are out of sync,
	(validate_rows), (validate_rows_handler): update call to
	do_validate_rows().
2005-06-14 22:26:04 +00:00
Matthias Clasen
793591fcf0 Check start_button_mask before starting a drag. (#149058, Andreas Volz)
2005-06-12  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_maybe_begin_dragging_row):
	Check start_button_mask before starting a drag.  (#149058,
	Andreas Volz)
2005-06-12 05:13:54 +00:00
Matthias Clasen
d53bffc04d Don't crash if search_window is NULL. (#304914, Victor Osadci, testcase by
2005-06-08  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
	Don't crash if search_window is NULL.  (#304914, Victor Osadci,
	testcase by Olaf Vitters)
2005-06-08 20:14:03 +00:00
Matthias Clasen
083e509487 Draw the background of rows insensitive when the treeview is insensitive.
2005-05-25  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Draw the
	background of rows insensitive when the treeview is insensitive.
	(pointed out by Billy Biggs)
2005-05-25 17:19:56 +00:00
Matthias Clasen
633a08fa4e Remove an unused variable. (#305130, Jaap A. Haitsma)
2005-05-23  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_search_init): Remove
	an unused variable.  (#305130, Jaap A. Haitsma)
2005-05-23 21:03:15 +00:00
Matthias Clasen
763452a14f Fix some errors in the handling of drop columns. (#143355, John Finlay)
2005-05-18  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_get_drop_column)
	(gtk_tree_view_set_column_drag_info): Fix some errors in the
	handling of drop columns.  (#143355, John Finlay)
2005-05-18 16:32:38 +00:00
Matthias Clasen
1d50b80aed Always initialize child-visible to FALSE, otherwise we may end up with the
2005-05-06  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtknotebook.c (gtk_notebook_insert_page_menu): Always
	initialize child-visible to FALSE, otherwise we may end up
	with the wrong page visible initially.  (#302283, Patrik Fimml)

	* gtk/gtktreeview.c (gtk_tree_view_draw_arrow): Make expanders
	appear insensitive in insensitive treeviews.
2005-05-06 19:36:41 +00:00
Matthias Clasen
d0b22eb542 Another one 2005-05-06 03:05:51 +00:00
Matthias Clasen
04f0490872 typo fix 2005-05-06 03:05:17 +00:00
Matthias Clasen
6d0627cb0d Set background upon state changes. (#301651, Billy Biggs)
2005-04-29  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_state_changed): Set
	background upon state changes.  (#301651, Billy Biggs)
	(gtk_tree_view_get_path_at_pos): Take RTL into account
	when iterating over the columns.  (#302163)
2005-04-29 18:50:03 +00:00
Matthias Clasen
eb92e0784a Set background upon state changes. (#301651, Billy Biggs)
2005-04-29  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_state_changed): Set
	background upon state changes.  (#301651, Billy Biggs)
2005-04-29 18:17:10 +00:00
Matthias Clasen
3962c1166f Fix double-click to autosize treeview columns. This was probably broken
2005-04-08  Matthias Clasen  <mclasen@redhat.com>

	Fix double-click to autosize treeview columns. This was
	probably broken since 2.2 ! (#169675)

	* gtk/gtktreeview.c (gtk_tree_view_button_press): Leave the
	"user-resized" state of the column on a double-click to
	autosize.
	(gtk_tree_view_button_press, gtk_tree_view_motion_resize_column):
	Enter the "user-resized" state of the column only if a drag
	actually changes the column width, not on any click.
2005-04-08 12:53:09 +00:00
Matthias Clasen
a9cdbf0fb5 Add a hint about hiding expanders.
2005-04-07  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_set_expander_column): Add
	a hint about hiding expanders.
2005-04-07 13:36:48 +00:00
Matthias Clasen
25c468dfbb Pass the target list to the underlying dnd implementation, otherwise we
2005-04-06  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_enable_model_drag_source)
	(gtk_tree_view_enable_model_drag_dest): Pass the target list
	to the underlying dnd implementation, otherwise we miss the
	target info in the drag-data-received signal.  (#164085, Jorn
	Baayen)
2005-04-07 03:55:13 +00:00