~midori/midori/trunk

« back to all changes in this revision

Viewing changes to midori/midori-locationaction.c

  • Committer: Tarmac
  • Author(s): Christian Dywan
  • Date: 2013-06-22 16:01:42 UTC
  • mfrom: (6220.1.9 midori.gtk2.24)
  • Revision ID: tarmac-20130622160142-4izekhkhw2n4e4o4
Bump GTK+ requirement to 2.24 and drop support for earlier versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
945
945
    #if GTK_CHECK_VERSION (3, 6, 0)
946
946
    gtk_entry_set_input_purpose (GTK_ENTRY (entry), GTK_INPUT_PURPOSE_URL);
947
947
    #endif
948
 
    gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (entry),
949
 
         GTK_ICON_ENTRY_PRIMARY, TRUE);
950
 
    gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (entry),
951
 
         GTK_ICON_ENTRY_SECONDARY, TRUE);
 
948
    gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
 
949
         GTK_ENTRY_ICON_PRIMARY, TRUE);
 
950
    gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
 
951
         GTK_ENTRY_ICON_SECONDARY, TRUE);
952
952
 
953
953
    targetlist = gtk_target_list_new (NULL, 0);
954
954
    gtk_target_list_add_uri_targets (targetlist, 0);
1235
1235
    return FALSE;
1236
1236
}
1237
1237
 
1238
 
#if GTK_CHECK_VERSION (2, 19, 3)
1239
1238
static void
1240
1239
midori_location_action_preedit_changed_cb (GtkWidget*   entry,
1241
1240
                                           const gchar* preedit,
1245
1244
    gchar* key = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
1246
1245
    midori_location_action_popup_completion (location_action, entry, key);
1247
1246
}
1248
 
#endif
1249
1247
 
1250
1248
static gboolean
1251
1249
midori_location_action_focus_in_event_cb (GtkWidget*   widget,
1450
1448
    /* The dialog should "toggle" like a menu, as far as users go
1451
1449
       FIXME: Half-working: the dialog closes but re-opens */
1452
1450
    static GtkWidget* dialog = NULL;
1453
 
    if (icon_pos == GTK_ICON_ENTRY_PRIMARY && dialog != NULL)
 
1451
    if (icon_pos == GTK_ENTRY_ICON_PRIMARY && dialog != NULL)
1454
1452
        gtk_widget_destroy (dialog);
1455
1453
 
1456
 
    if (icon_pos == GTK_ICON_ENTRY_PRIMARY)
 
1454
    if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
1457
1455
    {
1458
1456
        /* No "security" window for blank pages */
1459
1457
        if (midori_uri_is_blank (MIDORI_LOCATION_ACTION (action)->text))
1501
1499
        g_signal_connect (dialog, "destroy", G_CALLBACK (gtk_widget_destroyed), &dialog);
1502
1500
        gtk_widget_show_all (dialog);
1503
1501
    }
1504
 
    if (icon_pos == GTK_ICON_ENTRY_SECONDARY)
 
1502
    if (icon_pos == GTK_ENTRY_ICON_SECONDARY)
1505
1503
    {
1506
1504
        gboolean result;
1507
1505
        g_signal_emit (action, signals[SECONDARY_ICON_RELEASED], 0,
1578
1576
                      midori_location_action_button_press_event_cb, action,
1579
1577
                      "signal::key-press-event",
1580
1578
                      midori_location_action_key_press_event_cb, action,
1581
 
                      #if GTK_CHECK_VERSION (2, 19, 3)
1582
1579
                      "signal-after::preedit-changed",
1583
1580
                      midori_location_action_preedit_changed_cb, action,
1584
 
                      #endif
1585
1581
                      "signal::focus-in-event",
1586
1582
                      midori_location_action_focus_in_event_cb, action,
1587
1583
                      "signal::focus-out-event",
1735
1731
    {
1736
1732
        GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
1737
1733
        if (stock_id && gtk_stock_lookup (stock_id, &stock_item))
1738
 
            gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
1739
 
                GTK_ICON_ENTRY_SECONDARY, stock_id);
 
1734
            gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
 
1735
                GTK_ENTRY_ICON_SECONDARY, stock_id);
1740
1736
        else
1741
 
            gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
1742
 
                GTK_ICON_ENTRY_SECONDARY, stock_id);
 
1737
            gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
 
1738
                GTK_ENTRY_ICON_SECONDARY, stock_id);
1743
1739
    }
1744
1740
}
1745
1741
 
1768
1764
    if (GTK_IS_TOOL_ITEM (proxies->data))
1769
1765
    {
1770
1766
        GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
1771
 
        gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry), GTK_ICON_ENTRY_PRIMARY, icon);
1772
 
        gtk_icon_entry_set_tooltip (GTK_ICON_ENTRY (entry), GTK_ICON_ENTRY_PRIMARY, tooltip);
 
1767
        gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, icon);
 
1768
        gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, tooltip);
1773
1769
    }
1774
1770
}
1775
1771