~ubuntuone-control-tower/libubuntuone/stable-3-0

« back to all changes in this revision

Viewing changes to libubuntuoneui/u1-music-store.c

  • Committer: Tarmac
  • Author(s): Rodney Dawes
  • Date: 2012-04-23 15:10:56 UTC
  • mfrom: (158.1.1 alertbar-align-3-0)
  • Revision ID: tarmac-20120423151056-hs53ft8r3rb3u0rd
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

Show diffs side-by-side

added added

removed removed

Lines of Context:
1171
1171
        const gchar *url_to_use;
1172
1172
        SoupSession *session;
1173
1173
        GtkWidget *alert_icon;
 
1174
        GtkWidget *alignment;
1174
1175
 
1175
1176
        g_type_init();
1176
1177
 
1243
1244
        gtk_container_add (GTK_CONTAINER (music_store->priv->scroll), music_store->priv->web_viewer);
1244
1245
 
1245
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
1249
        alert_icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
1248
1250
                                               GTK_ICON_SIZE_MENU);
1249
 
        gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar), alert_icon,
1250
 
                            FALSE, FALSE, 0);
 
1251
        gtk_box_pack_start (GTK_BOX (alignment), alert_icon, FALSE, FALSE, 0);
 
1252
        gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar), alignment,
 
1253
                            FALSE, FALSE, 6);
1251
1254
        gtk_widget_show (alert_icon);
 
1255
        gtk_widget_show (alignment);
1252
1256
 
1253
1257
        music_store->priv->alert_label = gtk_label_new ("");
1254
1258
        gtk_misc_set_alignment (GTK_MISC (music_store->priv->alert_label),
1255
1259
                                0.0, 0.5);
 
1260
        gtk_label_set_line_wrap (GTK_LABEL (music_store->priv->alert_label),
 
1261
                                 TRUE);
1256
1262
        gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar),
1257
1263
                            music_store->priv->alert_label,
1258
1264
                            TRUE, TRUE, 0);
1259
1265
        gtk_widget_show (music_store->priv->alert_label);
1260
1266
 
1261
1267
        /* Button to install MP3 codec if missing */
 
1268
        alignment = gtk_vbox_new (FALSE, 0);
1262
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
1273
        gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),
1264
 
                          music_store->priv->install_btn,
 
1274
                          alignment,
1265
1275
                          FALSE, FALSE, 6);
1266
1276
        g_signal_connect (G_OBJECT (music_store->priv->install_btn), "clicked",
1267
1277
                          G_CALLBACK (_install_missing_codec), music_store);
 
1278
        gtk_widget_show (alignment);
1268
1279
 
1269
1280
        /* Check that MP3 codec is available */
1270
1281
        g_timeout_add_seconds (3, (GSourceFunc) check_mp3_support, music_store);
1271
1282
 
1272
1283
        /* Button to subscribe the Purchased Music folder */
 
1284
        alignment = gtk_vbox_new (FALSE, 0);
1273
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
1289
        gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),
1275
 
                          music_store->priv->subscribe_btn,
 
1290
                          alignment,
1276
1291
                          FALSE, FALSE, 6);
1277
1292
        g_signal_connect (G_OBJECT (music_store->priv->subscribe_btn), "clicked",
1278
1293
                          G_CALLBACK (subscribe_purchased_folder), music_store);
 
1294
        gtk_widget_show (alignment);
1279
1295
 
1280
1296
        gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->alertbar, FALSE, FALSE, 6);
1281
1297
        gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->scroll, TRUE, TRUE, 0);