~ubuntu-branches/ubuntu/saucy/gnome-control-center/saucy-proposed

« back to all changes in this revision

Viewing changes to panels/datetime/cc-timezone-map.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Sebastien Bacher, Robert Ancell, Iain Lane, Edward Donovan, Rico Tzschichholz, Jeremy Bicha, David Henningsson
  • Date: 2012-11-21 19:32:45 UTC
  • mfrom: (1.1.63)
  • Revision ID: package-import@ubuntu.com-20121121193245-mj61nzz1z4fk3z25
Tags: 1:3.6.3-0ubuntu1
[ Sebastien Bacher ]
* New upstream version
* debian/control.in: recommends libcanberra-pulse (lp: #1004973)
* debian/patches/58_ubuntu_icon_views_redesign.patch:
  - drop most of the changes, keep the different grid size though
    to fit on screen with our extra icons
* debian/patches/91_dont_show_in_unity.patch:
  - dropped, show the upstream printer panel and the layout tab
* debian/patches/revert_git_keyboard_gsettings.patch,
  debian/patches/revert_git_stop_using_gconf.patch:
  - dropped the gconf->gsettings reverts

[ Robert Ancell ]
* New upstream release (LP: #1010317)
* debian/control:
  - Bump build-depends on libgnome-desktop-3-dev, libwacom-dev
  - Add build-depends on libclutter-1.0-dev, libclutter-gtk-1.0-dev,
    libpwquality-dev
  - Drop build-depends on libgnomekbd-dev
* debian/patches/60_ubuntu_nav_bar.patch:
  - Disabled for now, doesn't apply
* debian/patches/revert_ua_gsettings.patch:
  - We can use GSettings for universal access now
* debian/patches/00git_online_accounts_gtkgrid.patch:
* debian/patches/00git_online_accounts_layout.part:
* debian/patches/git_wacom_translations.patch:
  - Applied upstream

[ Iain Lane ]
* Add Build-Depends on libxkbfile-dev
* New upstream release.
* Refresh all patches to apply cleanly.

[ Edward Donovan ]
* debian/source_gnome-control-center.py: Fix for Python 3. (LP: #1013171)

[ Rico Tzschichholz ]
* debian/control.in:
  - Build-depend on gtk-doc-tools instead of docbook directly
  - Bump minimum glib-2.0, gnome-desktop3, gnome-settings-daemon
     and gsettings-desktop-schemas

[ Jeremy Bicha ]
* Dropped more patches applied in new version:
  - git_unmute_sound_event.patch
  - git_fix_big_editable_labels.patch
  - 96_sound_nua_panel.patch
* debian/patches/04_new_appearance_settings.patch:
  - Dropped, this is now packaged separately as gnome-control-center-unity
* debian/patches/10_keyboard_layout_on_unity.patch:
  - Don't change the keyboard panel name when not running Unity
* debian/patches/52_ubuntu_language_list_mods.patch:
  - Don't disable adding current language to the list. While this
    fix shows the current language twice, at least it avoids the
    "Ubuntu suddenly in Chinese" bug (LP: #1035219)
* debian/patches/53_use_ubuntu_help.patch:
  - Only show Ubuntu help when running Unity
* debian/patches/58_hide_gdm_notifications.patch:
  - Hide "Show notifications when locked" settings when running Unity
    since it's a GNOME Shell-specific feature
* debian/patches/63_normal_scrollbar_in_a11y.patch:
  - Drop, overlay-scrollbars should handle this instead
* debian/patches/91_dont_show_in_unity.patch:
  - Hide Printers & Region panels in Unity until we're ready to switch
    to them.
* debian/patches/fix-crash-on-user-panel.patch:
  - Dropped, GNOME says it's obsolete
* debian/rules:
  - Build with -z,defs again
  - Explicitly disable ibus support since ibus 1.4 isn't supported in
    this version
* debian/control.in:
  - Drop ubuntu-docs and gnome-user-guide from recommends to suggests
  - Don't recommend indicators; let's leave that to Unity

[ David Henningsson ]
* sound_nua_panel.patch: Rebase to gnome 3.6 

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
struct _CcTimezoneMapPrivate
46
46
{
47
47
  GdkPixbuf *orig_background;
 
48
  GdkPixbuf *orig_background_dim;
48
49
  GdkPixbuf *orig_color_map;
49
50
 
50
51
  GdkPixbuf *background;
143
144
{
144
145
  CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (object)->priv;
145
146
 
146
 
  if (priv->orig_background)
147
 
    {
148
 
      g_object_unref (priv->orig_background);
149
 
      priv->orig_background = NULL;
150
 
    }
 
147
  g_clear_object (&priv->orig_background);
 
148
  g_clear_object (&priv->orig_background_dim);
151
149
 
152
150
  if (priv->orig_color_map)
153
151
    {
226
224
                               GtkAllocation *allocation)
227
225
{
228
226
  CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv;
 
227
  GdkPixbuf *pixbuf;
229
228
 
230
229
  if (priv->background)
231
230
    g_object_unref (priv->background);
232
231
 
233
 
  priv->background = gdk_pixbuf_scale_simple (priv->orig_background,
 
232
  if (!gtk_widget_is_sensitive (widget))
 
233
    pixbuf = priv->orig_background_dim;
 
234
  else
 
235
    pixbuf = priv->orig_background;
 
236
 
 
237
  priv->background = gdk_pixbuf_scale_simple (pixbuf,
234
238
                                              allocation->width,
235
239
                                              allocation->height,
236
240
                                              GDK_INTERP_BILINEAR);
255
259
{
256
260
  GdkWindowAttr attr = { 0, };
257
261
  GtkAllocation allocation;
258
 
  GdkCursor *cursor;
259
262
  GdkWindow *window;
260
263
 
261
264
  gtk_widget_get_allocation (widget, &allocation);
274
277
  window = gdk_window_new (gtk_widget_get_parent_window (widget), &attr,
275
278
                           GDK_WA_X | GDK_WA_Y);
276
279
 
277
 
  cursor = gdk_cursor_new (GDK_HAND2);
278
 
  gdk_window_set_cursor (window, cursor);
279
 
 
280
280
  gdk_window_set_user_data (window, widget);
281
281
  gtk_widget_set_window (widget, window);
282
282
}
330
330
  GError *err = NULL;
331
331
  gdouble pointx, pointy;
332
332
  char buf[16];
 
333
  const char *fmt;
333
334
 
334
335
  gtk_widget_get_allocation (widget, &alloc);
335
336
 
338
339
  cairo_paint (cr);
339
340
 
340
341
  /* paint hilight */
341
 
  file = g_strdup_printf (DATADIR "/timezone_%s.png",
 
342
  if (gtk_widget_is_sensitive (widget))
 
343
    fmt = DATADIR "/timezone_%s.png";
 
344
  else
 
345
    fmt = DATADIR "/timezone_%s_dim.png";
 
346
 
 
347
  file = g_strdup_printf (fmt,
342
348
                          g_ascii_formatd (buf, sizeof (buf),
343
349
                                           "%g", priv->selected_offset));
344
350
  orig_hilight = gdk_pixbuf_new_from_file (file, &err);
396
402
  return TRUE;
397
403
}
398
404
 
 
405
static void
 
406
update_cursor (GtkWidget *widget)
 
407
{
 
408
  GdkWindow *window;
 
409
  GdkCursor *cursor = NULL;
 
410
 
 
411
  if (!gtk_widget_get_realized (widget))
 
412
    return;
 
413
 
 
414
  if (gtk_widget_is_sensitive (widget))
 
415
    {
 
416
      GdkDisplay *display;
 
417
      display = gtk_widget_get_display (widget);
 
418
      cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
 
419
    }
 
420
 
 
421
  window = gtk_widget_get_window (widget);
 
422
  gdk_window_set_cursor (window, cursor);
 
423
 
 
424
  if (cursor)
 
425
    g_object_unref (cursor);
 
426
}
 
427
 
 
428
static void
 
429
cc_timezone_map_state_flags_changed (GtkWidget     *widget,
 
430
                                     GtkStateFlags  prev_state)
 
431
{
 
432
  update_cursor (widget);
 
433
 
 
434
  if (GTK_WIDGET_CLASS (cc_timezone_map_parent_class)->state_flags_changed)
 
435
    GTK_WIDGET_CLASS (cc_timezone_map_parent_class)->state_flags_changed (widget, prev_state);
 
436
}
 
437
 
399
438
 
400
439
static void
401
440
cc_timezone_map_class_init (CcTimezoneMapClass *klass)
415
454
  widget_class->size_allocate = cc_timezone_map_size_allocate;
416
455
  widget_class->realize = cc_timezone_map_realize;
417
456
  widget_class->draw = cc_timezone_map_draw;
 
457
  widget_class->state_flags_changed = cc_timezone_map_state_flags_changed;
418
458
 
419
459
  signals[LOCATION_CHANGED] = g_signal_new ("location-changed",
420
460
                                            CC_TYPE_TIMEZONE_MAP,
551
591
      g_clear_error (&err);
552
592
    }
553
593
 
 
594
  priv->orig_background_dim = gdk_pixbuf_new_from_file (DATADIR "/bg_dim.png",
 
595
                                                        &err);
 
596
 
 
597
  if (!priv->orig_background_dim)
 
598
    {
 
599
      g_warning ("Could not load background image: %s",
 
600
                 (err) ? err->message : "Unknown error");
 
601
      g_clear_error (&err);
 
602
    }
 
603
 
554
604
  priv->orig_color_map = gdk_pixbuf_new_from_file (DATADIR "/cc.png",
555
605
                                                   &err);
556
606
  if (!priv->orig_color_map)