r2847 - trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src

abraxa at sita.openmoko.org abraxa at sita.openmoko.org
Wed Aug 29 08:37:47 CEST 2007


Author: abraxa
Date: 2007-08-29 08:37:42 +0200 (Wed, 29 Aug 2007)
New Revision: 2847

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/editor_page.c
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.c
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playlist.c
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playlist_page.c
Log:
Fixed UI issues apparent when run on the Neo



Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/editor_page.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/editor_page.c	2007-08-29 00:44:49 UTC (rev 2846)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/editor_page.c	2007-08-29 06:37:42 UTC (rev 2847)
@@ -198,21 +198,20 @@
 	gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), column);
 
 	renderer = gtk_cell_renderer_text_new();
-	column = gtk_tree_view_column_new_with_attributes(_("#"), renderer,
+	column = gtk_tree_view_column_new_with_attributes("#", renderer,
 		"text", NUMBER_COLUMN, NULL);
-	gtk_tree_view_column_set_fixed_width(column, BUTTON_PIXMAP_SIZE);
 	gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), column);
 
 	renderer = gtk_cell_renderer_text_new();
+	g_object_set(G_OBJECT(renderer), "ellipsize", PANGO_ELLIPSIZE_END, "ellipsize-set", 1, NULL);
 	column = gtk_tree_view_column_new_with_attributes(_("Track Title"), renderer,
 		"text", TITLE_COLUMN, NULL);
 	gtk_tree_view_column_set_expand(column, TRUE);
 	gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), column);
 
 	renderer = gtk_cell_renderer_text_new();
-	column = gtk_tree_view_column_new_with_attributes(_("Duration"), renderer,
+	column = gtk_tree_view_column_new_with_attributes(_("Time"), renderer,
 		"text", DURATION_COLUMN, NULL);
-	gtk_tree_view_column_set_fixed_width(column, 2*BUTTON_PIXMAP_SIZE);
 	gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), column);
 
 	// Add playlist view to container
@@ -231,7 +230,7 @@
 	main_vbox = gtk_vbox_new(FALSE, 0);
 
 	// Caption
-	alignment = label_create(&label, "Sans 14", "black", 0, 0, 0, 0, 0);
+	alignment = label_create(&label, "Sans 6", "black", 0, 0, 0, 0, 0);
 	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 5, 5, 5);
 	gtk_box_pack_start(GTK_BOX(main_vbox), GTK_WIDGET(alignment), FALSE, FALSE, 0);
 	omp_editor_title_label = label;
@@ -256,7 +255,7 @@
 	image = gtk_image_new_from_icon_name("gtk-file", BUTTON_PIXMAP_SIZE);
 	gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(image), TRUE, TRUE, 0);
 
-	alignment = label_create(&label, "Sans 14", "black", 0, 0, 0, 0, 0);
+	alignment = label_create(&label, "Sans 6", "black", 0, 0, 0, 0, 0);
 	gtk_label_set_text(GTK_LABEL(label), _("Add Tracks"));
 	gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 

Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c	2007-08-29 00:44:49 UTC (rev 2846)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c	2007-08-29 06:37:42 UTC (rev 2847)
@@ -64,9 +64,6 @@
 // Forces the window to the native size of the Neo1973's screen area if enabled
 //define EMULATE_SIZE
 
-// The padding applied to the page handle's contents
-#define NOTEBOOK_PAGE_PADDING 6
-
 GtkWidget *omp_window = NULL;													///< Application's main window
 GtkWidget *omp_notebook = NULL;												///< GtkNotebook containing the pages making up the UI
 struct _omp_notebook_tab_ids *omp_notebook_tab_ids = NULL;	///< Holds numerical IDs of the notebook tabs, used for gtk_notebook_set_current_page()
@@ -248,22 +245,19 @@
 
 	// Add main page
 	page = omp_main_page_create();
-	notebook_add_page_with_icon(omp_notebook, page,
-		MOKO_STOCK_SPEAKER, NOTEBOOK_PAGE_PADDING);
+	notebook_add_page_with_icon(omp_notebook, page, MOKO_STOCK_SPEAKER, 0);
 	omp_notebook_tab_ids->main = page_id++;
 	omp_notebook_tabs->main = page;
 
 	// Add playlist page
 	page = omp_playlist_page_create();
-	notebook_add_page_with_icon(omp_notebook, page,
-		MOKO_STOCK_VIEW, NOTEBOOK_PAGE_PADDING);
+	notebook_add_page_with_icon(omp_notebook, page, MOKO_STOCK_VIEW, 0);
 	omp_notebook_tab_ids->playlists = page_id++;
 	omp_notebook_tabs->playlists = page;
 
 	// Add playlist editor page
 	page = omp_editor_page_create();
-	notebook_add_page_with_icon(omp_notebook, page,
-		"gtk-index", NOTEBOOK_PAGE_PADDING);
+	notebook_add_page_with_icon(omp_notebook, page, "gtk-index", 0);
 	omp_notebook_tab_ids->editor = page_id++;
 	omp_notebook_tabs->editor = page;
 }

Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.c	2007-08-29 00:44:49 UTC (rev 2846)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.c	2007-08-29 06:37:42 UTC (rev 2847)
@@ -347,12 +347,12 @@
 	gtk_container_add(GTK_CONTAINER(destination), GTK_WIDGET(mainvbox));
 
 	// Title label
-	alignment = label_create(&main_widgets.title_label, "Sans 24", "black", 0, 0, 1, 0, 18);
-	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 18, 0, 35, 30);
+	alignment = label_create(&main_widgets.title_label, "Sans 8", "black", 0, 0, 1, 0, 18);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 10, 0, 35, 30);
 	gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 
 	// Artist label
-	alignment = label_create(&main_widgets.artist_label, "Sans 14", "black", 0, 0, 1, 0, 30);
+	alignment = label_create(&main_widgets.artist_label, "Sans 6", "black", 0, 0, 1, 0, 30);
 	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 0, 35, 30);
 	gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 
@@ -360,7 +360,7 @@
 
 	// Add upper_hbox to mainvbox for track number and time display
 	alignment = gtk_alignment_new(0, 0, 0, 0);
-	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 20, 0, 50, 30);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 10, 0, 35, 30);
 	gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 
 	upper_hbox = gtk_hbox_new(FALSE, 0);
@@ -368,22 +368,22 @@
 
 	// Track number icon
 	alignment = gtk_alignment_new(0, 0, 0, 0);
-	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 2, 0, 14, 15);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 0, 14, 15);
 	gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 	container_add_image(GTK_CONTAINER(alignment), "ico-track.png");
 
 	// Track number
-	alignment = label_create(&main_widgets.track_number_label, "Sans 14", "black", 0, 0, 0, 0, 0);
+	alignment = label_create(&main_widgets.track_number_label, "Sans 5", "black", 0, 0, 0, 0, 0);
 	gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 
 	// Time icon
 	alignment = gtk_alignment_new(0, 0, 0, 0);
-	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 2, 0, 86, 15);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 0, 86, 15);
 	gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 	container_add_image(GTK_CONTAINER(alignment), "ico-time.png");
 
 	// Time
-	alignment = label_create(&main_widgets.time_label, "Sans 14", "black", 0, 0, 0, 0, 0);
+	alignment = label_create(&main_widgets.time_label, "Sans 5", "black", 0, 0, 0, 0, 0);
 	gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 
 	// --- --- --- --- --- Slider --- --- --- --- ---
@@ -412,14 +412,14 @@
 
 	// Add middle_hbox to mainvbox for the EQ/volume/balance widgets
 	alignment = gtk_alignment_new(0, 0, 0, 0);
-	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 41, 0, 70, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 42, 0, 65, 0);
 	gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 
 	middle_hbox = gtk_hbox_new(FALSE, 0);
 	gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(middle_hbox));
 
 	// EQ/Visualization bands
-	image_file_name = g_build_path("/", ui_image_path, "ind-music-eq-06.png", NULL);
+	image_file_name = g_build_path("/", ui_image_path, "ind-music-eq-12.png", NULL);
 
 	for (i=0; i<12; i++)
 	{
@@ -442,12 +442,12 @@
 
 	// Volume image
 	alignment = gtk_alignment_new(0, 0, 0, 0);
-	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 4, 0, 25, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 7, 0, 20, 0);
 	gtk_box_pack_start(GTK_BOX(volume_box), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 	container_add_image_with_ref(GTK_CONTAINER(alignment), "ind-music-volume-00.png", &main_widgets.volume_image);
 
 	// Volume label
-	alignment = label_create(&main_widgets.volume_label, "Sans 14", "darkorange", 0, 0, 1, 0, 0);
+	alignment = label_create(&main_widgets.volume_label, "Sans 5", "darkorange", 0, 0, 1, 0, 0);
 	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 6, 0, 10, 0);
 	gtk_box_pack_start(GTK_BOX(volume_box), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 	caption = g_strdup_printf(OMP_WIDGET_CAPTION_VOLUME, 0);
@@ -456,19 +456,19 @@
 
 	//  Balance image
 	alignment = gtk_alignment_new(0, 0, 0, 0);
-	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 10, 0, 35, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 35, 0);
 	gtk_box_pack_start(GTK_BOX(middle_right_vbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
 	container_add_image_with_ref(GTK_CONTAINER(alignment), "ind-music-pan-0.png", &main_widgets.balance_image);
 
 	// --- --- --- --- --- Lower hbox --- --- --- --- ---
 
 	// Add lower hbox containing the shuffle/repeat/balance buttons
-	alignment = gtk_alignment_new(0, 0, 1, 0);
+	alignment = gtk_alignment_new(0, 0, 0, 0);
 	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 25, 0, 25, 0);
 	gtk_box_pack_start(GTK_BOX(mainvbox), alignment, TRUE, TRUE, 0);
 
 	lower_hbox = gtk_hbutton_box_new();
-	gtk_button_box_set_layout(GTK_BUTTON_BOX(lower_hbox), GTK_BUTTONBOX_SPREAD);
+	gtk_box_set_spacing(GTK_BOX(lower_hbox), 4);
 	gtk_container_add(GTK_CONTAINER(alignment), lower_hbox);
 
 	// "balance left" button
@@ -477,12 +477,12 @@
 	gtk_box_pack_start(GTK_BOX(lower_hbox), button, TRUE, TRUE, 0);
 
 	// Shuffle toggle button
-	button = button_create_with_image("ico-shuffle.png",
+	button = button_create_with_image("ico-shuffle-off.png",
 		&main_widgets.shuffle_button_image, G_CALLBACK(omp_main_shuffle_clicked));
 	gtk_box_pack_start(GTK_BOX(lower_hbox), button, TRUE, TRUE, 0);
 
 	// Repeat toggle button
-	button = button_create_with_image("ico-repeat.png",
+	button = button_create_with_image("ico-repeat-off.png",
 		&main_widgets.repeat_button_image, G_CALLBACK(omp_main_repeat_clicked));
 	gtk_box_pack_start(GTK_BOX(lower_hbox), button, TRUE, TRUE, 0);
 
@@ -545,11 +545,11 @@
 	// --- --- --- --- --- Volume control --- --- --- --- --- ---
 	
 	alignment = gtk_alignment_new(0, 0, 0, 0);
-	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 15, 0, 71, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 10, 0, 71, 0);
 	gtk_box_pack_start(GTK_BOX(mainvbox), alignment, TRUE, TRUE, 0);
 
 	// Volume hscale
-	vol_scale = gtk_hscale_new_with_range(0.0, 100.0, 1.0);
+	vol_scale = gtk_hscale_new_with_range(0.0, 100.1, 1.0);
 	gtk_scale_set_draw_value(GTK_SCALE(vol_scale), FALSE);
 	GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(vol_scale), GTK_CAN_FOCUS);
 	gtk_widget_set_size_request(GTK_WIDGET(vol_scale), 338, 35);

Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playlist.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playlist.c	2007-08-29 00:44:49 UTC (rev 2846)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playlist.c	2007-08-29 06:37:42 UTC (rev 2847)
@@ -637,8 +637,9 @@
 	duration = omp_playback_get_track_length();
 	if ( (duration > 0) && (duration != omp_playlist_current_track->duration) )
 	{
-		omp_playlist_current_track->duration = duration;
-		omp_playlist_save();
+// @note BUGGY
+//		omp_playlist_current_track->duration = duration;
+//		omp_playlist_save();
 
 		// Notify UI of the change
 		g_signal_emit_by_name(G_OBJECT(omp_window), OMP_EVENT_PLAYLIST_TRACK_INFO_CHANGED,

Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playlist_page.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playlist_page.c	2007-08-29 00:44:49 UTC (rev 2846)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playlist_page.c	2007-08-29 06:37:42 UTC (rev 2847)
@@ -69,7 +69,7 @@
 	// Get user confirmation
 	dialog = gtk_message_dialog_new(0,
 		GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
-		_("\nLoad playlist '%s'?"), playlist_name);
+		_("Load playlist '%s'?"), playlist_name);
 
 	dialog_result = gtk_dialog_run(GTK_DIALOG(dialog));
 
@@ -102,7 +102,7 @@
 	// Get user confirmation
 	dialog = gtk_message_dialog_new(0,
 		GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
-		_("\nDelete playlist '%s'?"), playlist_name);
+		_("Delete playlist '%s'?"), playlist_name);
 
 	dialog_result = gtk_dialog_run(GTK_DIALOG(dialog));
 
@@ -290,6 +290,7 @@
 	gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), column);
 
 	renderer = gtk_cell_renderer_text_new();
+	g_object_set(G_OBJECT(renderer), "ellipsize", PANGO_ELLIPSIZE_END, "ellipsize-set", 1, NULL);
 	column = gtk_tree_view_column_new_with_attributes(_("Playlist Name"), renderer,
 		"text", NAME_COLUMN, NULL);
 	gtk_tree_view_column_set_expand(column, TRUE);
@@ -298,9 +299,9 @@
 	// Column with "delete" icon
 	renderer = gtk_cell_renderer_pixbuf_new();
 	g_object_set(G_OBJECT(renderer), "stock-id", "gtk-delete", NULL);
-	column = gtk_tree_view_column_new_with_attributes(_("Del?"), renderer, NULL);
+	column = gtk_tree_view_column_new_with_attributes("", renderer, NULL);
 	gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
-	gtk_tree_view_column_set_fixed_width(column, 2*BUTTON_PIXMAP_SIZE);
+	gtk_tree_view_column_set_fixed_width(column, 1*BUTTON_PIXMAP_SIZE);
 	gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), column);
 
 	// Add playlist view to container
@@ -319,7 +320,7 @@
 	main_vbox = gtk_vbox_new(FALSE, 0);
 
 	// Caption #1
-	alignment = label_create(&label, "Sans 14", "black", 0, 0, 0, 0, 0);
+	alignment = label_create(&label, "Sans 6", "black", 0, 0, 0, 0, 0);
 	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 5, 5, 5);
 	gtk_box_pack_start(GTK_BOX(main_vbox), GTK_WIDGET(alignment), FALSE, FALSE, 0);
 	gtk_label_set_text(GTK_LABEL(label), _("Select Playlist to load:"));
@@ -332,7 +333,7 @@
 	omp_playlist_page_list_create(GTK_CONTAINER(scroll_box));
 
 	// Caption #2
-	alignment = label_create(&label, "Sans 14", "black", 0, 0, 0, 0, 0);
+	alignment = label_create(&label, "Sans 6", "black", 0, 0, 0, 0, 0);
 	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 5, 5, 5);
 	gtk_box_pack_start(GTK_BOX(main_vbox), GTK_WIDGET(alignment), FALSE, FALSE, 0);
 	gtk_label_set_text(GTK_LABEL(label), _("Enter name to create a new playlist:"));





More information about the commitlog mailing list