~walkerlee/totem/pre-interview

« back to all changes in this revision

Viewing changes to libgd/test-header-bar.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-05-26 00:07:51 UTC
  • mfrom: (1.6.1) (24.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130526000751-kv8ap3x1di4qq8j2
Tags: 3.8.2-0ubuntu1
* Sync with Debian. Remaining changes: 
* debian/control.in:
  - Drop build-depends on libepc-ui-dev and libgrilo-0.2-dev (in universe)
  - Drop libxtst-dev build-depends so that the (redundant) fake key presses
    for inhibiting the screensaver are disabled (LP: #1007438)
  - Build-depend on libzeitgeist-dev
  - Suggest rather than recommend gstreamer components in universe
  - Add totem-plugins-extra
  - Add XB-Npp-Description and XB-Npp-Filename header to the 
    totem-mozilla package to improve ubufox/ubuntu plugin db integration 
  - Refer to Firefox in totem-mozilla description instead of Iceweasel
  - Don't have totem-mozilla recommend any particular browser
  - Drop obsolete python library dependencies since iplayer is no longer
    included
* debian/totem-common.install, debian/source_totem.py:
  - Install Ubuntu apport debugging hook
* debian/totem-plugins-extra.install:
  - Universe plugins split out of totem-plugins (currently only gromit)
* debian/totem-plugins.install:    
  - Skip the plugins split to -extra and add the zeitgeist plugin
* debian/rules:
  - Build with --fail-missing, to ensure we install everything. 
    + Ignore libtotem.{,l}a since we delibrately don't install these.
  - Re-enable hardening, make sure both PIE and BINDNOW are used
    by setting hardening=+all. (LP: #1039604)
* debian/patches/91_quicklist_entries.patch:
  - Add static quicklist
* debian/patches/92_gst-plugins-good.patch:
  - Build without unnecessary gstreamer1.0-bad dependency
* debian/patches/93_grilo_optional.patch:
  - Allow building without grilo while grilo MIR is still pending
* debian/patches/correct_desktop_mimetypes.patch:
  - Don't list the mimetypes after the unity lists
* debian/patches/revert_shell_menu.patch: 
  - revert the use of a shell menu until indicator-appmenu can handle
    the mixed shell/traditional menus itself
* New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <gtk/gtk.h>
 
2
#include <libgd/gd-header-bar.h>
 
3
 
 
4
static void
 
5
on_switch_clicked (GtkWidget   *button,
 
6
                   GdHeaderBar *bar)
 
7
{
 
8
  GtkWidget *image = NULL;
 
9
  static gboolean use_custom = TRUE;
 
10
 
 
11
  if (use_custom)
 
12
    {
 
13
      image = gtk_image_new_from_icon_name ("face-wink-symbolic", GTK_ICON_SIZE_MENU);
 
14
      use_custom = FALSE;
 
15
    }
 
16
  else
 
17
    {
 
18
      use_custom = TRUE;
 
19
    }
 
20
 
 
21
  gd_header_bar_set_custom_title (bar, image);
 
22
}
 
23
 
 
24
gint
 
25
main (gint argc,
 
26
      gchar ** argv)
 
27
{
 
28
  GtkWidget *window, *bar, *box, *button;
 
29
 
 
30
  gtk_init (&argc, &argv);
 
31
 
 
32
  if (g_getenv ("RTL"))
 
33
    gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
 
34
  else
 
35
    gtk_widget_set_default_direction (GTK_TEXT_DIR_LTR);
 
36
 
 
37
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
38
  gtk_widget_set_size_request (window, 300, 300);
 
39
 
 
40
  box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 
41
  gtk_container_add (GTK_CONTAINER (window), box);
 
42
 
 
43
  bar = gd_header_bar_new ();
 
44
  gtk_box_pack_start (GTK_BOX (box), bar, FALSE, TRUE, 0);
 
45
 
 
46
  gd_header_bar_set_title (GD_HEADER_BAR (bar), "Title Title Title Title Title Title");
 
47
  gd_header_bar_set_subtitle (GD_HEADER_BAR (bar), "Subtitle Subtitle Subtitle Subtitle Subtitle Subtitle");
 
48
  button = gtk_button_new_with_label ("Switch");
 
49
  gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
 
50
  gtk_style_context_add_class (gtk_widget_get_style_context (button), GTK_STYLE_CLASS_RAISED);
 
51
  gd_header_bar_pack_start (GD_HEADER_BAR (bar), button);
 
52
  g_signal_connect (button, "clicked", G_CALLBACK (on_switch_clicked), bar);
 
53
 
 
54
  button = gtk_button_new_with_label ("Done");
 
55
  gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
 
56
  gtk_style_context_add_class (gtk_widget_get_style_context (button), "suggested-action");
 
57
 
 
58
  gd_header_bar_pack_end (GD_HEADER_BAR (bar), button);
 
59
 
 
60
  button = gtk_button_new_with_label ("Almost");
 
61
  gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
 
62
  gtk_style_context_add_class (gtk_widget_get_style_context (button), GTK_STYLE_CLASS_RAISED);
 
63
  gd_header_bar_pack_end (GD_HEADER_BAR (bar), button);
 
64
 
 
65
  gtk_widget_show_all (window);
 
66
  gtk_main ();
 
67
 
 
68
  gtk_widget_destroy (window);
 
69
 
 
70
  return 0;
 
71
}