aboutsummaryrefslogtreecommitdiffstats
path: root/applet.c
blob: d40361997b63311896564162ed6157f13f1922fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* 
 * (C) 2007 OpenedHand Ltd.
 *
 * Author: Ross Burton <ross@openedhand.com>
 *
 * Licensed under the GPL v2 or greater.
 */

#include <gtk/gtk.h>
#include <matchbox-panel/mb-panel.h>
#include <matchbox-panel/mb-panel-scaling-image2.h>
#include "screenshot-ui.h"

static void
on_clicked (GtkButton *button)
{
  screenshot (NULL);
}

G_MODULE_EXPORT GtkWidget *
mb_panel_applet_create (const char *id, GtkOrientation orientation)
{
  GtkWidget *button, *image;

  button = gtk_button_new ();
  gtk_widget_set_name (button, "MatchboxPanelScreenshot");
  gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);

  image = mb_panel_scaling_image2_new (orientation, "applet-screenshot");
  gtk_container_add (GTK_CONTAINER (button), image);

  g_signal_connect (button, "clicked", G_CALLBACK (on_clicked), NULL);

  gtk_widget_show_all (button);

  return button;
}