aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-01-01 01:13:43 +0800
committerXan Lopez <xan@igalia.com>2012-01-01 01:13:43 +0800
commitdf47810713fc8d292fce7ed2aacbc14bd221a378 (patch)
tree49f8d99777ac3e9089e016ba108603c98f866f40 /lib
parentca4ca66ad246d8554d8fe97ee4bb64c055ce5b33 (diff)
downloadgsoc2013-epiphany-df47810713fc8d292fce7ed2aacbc14bd221a378.tar
gsoc2013-epiphany-df47810713fc8d292fce7ed2aacbc14bd221a378.tar.gz
gsoc2013-epiphany-df47810713fc8d292fce7ed2aacbc14bd221a378.tar.bz2
gsoc2013-epiphany-df47810713fc8d292fce7ed2aacbc14bd221a378.tar.lz
gsoc2013-epiphany-df47810713fc8d292fce7ed2aacbc14bd221a378.tar.xz
gsoc2013-epiphany-df47810713fc8d292fce7ed2aacbc14bd221a378.tar.zst
gsoc2013-epiphany-df47810713fc8d292fce7ed2aacbc14bd221a378.zip
ephy-gui: remove unused method
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-gui.c83
-rw-r--r--lib/ephy-gui.h6
2 files changed, 0 insertions, 89 deletions
diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c
index aa3a18b40..b21e8724b 100644
--- a/lib/ephy-gui.c
+++ b/lib/ephy-gui.c
@@ -168,89 +168,6 @@ ephy_gui_menu_position_under_widget (GtkMenu *menu,
*push_in = FALSE;
}
-/**
- * ephy_gui_menu_position_under_widget:
- * @menu:
- * @x:
- * @y:
- * @push_in:
- * @user_data: a #GtkWidget which has to be contained in (a widget on) a #GtkToolbar
- *
- * Positions @menu under (or over, depending on space available) the
- * @user_data.
- */
-void
-ephy_gui_menu_position_on_toolbar (GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer user_data)
-{
- /* Adapted from gtktoolbar.c */
- GtkWidget *widget = GTK_WIDGET (user_data);
- GtkToolbar *toolbar;
- GtkRequisition req;
- GtkRequisition menu_req;
- GtkAllocation allocation;
- GdkWindow *window;
- GdkRectangle monitor;
- int monitor_num;
- GdkScreen *screen;
-
- g_return_if_fail (GTK_IS_WIDGET (widget));
-
- toolbar = GTK_TOOLBAR (gtk_widget_get_ancestor (widget, GTK_TYPE_TOOLBAR));
- g_return_if_fail (toolbar != NULL);
-
- gtk_widget_get_preferred_size (widget, &req, NULL);
- gtk_widget_get_preferred_size (GTK_WIDGET (menu), &menu_req, NULL);
-
- screen = gtk_widget_get_screen (GTK_WIDGET (menu));
- window = gtk_widget_get_window (widget);
- monitor_num = gdk_screen_get_monitor_at_window (screen, window);
- if (monitor_num < 0)
- monitor_num = 0;
- gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
-
- gtk_widget_get_allocation (widget, &allocation);
- gdk_window_get_origin (window, x, y);
- if (!gtk_widget_get_has_window (widget))
- {
- *x += allocation.x;
- *y += allocation.y;
- }
-
- if (gtk_orientable_get_orientation (GTK_ORIENTABLE (toolbar)) == GTK_ORIENTATION_HORIZONTAL)
- {
- if (gtk_widget_get_direction (GTK_WIDGET (toolbar)) == GTK_TEXT_DIR_LTR)
- *x += allocation.width - req.width;
- else
- *x += req.width - menu_req.width;
-
- if ((*y + allocation.height + menu_req.height) <= monitor.y + monitor.height)
- *y += allocation.height;
- else if ((*y - menu_req.height) >= monitor.y)
- *y -= menu_req.height;
- else if (monitor.y + monitor.height - (*y + allocation.height) > *y)
- *y += allocation.height;
- else
- *y -= menu_req.height;
- }
- else
- {
- if (gtk_widget_get_direction (GTK_WIDGET (toolbar)) == GTK_TEXT_DIR_LTR)
- *x += allocation.width;
- else
- *x -= menu_req.width;
-
- if (*y + menu_req.height > monitor.y + monitor.height &&
- *y + allocation.height - monitor.y > monitor.y + monitor.height - *y)
- *y += allocation.height - menu_req.height;
- }
-
- *push_in = FALSE;
-}
-
GtkWindowGroup *
ephy_gui_ensure_window_group (GtkWindow *window)
{
diff --git a/lib/ephy-gui.h b/lib/ephy-gui.h
index 3c8aa8f9b..505a7c591 100644
--- a/lib/ephy-gui.h
+++ b/lib/ephy-gui.h
@@ -47,12 +47,6 @@ void ephy_gui_menu_position_under_widget (GtkMenu *menu,
gboolean *push_in,
gpointer user_data);
-void ephy_gui_menu_position_on_toolbar (GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer user_data);
-
GtkWindowGroup *ephy_gui_ensure_window_group (GtkWindow *window);
void ephy_gui_get_current_event (GdkEventType *type,