diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-04-05 20:53:29 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-04-05 20:53:29 +0800 |
commit | b3b66a73fca6da255a313862b68a147ec7fcf707 (patch) | |
tree | aa0e5b1152c4533063e3429d0b8c75e41a6ac570 /src | |
parent | 1a09e5e82379afe72911f7f1cdf407bed57813e9 (diff) | |
download | gsoc2013-epiphany-b3b66a73fca6da255a313862b68a147ec7fcf707.tar gsoc2013-epiphany-b3b66a73fca6da255a313862b68a147ec7fcf707.tar.gz gsoc2013-epiphany-b3b66a73fca6da255a313862b68a147ec7fcf707.tar.bz2 gsoc2013-epiphany-b3b66a73fca6da255a313862b68a147ec7fcf707.tar.lz gsoc2013-epiphany-b3b66a73fca6da255a313862b68a147ec7fcf707.tar.xz gsoc2013-epiphany-b3b66a73fca6da255a313862b68a147ec7fcf707.tar.zst gsoc2013-epiphany-b3b66a73fca6da255a313862b68a147ec7fcf707.zip |
Have a decent size for popups that doesnt specify it. Do not allow to drag
2003-04-05 Marco Pesenti Gritti <marco@it.gnome.org>
* src/bookmarks/ephy-bookmarks.h:
* src/bookmarks/ephy-node-view.c: (drag_motion_cb), (drag_drop_cb),
(drag_data_received_cb):
* src/ephy-window.c: (ephy_window_show):
Have a decent size for popups that doesnt specify it.
Do not allow to drag on special topics.
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks/ephy-bookmarks.h | 2 | ||||
-rw-r--r-- | src/bookmarks/ephy-node-view.c | 25 | ||||
-rw-r--r-- | src/ephy-window.c | 18 |
3 files changed, 39 insertions, 6 deletions
diff --git a/src/bookmarks/ephy-bookmarks.h b/src/bookmarks/ephy-bookmarks.h index 4c521fa2d..e31831c6f 100644 --- a/src/bookmarks/ephy-bookmarks.h +++ b/src/bookmarks/ephy-bookmarks.h @@ -52,7 +52,7 @@ typedef enum EPHY_BOOKMARKS_KEYWORD_ALL_PRIORITY, EPHY_BOOKMARKS_KEYWORD_SPECIAL_PRIORITY, EPHY_BOOKMARKS_KEYWORD_NORMAL_PRIORITY -} EphBookmarksKeywordPriority; +} EphyBookmarksKeywordPriority; struct EphyBookmarks { diff --git a/src/bookmarks/ephy-node-view.c b/src/bookmarks/ephy-node-view.c index 62184dd2e..d03de5a09 100644 --- a/src/bookmarks/ephy-node-view.c +++ b/src/bookmarks/ephy-node-view.c @@ -752,18 +752,34 @@ drag_motion_cb (GtkWidget *widget, guint time, EphyNodeView *view) { + EphyNode *node; GtkTreePath *path = NULL; GtkTreeViewDropPosition pos; + gboolean res; + EphyBookmarksKeywordPriority priority; g_signal_stop_emission_by_name (widget, "drag_motion"); - if (gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), - x, y, &path, &pos)) + res = gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), + x, y, &path, &pos); + if (!res) return TRUE; + + node = get_node_from_path (view, path); + + priority = ephy_node_get_property_int (node, EPHY_NODE_KEYWORD_PROP_PRIORITY); + + if (priority != EPHY_BOOKMARKS_KEYWORD_ALL_PRIORITY && + priority != EPHY_BOOKMARKS_KEYWORD_SPECIAL_PRIORITY) + { gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget), path, GTK_TREE_VIEW_DROP_INTO_OR_AFTER); gdk_drag_status (context, context->suggested_action, time); } + else + { + gdk_drag_status (context, 0, time); + } return TRUE; } @@ -778,6 +794,8 @@ drag_drop_cb (GtkWidget *widget, { GdkAtom target; + g_signal_stop_emission_by_name (widget, "drag_drop"); + target = gtk_drag_dest_find_target (widget, context, view->priv->drag_targets); @@ -786,8 +804,6 @@ drag_drop_cb (GtkWidget *widget, gtk_drag_get_data (widget, context, target, time); } - g_signal_stop_emission_by_name (widget, "drag_drop"); - return TRUE; } @@ -822,6 +838,7 @@ drag_data_received_cb (GtkWidget *widget, node, src_nodes); g_list_free (src_nodes); + } return TRUE; diff --git a/src/ephy-window.c b/src/ephy-window.c index e3a60f6a4..e5dfa26d4 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -938,11 +938,27 @@ ephy_window_show (GtkWidget *widget) !(window->priv->chrome_mask & EMBED_CHROME_OPENASFULLSCREEN) && !GTK_WIDGET_VISIBLE (widget)) { - ephy_state_add_window (GTK_WIDGET(window), + ephy_state_add_window (widget, "main_window", 600, 500); } + if ((window->priv->chrome_mask & EMBED_CHROME_OPENASPOPUP) && + !GTK_WIDGET_VISIBLE (widget)) + { + EphyTab *tab; + int width, height; + + tab = ephy_window_get_active_tab (EPHY_WINDOW (window)); + g_return_if_fail (tab != NULL); + + ephy_tab_get_size (tab, &width, &height); + if (width == -1 && height == -1) + { + gtk_window_resize (GTK_WINDOW (window), 600, 500); + } + } + GTK_WIDGET_CLASS (parent_class)->show (widget); } |