1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

Merge interesting patches from GTK+ 2.6.8 to 2.6.10

git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1855 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
Ross Burton
2007-06-04 11:49:05 +00:00
parent 350603316e
commit 16b9beebed
9 changed files with 5243 additions and 636 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,77 @@
--- gtk+-2.6.8/gtk/gtkfilechooserdialog.c.orig 2007-02-09 12:18:25.000000000 +0000
+++ gtk+-2.6.8/gtk/gtkfilechooserdialog.c 2007-02-09 12:18:25.000000000 +0000
@@ -62,8 +62,6 @@
static void gtk_file_chooser_dialog_map (GtkWidget *widget);
static void gtk_file_chooser_dialog_unmap (GtkWidget *widget);
-static void gtk_file_chooser_dialog_style_set (GtkWidget *widget,
- GtkStyle *previous_style);
static void response_cb (GtkDialog *dialog,
gint response_id);
@@ -122,7 +120,6 @@
widget_class->map = gtk_file_chooser_dialog_map;
widget_class->unmap = gtk_file_chooser_dialog_unmap;
- widget_class->style_set = gtk_file_chooser_dialog_style_set;
_gtk_file_chooser_install_properties (gobject_class);
@@ -135,13 +132,19 @@
GtkFileChooserDialogPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
GTK_TYPE_FILE_CHOOSER_DIALOG,
GtkFileChooserDialogPrivate);
+
+ GtkDialog *fc_dialog = GTK_DIALOG (dialog);
+
dialog->priv = priv;
dialog->priv->default_width = -1;
dialog->priv->default_height = -1;
dialog->priv->resize_horizontally = TRUE;
dialog->priv->resize_vertically = TRUE;
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+ gtk_dialog_set_has_separator (fc_dialog, FALSE);
+ gtk_container_set_border_width (GTK_CONTAINER (fc_dialog), 5);
+ gtk_box_set_spacing (GTK_BOX (fc_dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (fc_dialog->action_area), 5);
/* We do a signal connection here rather than overriding the method in
* class_init because GtkDialog::response is a RUN_LAST signal. We want *our*
@@ -394,6 +397,7 @@
g_signal_connect (priv->widget, "default-size-changed",
G_CALLBACK (file_chooser_widget_default_size_changed), object);
+ gtk_container_set_border_width (GTK_CONTAINER (priv->widget), 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox), priv->widget, TRUE, TRUE, 0);
gtk_widget_show (priv->widget);
@@ -522,28 +526,6 @@
gtk_widget_unmap (priv->widget);
}
-static void
-gtk_file_chooser_dialog_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
-{
- GtkDialog *dialog;
-
- if (GTK_WIDGET_CLASS (parent_class)->style_set)
- GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style);
-
- dialog = GTK_DIALOG (widget);
-
- /* Override the style properties with HIG-compliant spacings. Ugh.
- * http://developer.gnome.org/projects/gup/hig/1.0/layout.html#layout-dialogs
- * http://developer.gnome.org/projects/gup/hig/1.0/windows.html#alert-spacing
- */
-
- gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), 12);
- gtk_box_set_spacing (GTK_BOX (dialog->vbox), 24);
-
- gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 0);
- gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
-}
/* GtkDialog::response handler */
static void
+182
View File
@@ -0,0 +1,182 @@
--- gtk+-2.6.8/gtk/gtkfilesystemunix.c.orig 2007-02-08 12:01:19.000000000 +0000
+++ gtk+-2.6.8/gtk/gtkfilesystemunix.c 2007-02-08 12:01:19.000000000 +0000
@@ -33,6 +33,7 @@
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
+#include <sys/statvfs.h>
#include <sys/types.h>
#include <pwd.h>
#ifdef HAVE_UNISTD_H
@@ -358,7 +359,49 @@
static GSList *
gtk_file_system_unix_list_volumes (GtkFileSystem *file_system)
{
- return g_slist_append (NULL, get_root_volume ());
+ struct statvfs stv;
+ struct stat st;
+ GSList * l = g_slist_append (NULL, get_root_volume ());
+
+ if (!statvfs ("/.", &stv))
+ {
+ fsblkcnt_t root_blocks = stv.f_blocks;
+ fsfilcnt_t root_files = stv.f_files;
+
+ GDir * dir;
+ if ((dir = g_dir_open ("/media", 0, NULL)) != NULL)
+ {
+ const gchar * name;
+ while ((name = g_dir_read_name (dir)) != NULL)
+ {
+ gchar * abs_name = g_strconcat ("/media/", name, NULL);
+
+ if (!stat (abs_name, &st) && S_ISDIR (st.st_mode))
+ {
+ gchar * dot = g_strconcat (abs_name, "/.", NULL);
+ if (!statvfs (dot, &stv) &&
+ (stv.f_blocks != root_blocks ||
+ stv.f_files != root_files))
+ {
+ GtkFilePath * path =
+ gtk_file_system_filename_to_path (file_system,
+ abs_name);
+
+ if (path)
+ l = g_slist_append (l, path);
+ }
+
+ g_free (dot);
+ }
+
+ g_free (abs_name);
+ }
+
+ g_dir_close (dir);
+ }
+ }
+
+ return l;
}
static GtkFileSystemVolume *
@@ -375,10 +418,15 @@
len = strlen (filename);
- if (len > 1 && filename[len - 1] == '/')
- return g_strndup (filename, len - 1);
- else
- return g_memdup (filename, len + 1);
+ if (len > 1)
+ {
+ gchar *c = g_utf8_prev_char (filename + len);
+
+ if (c && *c == '/')
+ return g_strndup (filename, len - 1);
+ }
+
+ return g_memdup (filename, len + 1);
}
static GtkFileFolder *
@@ -590,7 +638,7 @@
gtk_file_system_unix_volume_get_base_path (GtkFileSystem *file_system,
GtkFileSystemVolume *volume)
{
- return gtk_file_path_new_dup ("/");
+ return gtk_file_path_copy ((GtkFilePath*)volume);
}
static gboolean
@@ -616,7 +664,32 @@
gtk_file_system_unix_volume_get_display_name (GtkFileSystem *file_system,
GtkFileSystemVolume *volume)
{
- return g_strdup (_("Filesystem")); /* Same as Nautilus */
+ gchar * slash;
+ gchar * path;
+ gchar * c;
+
+ g_return_val_if_fail (file_system && volume, NULL);
+
+ path = gtk_file_system_path_to_filename (file_system, (GtkFilePath*) volume);
+
+ g_return_val_if_fail (path && *path, NULL);
+
+ if (path[0] == '/' && !path[1])
+ return g_strdup (_("Filesystem")); /* Same as Nautilus */
+
+ /* Now the media volumes */
+ /* strip trailing / if any */
+ c = g_utf8_prev_char (path + strlen(path));
+
+ if (*c == '/')
+ *c = 0;
+
+ slash = g_utf8_strrchr (path, -1, '/');
+
+ if (!slash)
+ return g_strdup (path);
+
+ return g_strdup (slash + 1);
}
static IconType
@@ -787,11 +860,54 @@
GError **error)
{
GdkPixbuf *pixbuf;
+ gchar * slash;
+ gchar * path;
+ gchar * c;
+ const gchar * id = NULL;
+
+ g_return_val_if_fail (file_system && volume, NULL);
+
+ path = gtk_file_system_path_to_filename (file_system, (GtkFilePath*) volume);
- pixbuf = get_cached_icon (widget, "gnome-fs-blockdev", pixel_size);
- if (pixbuf)
- return pixbuf;
+ g_return_val_if_fail (path && *path, NULL);
+
+ if (path[0] == '/' && !path[1])
+ id = "gnome-fs-blockdev";
+ else
+ {
+ /* Now the media volumes */
+ /* strip trailing / if any */
+ c = g_utf8_prev_char (path + strlen(path));
+
+ if (*c == '/')
+ *c = 0;
+
+ slash = g_utf8_strrchr (path, -1, '/');
+ if (slash)
+ {
+ slash++;
+
+ if (!strcmp (slash, "card"))
+ id = "gnome-dev-media-sdmmc";
+ else if (!strcmp (slash, "cf"))
+ id = "gnome-dev-media-cf";
+ else if (!strncmp (slash, "mmc", 3))
+ id = "gnome-dev-media-sdmmc";
+ else if (!strcmp (slash, "usbhdd"))
+ id = "gnome-dev-removable-usb";
+ else
+ id = "gnome-dev-removable";
+ }
+ }
+
+ if (id)
+ {
+ pixbuf = get_cached_icon (widget, id, pixel_size);
+ if (pixbuf)
+ return pixbuf;
+ }
+
pixbuf = get_fallback_icon (widget, ICON_BLOCK_DEVICE, error);
g_assert (pixbuf != NULL);
-158
View File
@@ -1,158 +0,0 @@
diff -NaurBb gtk+-2.6.10.old/gtk/Makefile.am gtk+-2.6.10/gtk/Makefile.am
--- gtk+-2.6.10.old/gtk/Makefile.am 2005-08-18 16:10:56.000000000 +0200
+++ gtk+-2.6.10/gtk/Makefile.am 2005-12-29 01:23:52.000000000 +0100
@@ -520,6 +520,7 @@
gtkwidget.c \
gtkwindow-decorate.c \
gtkwindow.c \
+ gpe-what.c \
xembed.h
if OS_UNIX
diff -NaurBb gtk+-2.6.10.old/gtk/gpe-what.c gtk+-2.6.10/gtk/gpe-what.c
--- gtk+-2.6.10.old/gtk/gpe-what.c 1970-01-01 01:00:00.000000000 +0100
+++ gtk+-2.6.10/gtk/gpe-what.c 2005-12-29 00:59:26.000000000 +0100
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2002, 2003 Philip Blundell <philb@gnu.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
+#ifdef GDK_WINDOWING_X11
+#error X11 required
+#endif
+
+#include "gtkwidget.h"
+#include "gtktooltips.h"
+#include "x11/gdkx.h"
+#include "config.h"
+
+#include <libintl.h>
+
+#define _(x) dgettext(GETTEXT_PACKAGE, x)
+
+static GdkAtom help_atom;
+static gboolean gpe_what_initialised;
+
+static GSList *widgets;
+
+static void
+send_text (Display *dpy, Window w, char *text)
+{
+ Atom help_xatom = gdk_x11_atom_to_xatom (help_atom);
+
+ gdk_error_trap_push ();
+
+ XChangeProperty (dpy, w, help_xatom, XA_STRING, 8, PropModeReplace, text, strlen (text));
+
+ XFlush (dpy);
+
+ gdk_error_trap_pop ();
+}
+
+static GdkFilterReturn
+filter_func (GdkXEvent *xev, GdkEvent *ev, gpointer p)
+{
+ XClientMessageEvent *xc = (XClientMessageEvent *)xev;
+ GSList *list;
+ Window sender = xc->data.l[0];
+
+ for (list = widgets; list; list = list->next)
+ {
+ GtkWidget *widget = GTK_WIDGET (list->data);
+ int x = xc->data.l[1], y = xc->data.l[2];
+ int ax, ay;
+
+ if (!GTK_WIDGET_DRAWABLE (widget)) continue;
+
+ if (GTK_WIDGET_NO_WINDOW (widget))
+ {
+ ax = widget->allocation.x;
+ ay = widget->allocation.y;
+ }
+ else
+ {
+ ax = 0;
+ ay = 0;
+ }
+
+ if (widget->window == ev->any.window
+ && x >= ax && x < ax + widget->allocation.width
+ && y >= ay && y < ay + widget->allocation.height)
+ {
+ GtkTooltipsData *data = gtk_tooltips_data_get (widget);
+ if (data)
+ {
+ send_text (GDK_WINDOW_XDISPLAY (widget->window), sender,
+ data->tip_private ? data->tip_private : data->tip_text);
+ return GDK_FILTER_CONTINUE;
+ }
+ }
+ }
+
+ send_text (GDK_WINDOW_XDISPLAY (ev->any.window), sender, _("No help available."));
+
+ return GDK_FILTER_CONTINUE;
+}
+
+void
+gpe_what_mark_widget (GtkWidget *widget)
+{
+ if (!gpe_what_initialised)
+ {
+ help_atom = gdk_atom_intern ("_GPE_INTERACTIVE_HELP", FALSE);
+
+ gdk_add_client_message_filter (help_atom, filter_func, NULL);
+
+ gpe_what_initialised = TRUE;
+ }
+
+ if (widget->window)
+ {
+ widgets = g_slist_prepend (widgets, widget);
+
+ gdk_property_change (widget->window,
+ help_atom,
+ help_atom,
+ 8,
+ GDK_PROP_MODE_REPLACE,
+ NULL,
+ 0);
+ }
+ else
+ abort ();
+}
diff -NaurBb gtk+-2.6.10.old/gtk/gtkwidget.c gtk+-2.6.10/gtk/gtkwidget.c
--- gtk+-2.6.10.old/gtk/gtkwidget.c 2005-08-18 16:10:59.000000000 +0200
+++ gtk+-2.6.10/gtk/gtkwidget.c 2005-12-29 00:59:26.000000000 +0100
@@ -2285,6 +2285,9 @@
g_signal_emit (widget, widget_signals[REALIZE], 0);
+ extern void gpe_what_mark_widget (GtkWidget *widget);
+ gpe_what_mark_widget (widget);
+
if (GTK_WIDGET_HAS_SHAPE_MASK (widget))
{
shape_info = g_object_get_qdata (G_OBJECT (widget), quark_shape_info);
-22
View File
@@ -1,22 +0,0 @@
#
# This patch improves menu styling (based on version in 2.7.0
# which features a background pixmap for the menu). ---Mickey.
#
--- gtk+-2.6.10/gtk/gtkmenu.c 2005-08-18 16:10:58.000000000 +0200
+++ gtk+-2.7.0/gtk/gtkmenu.c 2005-04-07 21:56:57.000000000 +0200
@@ -2490,6 +2495,15 @@
arrow_size, arrow_size);
}
}
+ else if (event->window == menu->bin_window)
+ {
+ gtk_paint_box (widget->style,
+ menu->bin_window,
+ GTK_STATE_NORMAL,
+ GTK_SHADOW_OUT,
+ NULL, widget, "menu",
+ -border_x, -border_y, width, height);
+ }
}
static gboolean
-54
View File
@@ -1,54 +0,0 @@
diff -urNd ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkcalendar.c gtk+-2.6.3/gtk/gtkcalendar.c
--- ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkcalendar.c 2005-04-06 16:57:04 +01:00
+++ gtk+-2.6.3/gtk/gtkcalendar.c 2005-04-06 20:05:18 +01:00
@@ -1023,9 +1023,11 @@
}
gtk_calendar_select_and_focus_day (calendar, day);
- }
+
+ // This change causes the calendar to disappear after choosing a day
+/* }
else if (event->type == GDK_2BUTTON_PRESS)
- {
+ {*/
private_data->in_drag = 0;
if (day_month == MONTH_CURRENT)
g_signal_emit (calendar,
diff -urNd ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkfilesel.c gtk+-2.6.3/gtk/gtkfilesel.c
--- ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkfilesel.c 2005-04-06 16:57:07 +01:00
+++ gtk+-2.6.3/gtk/gtkfilesel.c 2005-04-07 13:40:32 +01:00
@@ -2468,6 +2468,33 @@
if (fs->last_selected != NULL)
g_free (fs->last_selected);
+ // Single-click directory entry
+ if (new_names->len == 1)
+ {
+ GtkTreeView *tree_view;
+ GtkTreeModel *model;
+ GtkTreePath *path;
+ GtkTreeIter iter;
+ gboolean is_file;
+
+ tree_view = gtk_tree_selection_get_tree_view (selection);
+
+ if (gtk_tree_selection_get_selected (selection, &model, &iter))
+ {
+ path = gtk_tree_model_get_path (model, &iter);
+ gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1);
+
+ if (!is_file)
+ {
+ gtk_file_selection_dir_activate (tree_view, path,
+ gtk_tree_view_get_column (tree_view, DIR_COLUMN),
+ user_data);
+ }
+
+ gtk_tree_path_free (path);
+ }
+ }
+
fs->last_selected = g_strdup (g_ptr_array_index (new_names, index));
filename = get_real_filename (fs->last_selected, FALSE);
-267
View File
@@ -1,267 +0,0 @@
diff -urNd ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c gtk+-2.4.4/gtk/gtkfilesel.c
--- ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c 2004-07-10 05:02:10.000000000 +0100
+++ gtk+-2.4.4/gtk/gtkfilesel.c 2004-09-13 13:40:09.000000000 +0100
@@ -68,6 +68,7 @@
#include "gtkprivate.h"
#include "gtkscrolledwindow.h"
#include "gtkstock.h"
+#include "gtksignal.h"
#include "gtktreeselection.h"
#include "gtktreeview.h"
#include "gtkvbox.h"
@@ -77,6 +78,7 @@
#include "gtkmessagedialog.h"
#include "gtkdnd.h"
#include "gtkeventbox.h"
+#include "gtkimage.h"
#undef GTK_DISABLE_DEPRECATED
#include "gtkoptionmenu.h"
@@ -245,7 +247,8 @@
};
enum {
- DIR_COLUMN
+ DIR_COLUMN,
+ ISFILE_COLUMN
};
enum {
@@ -400,6 +403,12 @@
GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer user_data);
+
+static void gtk_file_selection_activate (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data);
+
static void gtk_file_selection_file_changed (GtkTreeSelection *selection,
gpointer user_data);
static void gtk_file_selection_dir_activate (GtkTreeView *tree_view,
@@ -419,6 +428,7 @@
static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data);
static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data);
static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data);
+static void gtk_file_selection_style_set (GtkWidget *widget, GtkStyle *prev_style);
static void free_selected_names (GPtrArray *names);
@@ -578,6 +588,23 @@
G_PARAM_WRITABLE));
object_class->destroy = gtk_file_selection_destroy;
widget_class->map = gtk_file_selection_map;
+ widget_class->style_set = gtk_file_selection_style_set;
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("show_fileops_default",
+ _("Show fileop buttons by default"),
+ _("Whether file operation buttons are shown by default"),
+ TRUE,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("border_width",
+ _("Border width"),
+ _("Width of border around the main dialog area"),
+ 0,
+ G_MAXINT,
+ 10,
+ G_PARAM_READABLE));
}
static void gtk_file_selection_set_property (GObject *object,
@@ -649,7 +676,29 @@
gtk_widget_grab_default (widget);
return FALSE;
}
-
+
+static void
+gtk_file_selection_style_set (GtkWidget *filesel,
+ GtkStyle *prev_style)
+{
+ gboolean show_fileops;
+ gint border_width;
+
+ gtk_widget_style_get (filesel,
+ "show_fileops_default",
+ &show_fileops,
+ "border_width",
+ &border_width,
+ NULL);
+
+ gtk_container_set_border_width (GTK_CONTAINER (filesel), border_width);
+
+ if (show_fileops)
+ gtk_file_selection_show_fileop_buttons (GTK_FILE_SELECTION (filesel));
+ else
+ gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (filesel));
+}
+
static void
gtk_file_selection_init (GtkFileSelection *filesel)
{
@@ -674,17 +723,15 @@
/* The dialog-sized vertical box */
filesel->main_vbox = dialog->vbox;
- gtk_container_set_border_width (GTK_CONTAINER (filesel), 10);
/* The horizontal box containing create, rename etc. buttons */
filesel->button_area = gtk_hbutton_box_new ();
gtk_button_box_set_layout (GTK_BUTTON_BOX (filesel->button_area), GTK_BUTTONBOX_START);
- gtk_box_set_spacing (GTK_BOX (filesel->button_area), 0);
gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area,
FALSE, FALSE, 0);
gtk_widget_show (filesel->button_area);
- gtk_file_selection_show_fileop_buttons (filesel);
+ gtk_file_selection_style_set (GTK_WIDGET (filesel), NULL);
/* hbox for pulldown menu */
pulldown_hbox = gtk_hbox_new (TRUE, 5);
@@ -723,25 +770,32 @@
/* The directories list */
- model = gtk_list_store_new (1, G_TYPE_STRING);
+ model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN); /* MA */
filesel->dir_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
g_object_unref (model);
- column = gtk_tree_view_column_new_with_attributes (_("Folders"),
+ column = gtk_tree_view_column_new_with_attributes (/*_("Folders")*/ NULL,
gtk_cell_renderer_text_new (),
"text", DIR_COLUMN,
NULL);
label = gtk_label_new_with_mnemonic (_("Fol_ders"));
gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->dir_list);
gtk_widget_show (label);
- gtk_tree_view_column_set_widget (column, label);
+
+ /* gtk_tree_view_column_set_widget (column, label); */
+ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (filesel->dir_list), FALSE);
+
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->dir_list), column);
gtk_widget_set_size_request (filesel->dir_list,
DIR_LIST_WIDTH, DIR_LIST_HEIGHT);
g_signal_connect (filesel->dir_list, "row_activated",
- G_CALLBACK (gtk_file_selection_dir_activate), filesel);
+ G_CALLBACK (gtk_file_selection_activate), filesel);
+
+ g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->dir_list)), "changed",
+ G_CALLBACK (gtk_file_selection_file_changed), filesel);
+
/* gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); */
@@ -758,41 +812,6 @@
gtk_widget_show (filesel->dir_list);
gtk_widget_show (scrolled_win);
- /* The files list */
- model = gtk_list_store_new (1, G_TYPE_STRING);
- filesel->file_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
- g_object_unref (model);
-
- column = gtk_tree_view_column_new_with_attributes (_("Files"),
- gtk_cell_renderer_text_new (),
- "text", FILE_COLUMN,
- NULL);
- label = gtk_label_new_with_mnemonic (_("_Files"));
- gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->file_list);
- gtk_widget_show (label);
- gtk_tree_view_column_set_widget (column, label);
- gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
- gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->file_list), column);
-
- gtk_widget_set_size_request (filesel->file_list,
- FILE_LIST_WIDTH, FILE_LIST_HEIGHT);
- g_signal_connect (filesel->file_list, "row_activated",
- G_CALLBACK (gtk_file_selection_file_activate), filesel);
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->file_list)), "changed",
- G_CALLBACK (gtk_file_selection_file_changed), filesel);
-
- /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); */
-
- scrolled_win = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN);
- gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
- gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 0);
- gtk_container_add (GTK_CONTAINER (list_container), scrolled_win);
- gtk_widget_show (filesel->file_list);
- gtk_widget_show (scrolled_win);
-
/* action area for packing buttons into. */
filesel->action_area = gtk_hbox_new (TRUE, 0);
gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area,
@@ -2008,6 +2027,23 @@
}
static void
+gtk_file_selection_activate (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data)
+{
+ GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
+ GtkTreeIter iter;
+ gboolean is_file;
+
+ gtk_tree_model_get_iter (model, &iter, path);
+ gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1);
+
+ if (! is_file)
+ gtk_file_selection_dir_activate (tree_view, path, column, user_data);
+}
+
+static void
gtk_file_selection_file_activate (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column,
@@ -2103,7 +2139,6 @@
PossibleCompletion* poss;
GtkTreeIter iter;
GtkListStore *dir_model;
- GtkListStore *file_model;
gchar* filename;
gchar* rem_path = rel_path;
gchar* sel_text;
@@ -2125,10 +2160,8 @@
g_assert (cmpl_state->reference_dir);
dir_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->dir_list)));
- file_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->file_list)));
gtk_list_store_clear (dir_model);
- gtk_list_store_clear (file_model);
/* Set the dir list to include ./ and ../ */
gtk_list_store_append (dir_model, &iter);
@@ -2150,13 +2183,17 @@
strcmp (filename, ".." G_DIR_SEPARATOR_S) != 0)
{
gtk_list_store_append (dir_model, &iter);
- gtk_list_store_set (dir_model, &iter, DIR_COLUMN, filename, -1);
+ gtk_list_store_set (dir_model, &iter,
+ DIR_COLUMN, filename,
+ ISFILE_COLUMN, FALSE, -1);
}
}
else
{
- gtk_list_store_append (file_model, &iter);
- gtk_list_store_set (file_model, &iter, DIR_COLUMN, filename, -1);
+ gtk_list_store_append (dir_model, &iter);
+ gtk_list_store_set (dir_model, &iter,
+ DIR_COLUMN, filename,
+ ISFILE_COLUMN, TRUE, -1);
}
}
-128
View File
@@ -1,128 +0,0 @@
--- gtk+-2.4.3/gtk/gtkspinbutton.c.old 2004-04-22 14:49:27.000000000 +0100
+++ gtk+-2.4.3/gtk/gtkspinbutton.c 2004-06-30 21:48:18.000000000 +0100
@@ -733,7 +733,7 @@
spin = GTK_SPIN_BUTTON (widget);
arrow_size = spin_button_get_arrow_size (spin);
- panel_width = arrow_size + 2 * widget->style->xthickness;
+ panel_width = (2 * arrow_size) + 4 * widget->style->xthickness;
widget->allocation = *allocation;
@@ -866,19 +866,16 @@
{
width = spin_button_get_arrow_size (spin_button) + 2 * widget->style->xthickness;
+ y = widget->style->ythickness;
+ height = widget->requisition.height - (2 * y);
+
if (arrow_type == GTK_ARROW_UP)
{
x = 0;
- y = 0;
-
- height = widget->requisition.height / 2;
}
else
{
- x = 0;
- y = widget->requisition.height / 2;
-
- height = (widget->requisition.height + 1) / 2;
+ x = width;
}
if (spin_button_at_limit (spin_button, arrow_type))
@@ -908,32 +905,17 @@
shadow_type = GTK_SHADOW_OUT;
}
}
-
+
gtk_paint_box (widget->style, spin_button->panel,
state_type, shadow_type,
NULL, widget,
- (arrow_type == GTK_ARROW_UP)? "spinbutton_up" : "spinbutton_down",
+ NULL,
x, y, width, height);
height = widget->requisition.height;
- if (arrow_type == GTK_ARROW_DOWN)
- {
- y = height / 2;
- height = height - y - 2;
- }
- else
- {
- y = 2;
- height = height / 2 - 2;
- }
-
width -= 3;
-
- if (widget && gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- x = 2;
- else
- x = 1;
+ height -= 3;
w = width / 2;
w -= w % 2 - 1; /* force odd */
@@ -1108,7 +1090,7 @@
if (GTK_ENTRY (widget)->editable)
gtk_spin_button_update (spin);
- if (event->y <= widget->requisition.height / 2)
+ if (event->x <= (spin_button_get_arrow_size (spin) + widget->style->xthickness))
{
if (event->button == 1)
start_spinning (spin, GTK_ARROW_UP, spin->adjustment->step_increment);
@@ -1143,44 +1125,11 @@
arrow_size = spin_button_get_arrow_size (spin);
- if (event->button == spin->button)
- {
- int click_child = spin->click_child;
+ gtk_spin_button_stop_spinning (spin);
- gtk_spin_button_stop_spinning (spin);
-
- if (event->button == 3)
- {
- if (event->y >= 0 && event->x >= 0 &&
- event->y <= widget->requisition.height &&
- event->x <= arrow_size + 2 * widget->style->xthickness)
- {
- if (click_child == GTK_ARROW_UP &&
- event->y <= widget->requisition.height / 2)
- {
- gdouble diff;
-
- diff = spin->adjustment->upper - spin->adjustment->value;
- if (diff > EPSILON)
- gtk_spin_button_real_spin (spin, diff);
- }
- else if (click_child == GTK_ARROW_DOWN &&
- event->y > widget->requisition.height / 2)
- {
- gdouble diff;
-
- diff = spin->adjustment->value - spin->adjustment->lower;
- if (diff > EPSILON)
- gtk_spin_button_real_spin (spin, -diff);
- }
- }
- }
- spin_button_redraw (spin);
+ spin_button_redraw (spin);
- return TRUE;
- }
- else
- return GTK_WIDGET_CLASS (parent_class)->button_release_event (widget, event);
+ return TRUE;
}
static gint
+4 -7
View File
@@ -8,22 +8,19 @@ DEPENDS = "glib-2.0 pango atk jpeg libpng libxext libxcursor gtk-doc libgcrypt"
PR = "r5"
SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.6/gtk+-${PV}.tar.bz2 \
file://help.patch;patch=1 \
file://no-demos.patch;patch=1 \
file://no-xwc.patch;patch=1 \
file://automake-lossage.patch;patch=1 \
file://gtk+-handhelds.patch;patch=1 \
file://spinbutton.patch;patch=1 \
file://hardcoded_libtool.patch;patch=1 \
file://disable-tooltips.patch;patch=1 \
file://gtklabel-resize-patch;patch=1 \
file://menu-deactivate.patch;patch=1 \
file://xsettings.patch;patch=1 \
file://scroll-timings.patch;patch=1 \
file://small-gtkfilesel.patch;patch=1 \
file://migration.patch;patch=1;pnum=0 \
file://single-click.patch;patch=1 \
file://menu-styling.patch;patch=1"
file://filesystem-volumes.patch;patch=1 \
file://filechooser-respect-style.patch;patch=1 \
file://filechooser-default.patch;patch=1 \
"
inherit autotools pkgconfig