gui/audio: Remove "By:" and "From:"

I replaced these with images that have similar meanings.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-04-25 11:38:20 -04:00
parent e73ae0612d
commit c01561831c
3 changed files with 45 additions and 25 deletions

View File

@ -9,10 +9,10 @@
static inline void __audio_set_label(const gchar *label, const gchar *size,
const gchar *prefix, const gchar *text)
const gchar *text)
{
gchar *markup = g_markup_printf_escaped("<span size='%s'>%s%s</span>",
size, prefix, text);
gchar *markup = g_markup_printf_escaped("<span size='%s'>%s</span>",
size, text);
gtk_label_set_markup(GTK_LABEL(gui_builder_widget(label)), markup);
g_free(markup);
}
@ -20,15 +20,15 @@ static inline void __audio_set_label(const gchar *label, const gchar *size,
static inline void __audio_set_time_label(const gchar *label, unsigned int time)
{
gchar *str = string_sec2str(time);
__audio_set_label(label, "large", "", str);
__audio_set_label(label, "large", str);
g_free(str);
}
static void __audio_load(struct track *track)
{
__audio_set_label("o_title", "xx-large", "", track->tr_title);
__audio_set_label("o_artist", "x-large", "By: ", track->tr_artist->ar_name);
__audio_set_label("o_album", "x-large", "From: ", track->tr_album->al_name);
__audio_set_label("o_title", "xx-large", track->tr_title);
__audio_set_label("o_artist", "x-large", track->tr_artist->ar_name);
__audio_set_label("o_album", "x-large", track->tr_album->al_name);
__audio_set_time_label("o_duration", track->tr_length);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gui_builder_widget("o_hide")),

View File

@ -422,10 +422,12 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="box7">
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="halign">start</property>
<property name="column_spacing">5</property>
<property name="row_homogeneous">True</property>
<child>
<object class="GtkLabel" id="o_title">
<property name="visible">True</property>
@ -435,9 +437,9 @@
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
</packing>
</child>
<child>
@ -449,9 +451,8 @@
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
@ -463,9 +464,32 @@
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="icon_name">system-users</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="icon_name">media-optical</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>

View File

@ -48,8 +48,8 @@ static void test_audio_seek(gint64 pos)
static void test_audio()
{
gchar *album, *artist, *duration;
struct track *track;
gchar *duration;
int argc = 0;
gtk_init(&argc, NULL);
@ -71,18 +71,14 @@ static void test_audio()
playlist_add(PL_HIDDEN, track);
audio_load(track);
album = g_strdup_printf("From: %s", track->tr_album->al_name);
artist = g_strdup_printf("By: %s", track->tr_artist->ar_name);
duration = string_sec2str(track->tr_length);
test_equal(test_get_label_text("o_title"), track->tr_title);
test_equal(test_get_label_text("o_album"), album);
test_equal(test_get_label_text("o_artist"), artist);
test_equal(test_get_label_text("o_album"), track->tr_album->al_name);
test_equal(test_get_label_text("o_artist"), track->tr_artist->ar_name);
test_equal(test_get_label_text("o_position"), "0:00");
test_equal(test_get_label_text("o_duration"), duration);
test_equal(test_get_toggle_state("o_favorite"), (bool)true);
test_equal(test_get_toggle_state("o_hide"), (bool)true);
g_free(album);
g_free(artist);
g_free(duration);
test_click_button("o_play");