~ubuntu-branches/ubuntu/raring/nautilus/raring

« back to all changes in this revision

Viewing changes to eel/eel-editable-label.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Jeremy Bicha
  • Date: 2012-01-31 13:45:01 UTC
  • mfrom: (1.17.25)
  • Revision ID: package-import@ubuntu.com-20120131134501-yn7mqny7fgzx9fao
Tags: 1:3.3.4-0ubuntu1
* New upstream version which fixes:
  - "Opening Popupmenu in Context of Folder with List-View impossible?"
    (lp: #126540)
  - "'Create folder in here' context menu option for nautilus" (lp: #61786)
  - the file count and the size count change in opposite direction.
    (lp: #503330)
  - the mounts in the place menu should have a properties entry.
    (lp: #846289)
  - add command line option to select file (lp: #575719)
  - Media in 'Places' side bar should have same context menu as in 
    'Computer' (lp: #230098)
* debian/nautilus-data.install:
  - updated, ui and icons have been moved into gresources
* debian/patches/05_desktop_menu_export.patch:
   - updated to correctly include the gresources desktop definition

[ Jeremy Bicha ]
* New upstream release.
* debian/control.in:
  - Bump minimum GTK and glib
* Refreshed patches
* Dropped upstream patches:
  - 17_dont_allow_new_tab_on_desktop.patch
  - 18_fix_crash_in_get_current_uri.patch
  - 19_lazily_initialize_notification_service.patch
  - git_sideplace_sorting.patch
  - git_next_row.patch
  - git_dont_document_browser_option.patch
  - git_browser_compat.patch
  - git_bookmarks_reordering.patch
  - git_listview_context_menus.patch
  - git_use_gtk_grid.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
602
602
  label->n_bytes = 0;
603
603
  
604
604
  gtk_widget_set_can_focus (GTK_WIDGET (label), TRUE);
 
605
  gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (label)),
 
606
                               GTK_STYLE_CLASS_ENTRY);
605
607
 
606
608
    /* This object is completely private. No external entity can gain a reference
607
609
   * to it; so we create it here and destroy it in finalize().
1098
1100
  gint width, height;
1099
1101
  PangoRectangle logical_rect;
1100
1102
  gint set_width;
1101
 
  gfloat xpad, ypad;
 
1103
  gint xpad, ypad;
1102
1104
 
1103
1105
  g_assert (EEL_IS_EDITABLE_LABEL (widget));
1104
1106
  g_assert (requisition != NULL);
1123
1125
 
1124
1126
  eel_editable_label_ensure_layout (label, TRUE);
1125
1127
 
1126
 
  gtk_misc_get_alignment (&label->misc,
1127
 
                          &xpad, &ypad);
 
1128
  gtk_misc_get_padding (&label->misc,
 
1129
                        &xpad, &ypad);
1128
1130
  width = xpad * 2;
1129
1131
  height = ypad * 2;
1130
1132
 
1202
1204
 
1203
1205
  /* We have to clear the layout, fonts etc. may have changed */
1204
1206
  eel_editable_label_recompute (label);
1205
 
 
1206
 
  /* Set the background, foreground and cursor colors based on 
1207
 
   * the new theme selected.
1208
 
   */
1209
 
  if (gtk_widget_get_realized (widget))
1210
 
    {
1211
 
        GtkStyleContext *style;
1212
 
 
1213
 
        style = gtk_widget_get_style_context (widget);
1214
 
        gtk_style_context_set_background (style, gtk_widget_get_window (widget));
1215
 
    }
1216
1207
}
1217
1208
 
1218
1209
static void 
1501
1492
        }
1502
1493
      else /* Block cursor */
1503
1494
        {
 
1495
          GdkRGBA fg_color;
 
1496
          GtkStyleContext *style;
1504
1497
          cairo_region_t *clip;
1505
1498
 
 
1499
          style = gtk_widget_get_style_context (widget);
 
1500
          gtk_style_context_get_color (style, GTK_STATE_FLAG_NORMAL, &fg_color);
 
1501
 
1506
1502
          cairo_save (cr);
 
1503
          gdk_cairo_set_source_rgba (cr, &fg_color);
1507
1504
 
1508
 
          cairo_set_source_rgb (cr, 0, 0, 0);
1509
1505
          cairo_rectangle (cr,
1510
1506
                           xoffset + PANGO_PIXELS (strong_pos.x),
1511
1507
                           yoffset + PANGO_PIXELS (strong_pos.y),
1515
1511
 
1516
1512
          if (!block_at_line_end)
1517
1513
            {
1518
 
              GtkStyleContext *style;
1519
1514
              GdkRGBA color;
1520
1515
 
1521
1516
              clip = gdk_pango_layout_get_clip_region (label->layout,
1525
1520
              gdk_cairo_region (cr, clip);
1526
1521
              cairo_clip (cr);
1527
1522
 
1528
 
              style = gtk_widget_get_style_context (widget);
1529
1523
              gtk_style_context_get_background_color (style, GTK_STATE_FLAG_FOCUSED,
1530
1524
                                                      &color);
1531
1525
 
1627
1621
        eel_editable_label_draw_cursor (label, cr, x, y);
1628
1622
 
1629
1623
      if (label->draw_outline) {
1630
 
        GtkAllocation allocation;
1631
 
        GdkRGBA color;
1632
 
 
1633
 
        gtk_widget_get_allocation (widget, &allocation);
1634
 
        gtk_style_context_get_color (style, gtk_widget_get_state_flags (widget), &color);
1635
 
        gdk_cairo_set_source_rgba (cr, &color);
1636
 
        cairo_set_line_width (cr, 1.0);
1637
 
        cairo_rectangle (cr, 0.5, 0.5, 
1638
 
                         allocation.width - 1,
1639
 
                         allocation.height - 1);
1640
 
        cairo_stroke (cr);
 
1624
        gtk_style_context_save (style);
 
1625
        gtk_style_context_set_state (style, gtk_widget_get_state_flags (widget));
 
1626
 
 
1627
        gtk_render_frame (style, cr,
 
1628
                          0, 0,
 
1629
                          gtk_widget_get_allocated_width (widget),
 
1630
                          gtk_widget_get_allocated_height (widget));
 
1631
 
 
1632
        gtk_style_context_restore (style);
1641
1633
      }
1642
1634
    }
1643
1635
 
1910
1902
  if ((event->state & GDK_BUTTON1_MASK) == 0)
1911
1903
    return FALSE;
1912
1904
 
1913
 
  gdk_window_get_pointer (gtk_widget_get_window (widget),
1914
 
                          &x, &y, NULL);
1915
 
  
 
1905
  gdk_window_get_device_position (gtk_widget_get_window (widget),
 
1906
                                  event->device,
 
1907
                                  &x, &y, NULL);
 
1908
 
1916
1909
  get_layout_index (label, x, y, &index);
1917
1910
 
1918
1911
  eel_editable_label_select_region_index (label,