Introduced icons in frame labels
This commit is contained in:
parent
ff1c5c3b33
commit
d38b3e3e8c
14
po/fr.po
14
po/fr.po
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Mixer 0.0.1\n"
|
"Project-Id-Version: Mixer 0.0.1\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2011-08-11 23:35+0200\n"
|
"POT-Creation-Date: 2011-08-22 00:24+0200\n"
|
||||||
"PO-Revision-Date: 2010-04-23 04:08+0200\n"
|
"PO-Revision-Date: 2010-04-23 04:08+0200\n"
|
||||||
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
|
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
|
||||||
"Language-Team: French\n"
|
"Language-Team: French\n"
|
||||||
|
@ -84,26 +84,26 @@ msgstr "_Vue"
|
||||||
msgid "_Help"
|
msgid "_Help"
|
||||||
msgstr "_Aide"
|
msgstr "_Aide"
|
||||||
|
|
||||||
#: ../src/mixer.c:448
|
#: ../src/mixer.c:514
|
||||||
msgid "Bind"
|
msgid "Bind"
|
||||||
msgstr "Lier"
|
msgstr "Lier"
|
||||||
|
|
||||||
#: ../src/mixer.c:603
|
#: ../src/mixer.c:669
|
||||||
msgid "Mixer properties"
|
msgid "Mixer properties"
|
||||||
msgstr "Propriétés du mixer"
|
msgstr "Propriétés du mixer"
|
||||||
|
|
||||||
#: ../src/mixer.c:619
|
#: ../src/mixer.c:685
|
||||||
msgid "Name: "
|
msgid "Name: "
|
||||||
msgstr "Nom : "
|
msgstr "Nom : "
|
||||||
|
|
||||||
#: ../src/mixer.c:629
|
#: ../src/mixer.c:695
|
||||||
msgid "Version: "
|
msgid "Version: "
|
||||||
msgstr "Version : "
|
msgstr "Version : "
|
||||||
|
|
||||||
#: ../src/mixer.c:639
|
#: ../src/mixer.c:705
|
||||||
msgid "Device: "
|
msgid "Device: "
|
||||||
msgstr "Carte : "
|
msgstr "Carte : "
|
||||||
|
|
||||||
#: ../src/mixer.c:728 ../src/mixer.c:733
|
#: ../src/mixer.c:794 ../src/mixer.c:799
|
||||||
msgid "Error"
|
msgid "Error"
|
||||||
msgstr "Erreur"
|
msgstr "Erreur"
|
||||||
|
|
72
src/mixer.c
72
src/mixer.c
|
@ -186,6 +186,8 @@ static int _mixer_set_control(Mixer * mixer, int index, MixerControl * control);
|
||||||
|
|
||||||
/* public */
|
/* public */
|
||||||
/* mixer_new */
|
/* mixer_new */
|
||||||
|
static GtkWidget * _new_frame_label(GdkPixbuf * pixbuf, char const * name,
|
||||||
|
char const * label);
|
||||||
#ifdef AUDIO_MIXER_DEVINFO
|
#ifdef AUDIO_MIXER_DEVINFO
|
||||||
static GtkWidget * _new_enum(Mixer * mixer, int dev,
|
static GtkWidget * _new_enum(Mixer * mixer, int dev,
|
||||||
struct audio_mixer_enum * e);
|
struct audio_mixer_enum * e);
|
||||||
|
@ -199,6 +201,7 @@ Mixer * mixer_new(char const * device, MixerOrientation orientation)
|
||||||
GtkAccelGroup * group;
|
GtkAccelGroup * group;
|
||||||
GtkWidget * scrolled;
|
GtkWidget * scrolled;
|
||||||
GtkWidget * vbox;
|
GtkWidget * vbox;
|
||||||
|
GtkWidget * label;
|
||||||
GtkWidget * widget;
|
GtkWidget * widget;
|
||||||
GtkWidget * hvbox;
|
GtkWidget * hvbox;
|
||||||
GtkWidget * hbox;
|
GtkWidget * hbox;
|
||||||
|
@ -210,7 +213,8 @@ Mixer * mixer_new(char const * device, MixerOrientation orientation)
|
||||||
size_t u;
|
size_t u;
|
||||||
#else
|
#else
|
||||||
int value;
|
int value;
|
||||||
char const * names[] = SOUND_DEVICE_LABELS;
|
char const * labels[] = SOUND_DEVICE_LABELS;
|
||||||
|
char const * names[] = SOUND_DEVICE_NAMES;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if((mixer = malloc(sizeof(*mixer))) == NULL)
|
if((mixer = malloc(sizeof(*mixer))) == NULL)
|
||||||
|
@ -262,6 +266,7 @@ Mixer * mixer_new(char const * device, MixerOrientation orientation)
|
||||||
hvbox = gtk_vbox_new(TRUE, 4);
|
hvbox = gtk_vbox_new(TRUE, 4);
|
||||||
else
|
else
|
||||||
hvbox = gtk_hbox_new(FALSE, 4);
|
hvbox = gtk_hbox_new(FALSE, 4);
|
||||||
|
gtk_container_set_border_width(GTK_CONTAINER(hvbox), 4);
|
||||||
for(i = 0;; i++)
|
for(i = 0;; i++)
|
||||||
{
|
{
|
||||||
#ifdef AUDIO_MIXER_DEVINFO
|
#ifdef AUDIO_MIXER_DEVINFO
|
||||||
|
@ -321,7 +326,9 @@ Mixer * mixer_new(char const * device, MixerOrientation orientation)
|
||||||
if(control == NULL)
|
if(control == NULL)
|
||||||
continue;
|
continue;
|
||||||
gtk_container_set_border_width(GTK_CONTAINER(control), 4);
|
gtk_container_set_border_width(GTK_CONTAINER(control), 4);
|
||||||
widget = gtk_frame_new(md.label.name);
|
label = _new_frame_label(NULL, md.label.name, NULL);
|
||||||
|
widget = gtk_frame_new(NULL);
|
||||||
|
gtk_frame_set_label_widget(GTK_FRAME(widget), label);
|
||||||
gtk_container_add(GTK_CONTAINER(widget), control);
|
gtk_container_add(GTK_CONTAINER(widget), control);
|
||||||
if(hbox == NULL)
|
if(hbox == NULL)
|
||||||
{
|
{
|
||||||
|
@ -338,7 +345,9 @@ Mixer * mixer_new(char const * device, MixerOrientation orientation)
|
||||||
continue;
|
continue;
|
||||||
control = _new_value(mixer, i);
|
control = _new_value(mixer, i);
|
||||||
gtk_container_set_border_width(GTK_CONTAINER(control), 4);
|
gtk_container_set_border_width(GTK_CONTAINER(control), 4);
|
||||||
widget = gtk_frame_new(names[i]);
|
label = _new_frame_label(NULL, names[i], labels[i]);
|
||||||
|
widget = gtk_frame_new(NULL);
|
||||||
|
gtk_frame_set_label_widget(GTK_FRAME(widget), label);
|
||||||
gtk_container_add(GTK_CONTAINER(widget), control);
|
gtk_container_add(GTK_CONTAINER(widget), control);
|
||||||
gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 0);
|
gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -353,6 +362,63 @@ Mixer * mixer_new(char const * device, MixerOrientation orientation)
|
||||||
return mixer;
|
return mixer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GtkWidget * _new_frame_label(GdkPixbuf * pixbuf, char const * name,
|
||||||
|
char const * label)
|
||||||
|
{
|
||||||
|
GtkIconTheme * icontheme;
|
||||||
|
GtkWidget * hbox;
|
||||||
|
GtkWidget * widget;
|
||||||
|
|
||||||
|
icontheme = gtk_icon_theme_get_default();
|
||||||
|
hbox = gtk_hbox_new(FALSE, 4);
|
||||||
|
if(pixbuf == NULL)
|
||||||
|
{
|
||||||
|
if(strncmp(name, "cd", 2) == 0)
|
||||||
|
pixbuf = gtk_icon_theme_load_icon(icontheme,
|
||||||
|
"media-cdrom", 16,
|
||||||
|
GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
|
||||||
|
else if(strncmp(name, "line", 4) == 0
|
||||||
|
|| strncmp(name, "source", 5) == 0)
|
||||||
|
pixbuf = gtk_icon_theme_load_icon(icontheme,
|
||||||
|
"stock_line-in", 16,
|
||||||
|
GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
|
||||||
|
else if(strncmp(name, "master", 6) == 0
|
||||||
|
|| strncmp(name, "pcm", 3) == 0
|
||||||
|
|| strncmp(name, "vol", 3) == 0)
|
||||||
|
pixbuf = gtk_icon_theme_load_icon(icontheme,
|
||||||
|
"audio-volume-high", 16,
|
||||||
|
GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
|
||||||
|
else if(strncmp(name, "mic", 3) == 0)
|
||||||
|
pixbuf = gtk_icon_theme_load_icon(icontheme,
|
||||||
|
"audio-input-microphone", 16,
|
||||||
|
GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
|
||||||
|
else if(strncmp(name, "rec", 3) == 0)
|
||||||
|
pixbuf = gtk_icon_theme_load_icon(icontheme,
|
||||||
|
"gtk-media-record", 16,
|
||||||
|
GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
|
||||||
|
/* more generic fallbacks */
|
||||||
|
else if(strstr(name, "sel") != NULL)
|
||||||
|
pixbuf = gtk_icon_theme_load_icon(icontheme,
|
||||||
|
"stock_line-in", 16,
|
||||||
|
GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
|
||||||
|
else if(strstr(name, ".mute") != NULL)
|
||||||
|
pixbuf = gtk_icon_theme_load_icon(icontheme,
|
||||||
|
"audio-volume-muted", 16,
|
||||||
|
GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
|
||||||
|
}
|
||||||
|
if(pixbuf != NULL)
|
||||||
|
{
|
||||||
|
widget = gtk_image_new_from_pixbuf(pixbuf);
|
||||||
|
gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 0);
|
||||||
|
}
|
||||||
|
if(label == NULL)
|
||||||
|
label = name;
|
||||||
|
widget = gtk_label_new(label);
|
||||||
|
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
|
||||||
|
gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, 0);
|
||||||
|
return hbox;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef AUDIO_MIXER_DEVINFO
|
#ifdef AUDIO_MIXER_DEVINFO
|
||||||
static GtkWidget * _new_enum(Mixer * mixer, int dev,
|
static GtkWidget * _new_enum(Mixer * mixer, int dev,
|
||||||
struct audio_mixer_enum * e)
|
struct audio_mixer_enum * e)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user