Various bugfixes
- From: Alexander Larsson <alla lysator liu se>
- To: <gtk-devel-list gnome org>
- Subject: Various bugfixes
- Date: Fri, 20 Apr 2001 17:04:55 +0200 (CEST)
Can i apply these patches?
/ Alex
Drag and drop of rows in GtkCList and GtkCTree messes up the
drag highlight since the icon being dragged over the highlight
causes exposes that remove the previously painted highlight.
This problem is in GtkTreeView too I think.
Index: gtk/gtkclist.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkclist.c,v
retrieving revision 1.192
diff -u -p -r1.192 gtkclist.c
--- gtk/gtkclist.c 2001/04/02 23:33:40 1.192
+++ gtk/gtkclist.c 2001/04/20 15:54:11
@@ -990,6 +990,8 @@ gtk_clist_init (GtkCList *clist)
clist->compare = default_compare;
clist->sort_type = GTK_SORT_ASCENDING;
clist->sort_column = 0;
+
+ clist->drag_highlight_row = -1;
}
/* Constructor */
@@ -4799,6 +4801,13 @@ gtk_clist_expose (GtkWidget *widget
/* exposure events on the list */
if (event->window == clist->clist_window)
draw_rows (clist, &event->area);
+
+ if (event->window == clist->clist_window &&
+ clist->drag_highlight_row >= 0)
+ GTK_CLIST_GET_CLASS (clist)->draw_drag_highlight
+ (clist, g_list_nth (clist->row_list,
+ clist->drag_highlight_row)->data,
+ clist->drag_highlight_row, clist->drag_highlight_pos);
}
return FALSE;
@@ -7483,6 +7492,7 @@ gtk_clist_drag_leave (GtkWidget *wi
(clist,
g_list_nth (clist->row_list, dest_info->cell.row)->data,
dest_info->cell.row, dest_info->insert_pos);
+ clist->drag_highlight_row = -1;
break;
}
list = list->next;
@@ -7573,6 +7583,9 @@ gtk_clist_drag_motion (GtkWidget *w
(clist, g_list_nth (clist->row_list,
dest_info->cell.row)->data,
dest_info->cell.row, dest_info->insert_pos);
+
+ clist->drag_highlight_row = dest_info->cell.row;
+ clist->drag_highlight_pos = dest_info->insert_pos;
gdk_drag_status (context, context->suggested_action, time);
}
Index: gtk/gtkclist.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkclist.h,v
retrieving revision 1.56
diff -u -p -r1.56 gtkclist.h
--- gtk/gtkclist.h 2001/02/03 01:09:39 1.56
+++ gtk/gtkclist.h 2001/04/20 15:54:11
@@ -239,6 +239,9 @@ struct _GtkCList
GtkSortType sort_type;
GtkCListCompareFunc compare;
gint sort_column;
+
+ gint drag_highlight_row;
+ GtkCListDragPos drag_highlight_pos;
};
struct _GtkCListClass
Index: gtk/gtkctree.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkctree.c,v
retrieving revision 1.83
diff -u -p -r1.83 gtkctree.c
--- gtk/gtkctree.c 2001/03/24 06:10:39 1.83
+++ gtk/gtkctree.c 2001/04/20 15:54:12
@@ -6084,6 +6084,9 @@ gtk_ctree_drag_motion (GtkWidget *w
g_list_nth (clist->row_list, dest_info->cell.row)->data,
dest_info->cell.row, dest_info->insert_pos);
+ clist->drag_highlight_row = dest_info->cell.row;
+ clist->drag_highlight_pos = dest_info->insert_pos;
+
gdk_drag_status (context, context->suggested_action, time);
}
return TRUE;
On every expose of the family clist in the font selector the currently
selected row is moved into view. This means you can't scroll the family
list. This patch just disables that behaviour. Why was it there?
Index: gtk/gtkfontsel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfontsel.c,v
retrieving revision 1.47
diff -u -p -r1.47 gtkfontsel.c
--- gtk/gtkfontsel.c 2001/03/24 06:10:39 1.47
+++ gtk/gtkfontsel.c 2001/04/20 15:54:12
@@ -288,9 +288,6 @@ gtk_font_selection_init(GtkFontSelection
gtk_signal_connect (GTK_OBJECT (fontsel->font_clist), "key_press_event",
GTK_SIGNAL_FUNC(gtk_font_selection_on_clist_key_press),
fontsel);
- gtk_signal_connect_after (GTK_OBJECT (fontsel->font_clist), "expose_event",
- GTK_SIGNAL_FUNC(gtk_font_selection_expose_list),
- fontsel);
gtk_font_selection_show_available_styles (fontsel);
For scrollable notebook tabs at the left and right side of the notebook clicking
on the arrows doesn't correctly move the focus.
Index: gtk/gtknotebook.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtknotebook.c,v
retrieving revision 1.86
diff -u -p -r1.86 gtknotebook.c
--- gtk/gtknotebook.c 2001/04/01 07:32:39 1.86
+++ gtk/gtknotebook.c 2001/04/20 15:54:13
@@ -1005,12 +1005,19 @@ gtk_notebook_arrow_button_press (GtkNote
if (event->button == 1)
{
+ GtkDirectionType dir;
if (!notebook->focus_tab ||
gtk_notebook_search_page (notebook, notebook->focus_tab,
arrow == GTK_ARROW_LEFT ? STEP_PREV : STEP_NEXT,
TRUE))
- gtk_container_focus (GTK_CONTAINER (notebook),
- arrow == GTK_ARROW_LEFT ? GTK_DIR_LEFT : GTK_DIR_RIGHT);
+ {
+ if (notebook->tab_pos == GTK_POS_LEFT ||
+ notebook->tab_pos == GTK_POS_RIGHT)
+ dir = (arrow == GTK_ARROW_LEFT) ? GTK_DIR_UP : GTK_DIR_DOWN;
+ else
+ dir = (arrow == GTK_ARROW_LEFT) ? GTK_DIR_LEFT : GTK_DIR_RIGHT;
+ gtk_container_focus (GTK_CONTAINER (notebook), dir);
+ }
if (!notebook->timer)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]