Merge lp:~dobey/libubuntuone/alertbar-align into lp:libubuntuone

Proposed by dobey on 2012-04-19
Status: Merged
Approved by: dobey on 2012-04-19
Approved revision: 152
Merged at revision: 152
Proposed branch: lp:~dobey/libubuntuone/alertbar-align
Merge into: lp:libubuntuone
Diff against target: 84 lines (+22/-6)
2 files modified
libubuntuoneui/u1-music-store.c (+21/-5)
tests/test-music-store.c (+1/-1)
To merge this branch: bzr merge lp:~dobey/libubuntuone/alertbar-align
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) code and irl Approve on 2012-04-19
Roberto Alsina (community) code review 2012-04-19 Approve on 2012-04-19
Review via email: mp+102749@code.launchpad.net

Commit message

Enable line wrap on the alert label widget
Fix alignment and padding of icon, button, and alert bar
Fix test program to set default size on window properly, and to 640x480

To post a comment you must log in.
Roberto Alsina (ralsina) :
review: Approve (code review)
Alejandro J. Cura (alecu) wrote :

much nicer!

review: Approve (code and irl)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libubuntuoneui/u1-music-store.c'
2--- libubuntuoneui/u1-music-store.c 2012-04-06 16:36:10 +0000
3+++ libubuntuoneui/u1-music-store.c 2012-04-19 19:28:39 +0000
4@@ -1171,6 +1171,7 @@
5 const gchar *url_to_use;
6 SoupSession *session;
7 GtkWidget *alert_icon;
8+ GtkWidget *alignment;
9
10 g_type_init();
11
12@@ -1243,39 +1244,54 @@
13 gtk_container_add (GTK_CONTAINER (music_store->priv->scroll), music_store->priv->web_viewer);
14
15 /* Create the alert bar */
16- music_store->priv->alertbar = gtk_hbox_new (FALSE, 12);
17+ music_store->priv->alertbar = gtk_hbox_new (FALSE, 0);
18+ alignment = gtk_vbox_new (FALSE, 0);
19 alert_icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
20 GTK_ICON_SIZE_MENU);
21- gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar), alert_icon,
22- FALSE, FALSE, 0);
23+ gtk_box_pack_start (GTK_BOX (alignment), alert_icon, FALSE, FALSE, 0);
24+ gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar), alignment,
25+ FALSE, FALSE, 6);
26 gtk_widget_show (alert_icon);
27+ gtk_widget_show (alignment);
28
29 music_store->priv->alert_label = gtk_label_new ("");
30 gtk_misc_set_alignment (GTK_MISC (music_store->priv->alert_label),
31 0.0, 0.5);
32+ gtk_label_set_line_wrap (GTK_LABEL (music_store->priv->alert_label),
33+ TRUE);
34 gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar),
35 music_store->priv->alert_label,
36 TRUE, TRUE, 0);
37 gtk_widget_show (music_store->priv->alert_label);
38
39 /* Button to install MP3 codec if missing */
40+ alignment = gtk_vbox_new (FALSE, 0);
41 music_store->priv->install_btn = gtk_button_new_with_label (_("Install"));
42+ gtk_box_pack_start (GTK_BOX (alignment),
43+ music_store->priv->install_btn,
44+ FALSE, FALSE, 0);
45 gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),
46- music_store->priv->install_btn,
47+ alignment,
48 FALSE, FALSE, 6);
49 g_signal_connect (G_OBJECT (music_store->priv->install_btn), "clicked",
50 G_CALLBACK (_install_missing_codec), music_store);
51+ gtk_widget_show (alignment);
52
53 /* Check that MP3 codec is available */
54 g_timeout_add_seconds (3, (GSourceFunc) check_mp3_support, music_store);
55
56 /* Button to subscribe the Purchased Music folder */
57+ alignment = gtk_vbox_new (FALSE, 0);
58 music_store->priv->subscribe_btn = gtk_button_new_with_label (_("Subscribe"));
59+ gtk_box_pack_start (GTK_BOX (alignment),
60+ music_store->priv->subscribe_btn,
61+ FALSE, FALSE, 0);
62 gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),
63- music_store->priv->subscribe_btn,
64+ alignment,
65 FALSE, FALSE, 6);
66 g_signal_connect (G_OBJECT (music_store->priv->subscribe_btn), "clicked",
67 G_CALLBACK (subscribe_purchased_folder), music_store);
68+ gtk_widget_show (alignment);
69
70 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->alertbar, FALSE, FALSE, 6);
71 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->scroll, TRUE, TRUE, 0);
72
73=== modified file 'tests/test-music-store.c'
74--- tests/test-music-store.c 2012-04-05 14:09:11 +0000
75+++ tests/test-music-store.c 2012-04-19 19:28:39 +0000
76@@ -59,7 +59,7 @@
77
78 /* Create the main window */
79 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
80- gtk_widget_set_size_request (window, 839, 600);
81+ gtk_window_set_default_size (GTK_WINDOW (window), 640, 480);
82 g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL);
83
84 music_store = u1_music_store_new ();

Subscribers

People subscribed via source and target branches