Esempio n. 1
0
static gboolean
tab_panel_toolitem_button_press_event_cb (GtkToolItem*    toolitem,
                                          GdkEventButton* event,
                                          GtkWidget*      view)
{
    if (MIDORI_EVENT_CONTEXT_MENU (event))
    {
        tab_panel_popup (GTK_WIDGET (toolitem), event, view);
        return TRUE;
    }

    return FALSE;
}
Esempio n. 2
0
static gboolean
tab_panel_toolitem_button_press_event_cb (GtkToolItem*    toolitem,
                                          GdkEventButton* event,
                                          GtkWidget*      view)
{
    if (event->button == 3)
    {
        tab_panel_popup (GTK_WIDGET (toolitem), event, view);
        return TRUE;
    }

    return FALSE;
}
Esempio n. 3
0
static void
midori_extension_popup_menu_cb (GtkWidget*       widget,
                                MidoriExtension* extension)
{
    GtkTreeModel* model;
    GtkTreeIter iter;

    if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (widget), &model, &iter))
    {
        GtkWidget* view;

        gtk_tree_model_get (model, &iter, 0, &view, -1);
        tab_panel_popup (widget, NULL, view);
        g_object_unref (view);
    }
}
Esempio n. 4
0
static gboolean
midori_extension_button_release_event_cb (GtkWidget*       widget,
                                          GdkEventButton*  event,
                                          MidoriExtension* extension)
{
    GtkTreeModel* model;
    GtkTreeIter iter;

    if (event->button < 1 || event->button > 3)
        return FALSE;

    if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (widget), &model, &iter))
    {
        GtkWidget* view;

        gtk_tree_model_get (model, &iter, 0, &view, -1);

        if (event->button == 1)
        {
            MidoriBrowser* browser = midori_browser_get_for_widget (widget);
            GtkTreeViewColumn* column;
            if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
                event->x, event->y, NULL, &column, NULL, NULL)
                && column == gtk_tree_view_get_column (GTK_TREE_VIEW (widget), 1))
                midori_browser_remove_tab (browser, view);
            else
                midori_browser_set_current_tab (browser, view);
        }
        else if (event->button == 2)
            midori_browser_remove_tab (midori_browser_get_for_widget (widget), view);
        else
            tab_panel_popup (widget, event, view);

        g_object_unref (view);
        return TRUE;
    }
    return FALSE;
}