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

Proposed by dobey
Status: Merged
Approved by: dobey
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
Roberto Alsina (community) code review Approve
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.
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve (code review)
Revision history for this message
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
=== modified file 'libubuntuoneui/u1-music-store.c'
--- libubuntuoneui/u1-music-store.c 2012-04-06 16:36:10 +0000
+++ libubuntuoneui/u1-music-store.c 2012-04-19 19:28:39 +0000
@@ -1171,6 +1171,7 @@
1171 const gchar *url_to_use;1171 const gchar *url_to_use;
1172 SoupSession *session;1172 SoupSession *session;
1173 GtkWidget *alert_icon;1173 GtkWidget *alert_icon;
1174 GtkWidget *alignment;
11741175
1175 g_type_init();1176 g_type_init();
11761177
@@ -1243,39 +1244,54 @@
1243 gtk_container_add (GTK_CONTAINER (music_store->priv->scroll), music_store->priv->web_viewer);1244 gtk_container_add (GTK_CONTAINER (music_store->priv->scroll), music_store->priv->web_viewer);
12441245
1245 /* Create the alert bar */1246 /* Create the alert bar */
1246 music_store->priv->alertbar = gtk_hbox_new (FALSE, 12);1247 music_store->priv->alertbar = gtk_hbox_new (FALSE, 0);
1248 alignment = gtk_vbox_new (FALSE, 0);
1247 alert_icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,1249 alert_icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
1248 GTK_ICON_SIZE_MENU);1250 GTK_ICON_SIZE_MENU);
1249 gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar), alert_icon,1251 gtk_box_pack_start (GTK_BOX (alignment), alert_icon, FALSE, FALSE, 0);
1250 FALSE, FALSE, 0);1252 gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar), alignment,
1253 FALSE, FALSE, 6);
1251 gtk_widget_show (alert_icon);1254 gtk_widget_show (alert_icon);
1255 gtk_widget_show (alignment);
12521256
1253 music_store->priv->alert_label = gtk_label_new ("");1257 music_store->priv->alert_label = gtk_label_new ("");
1254 gtk_misc_set_alignment (GTK_MISC (music_store->priv->alert_label),1258 gtk_misc_set_alignment (GTK_MISC (music_store->priv->alert_label),
1255 0.0, 0.5);1259 0.0, 0.5);
1260 gtk_label_set_line_wrap (GTK_LABEL (music_store->priv->alert_label),
1261 TRUE);
1256 gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar),1262 gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar),
1257 music_store->priv->alert_label,1263 music_store->priv->alert_label,
1258 TRUE, TRUE, 0);1264 TRUE, TRUE, 0);
1259 gtk_widget_show (music_store->priv->alert_label);1265 gtk_widget_show (music_store->priv->alert_label);
12601266
1261 /* Button to install MP3 codec if missing */1267 /* Button to install MP3 codec if missing */
1268 alignment = gtk_vbox_new (FALSE, 0);
1262 music_store->priv->install_btn = gtk_button_new_with_label (_("Install"));1269 music_store->priv->install_btn = gtk_button_new_with_label (_("Install"));
1270 gtk_box_pack_start (GTK_BOX (alignment),
1271 music_store->priv->install_btn,
1272 FALSE, FALSE, 0);
1263 gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),1273 gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),
1264 music_store->priv->install_btn,1274 alignment,
1265 FALSE, FALSE, 6);1275 FALSE, FALSE, 6);
1266 g_signal_connect (G_OBJECT (music_store->priv->install_btn), "clicked",1276 g_signal_connect (G_OBJECT (music_store->priv->install_btn), "clicked",
1267 G_CALLBACK (_install_missing_codec), music_store);1277 G_CALLBACK (_install_missing_codec), music_store);
1278 gtk_widget_show (alignment);
12681279
1269 /* Check that MP3 codec is available */1280 /* Check that MP3 codec is available */
1270 g_timeout_add_seconds (3, (GSourceFunc) check_mp3_support, music_store);1281 g_timeout_add_seconds (3, (GSourceFunc) check_mp3_support, music_store);
12711282
1272 /* Button to subscribe the Purchased Music folder */1283 /* Button to subscribe the Purchased Music folder */
1284 alignment = gtk_vbox_new (FALSE, 0);
1273 music_store->priv->subscribe_btn = gtk_button_new_with_label (_("Subscribe"));1285 music_store->priv->subscribe_btn = gtk_button_new_with_label (_("Subscribe"));
1286 gtk_box_pack_start (GTK_BOX (alignment),
1287 music_store->priv->subscribe_btn,
1288 FALSE, FALSE, 0);
1274 gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),1289 gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),
1275 music_store->priv->subscribe_btn,1290 alignment,
1276 FALSE, FALSE, 6);1291 FALSE, FALSE, 6);
1277 g_signal_connect (G_OBJECT (music_store->priv->subscribe_btn), "clicked",1292 g_signal_connect (G_OBJECT (music_store->priv->subscribe_btn), "clicked",
1278 G_CALLBACK (subscribe_purchased_folder), music_store);1293 G_CALLBACK (subscribe_purchased_folder), music_store);
1294 gtk_widget_show (alignment);
12791295
1280 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->alertbar, FALSE, FALSE, 6);1296 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->alertbar, FALSE, FALSE, 6);
1281 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->scroll, TRUE, TRUE, 0);1297 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->scroll, TRUE, TRUE, 0);
12821298
=== modified file 'tests/test-music-store.c'
--- tests/test-music-store.c 2012-04-05 14:09:11 +0000
+++ tests/test-music-store.c 2012-04-19 19:28:39 +0000
@@ -59,7 +59,7 @@
5959
60 /* Create the main window */60 /* Create the main window */
61 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);61 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
62 gtk_widget_set_size_request (window, 839, 600);62 gtk_window_set_default_size (GTK_WINDOW (window), 640, 480);
63 g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL);63 g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL);
6464
65 music_store = u1_music_store_new ();65 music_store = u1_music_store_new ();

Subscribers

People subscribed via source and target branches