aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-audio.c
blob: 48acaa3645ac84cde7ea612461db0748e2464d28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

#include <gtk/gtk.h>
#include "slidermenuitem.h"
#include "indicator-audio.h"

void
block_prelight (GtkWidget * widget, GtkStateType prev, gpointer data)
{
	if (GTK_WIDGET_STATE(widget) == GTK_STATE_PRELIGHT) {
		gtk_widget_set_state(widget, prev);
	}
	return;
}

GtkWidget *
create_output_menu_item (void)
{
	GtkWidget * menuitem = slider_menu_item_new("Volume:", 0.0, 1.0, 0.02);

	return menuitem;
}

GtkWidget *
indicator_audio_menuitem (void)
{
	GtkWidget * mainmenu = gtk_menu_item_new();

	GtkWidget * icon = gtk_image_new_from_icon_name("audio-volume-muted",
	                                                GTK_ICON_SIZE_MENU);

	gtk_container_add(GTK_CONTAINER(mainmenu), icon);
	gtk_widget_show(icon);

	GtkWidget * menu = gtk_menu_new();

	GtkWidget * item = create_output_menu_item();
	gtk_menu_append(GTK_MENU(menu), item);
	gtk_widget_show(item);

	gtk_menu_item_set_submenu(GTK_MENU_ITEM(mainmenu), menu);
	gtk_widget_show(menu);

	return mainmenu;
}