diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 20:10:15 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 20:10:15 +0000 |
commit | b2ba996f96dfd3bde403fce818258d97e3ca8002 (patch) | |
tree | 36f4f264fc2c8af5e6695ef31ac78afb7ebdc5c2 /chrome/common/gtk_util.cc | |
parent | 92b24c11f42b31158cca43921eac16f33c98839c (diff) | |
download | chromium_src-b2ba996f96dfd3bde403fce818258d97e3ca8002.zip chromium_src-b2ba996f96dfd3bde403fce818258d97e3ca8002.tar.gz chromium_src-b2ba996f96dfd3bde403fce818258d97e3ca8002.tar.bz2 |
GTK: hook up drag and drop of browser actions (for reordering).
The changes are propagated across open chrome windows, but are not persisted between sessions yet.
BUG=26990
Review URL: http://codereview.chromium.org/463056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34272 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gtk_util.cc')
-rw-r--r-- | chrome/common/gtk_util.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc index c6c08e4..c9fce55 100644 --- a/chrome/common/gtk_util.cc +++ b/chrome/common/gtk_util.cc @@ -96,6 +96,22 @@ class GdkCursorCache { std::map<GdkCursorType, GdkCursor*> cursor_cache_; }; +// Expose event handler for a container that simply suppresses the default +// drawing and propagates the expose event to the container's children. +gboolean PaintNoBackground(GtkWidget* widget, + GdkEventExpose* event, + gpointer unused) { + GList* children = gtk_container_get_children(GTK_CONTAINER(widget)); + for (GList* item = children; item; item = item->next) { + gtk_container_propagate_expose(GTK_CONTAINER(widget), + GTK_WIDGET(item->data), + event); + } + g_list_free(children); + + return TRUE; +} + } // namespace namespace event_utils { @@ -619,4 +635,9 @@ void ApplyMessageDialogQuirks(GtkWidget* dialog) { } } +void SuppressDefaultPainting(GtkWidget* container) { + g_signal_connect(container, "expose-event", + G_CALLBACK(PaintNoBackground), NULL); +} + } // namespace gtk_util |