~netbook-remix-team/netbook-remix-launcher/packaging

« back to all changes in this revision

Viewing changes to src/nl-favorite-view.c

  • Committer: Neil Jagdish Patel
  • Date: 2009-08-05 17:03:43 UTC
  • mfrom: (397.1.15 netbook-launcher)
  • Revision ID: neil.patel@canonical.com-20090805170343-0zl7w7yl2ju6yfip
Tags: 2.0.2+bzr412
releasing version 2.0.2+bzr412

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <glib.h>
27
27
#include <glib-object.h>
28
28
#include <glib/gi18n.h>
 
29
#include <gtk/gtk.h>
29
30
#include <math.h>
30
31
#include <clutk/clutk.h>
31
32
#include <clutter/clutter.h>
363
364
    *nat_height = max_height;
364
365
}
365
366
 
 
367
 
 
368
static void
 
369
change_background (GtkMenuItem *item, gpointer data)
 
370
{
 
371
#define BG_EXEC "gnome-appearance-properties --show-page=background"
 
372
 
 
373
  gdk_spawn_command_line_on_screen (gdk_screen_get_default (),
 
374
                                    BG_EXEC, NULL);
 
375
}
 
376
 
 
377
static gboolean
 
378
button_press_event (ClutterActor *actor, ClutterButtonEvent *event)
 
379
{
 
380
  GtkWidget *menu;
 
381
  GtkWidget *item;
 
382
 
 
383
  if (event->button != 3)
 
384
    return FALSE;
 
385
 
 
386
  menu = gtk_menu_new ();
 
387
 
 
388
  item = gtk_menu_item_new_with_label (_("Change Desktop Background"));
 
389
  gtk_widget_show (item);
 
390
  g_signal_connect (item, "activate",
 
391
                    G_CALLBACK (change_background), NULL);
 
392
 
 
393
  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
 
394
 
 
395
  gtk_menu_popup (GTK_MENU (menu),
 
396
                  NULL, NULL,
 
397
                  NULL, NULL,
 
398
                  3, event->time);
 
399
 
 
400
  return TRUE;
 
401
}
 
402
 
366
403
static void
367
404
nl_favorite_view_class_init (NlFavoriteViewClass *klass)
368
405
{
381
418
  act_class->map   = map;
382
419
  act_class->unmap = unmap;
383
420
  act_class->get_preferred_height = get_preferred_height;
 
421
  act_class->button_press_event = button_press_event;
384
422
 
385
423
  pspec = g_param_spec_pointer ("shell", "shell", "shell",
386
424
                                G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
402
440
  priv->favorites = launcher_favorites_get_default ();
403
441
  priv->children = NULL;
404
442
 
 
443
  clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE);
 
444
 
405
445
  bg_texture = clutter_texture_new_from_file (PKGDATADIR"/iconview_normal.png",
406
446
                                              NULL);
407
447
  bg = nl_texture_frame_new (CLUTTER_TEXTURE (bg_texture), 25, 25, 25, 25);