Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-pulseaudio-plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bodqhrohro
xfce4-pulseaudio-plugin
Commits
314286b6
Commit
314286b6
authored
10 years ago
by
Simon Steinbeiss
Committed by
Andrzej
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use symbolic icons in the panel
parent
40ecf637
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
panel-plugin/pulseaudio-button.c
+11
-13
11 additions, 13 deletions
panel-plugin/pulseaudio-button.c
with
11 additions
and
13 deletions
panel-plugin/pulseaudio-button.c
+
11
−
13
View file @
314286b6
...
@@ -52,10 +52,10 @@
...
@@ -52,10 +52,10 @@
/* Icons for different volume levels */
/* Icons for different volume levels */
static
const
char
*
icons
[]
=
{
static
const
char
*
icons
[]
=
{
"audio-volume-muted"
,
"audio-volume-muted
-symbolic
"
,
"audio-volume-low"
,
"audio-volume-low
-symbolic
"
,
"audio-volume-medium"
,
"audio-volume-medium
-symbolic
"
,
"audio-volume-high"
,
"audio-volume-high
-symbolic
"
,
NULL
NULL
};
};
...
@@ -138,7 +138,7 @@ pulseaudio_button_init (PulseaudioButton *button)
...
@@ -138,7 +138,7 @@ pulseaudio_button_init (PulseaudioButton *button)
/* Preload icons */
/* Preload icons */
button
->
pixbuf_idx
=
0
;
button
->
pixbuf_idx
=
0
;
button
->
pixbufs
=
g_new0
(
GdkPixbuf
*
,
G_N_ELEMENTS
(
icons
)
-
1
);
button
->
pixbufs
=
g_new0
(
GdkPixbuf
*
,
G_N_ELEMENTS
(
icons
)
-
1
);
pulseaudio_button_update_icons
(
button
);
g_signal_connect
(
G_OBJECT
(
button
),
"style_updated"
,
G_CALLBACK
(
pulseaudio_button_update_icons
),
button
);
/* Setup Gtk style */
/* Setup Gtk style */
css_provider
=
gtk_css_provider_new
();
css_provider
=
gtk_css_provider_new
();
...
@@ -266,24 +266,22 @@ pulseaudio_button_menu_deactivate (PulseaudioButton *button,
...
@@ -266,24 +266,22 @@ pulseaudio_button_menu_deactivate (PulseaudioButton *button,
static
void
static
void
pulseaudio_button_update_icons
(
PulseaudioButton
*
button
)
pulseaudio_button_update_icons
(
PulseaudioButton
*
button
)
{
{
GtkIconTheme
*
icon_theme
;
guint
i
;
guint
i
;
GtkIconInfo
*
info
;
GtkStyleContext
*
context
;
gboolean
is_symbolic
;
g_return_if_fail
(
IS_PULSEAUDIO_BUTTON
(
button
));
g_return_if_fail
(
IS_PULSEAUDIO_BUTTON
(
button
));
i
con
_theme
=
gtk_icon_theme_get_for_screen
(
gtk_widget_get_
screen
(
GTK_WIDGET
(
button
)));
con
text
=
GTK_STYLE_CONTEXT
(
gtk_widget_get_style_context
(
GTK_WIDGET
(
gtk_widget_get_
parent
(
GTK_WIDGET
(
button
)))
))
;
/* Pre-load all icons */
/* Pre-load all icons */
for
(
i
=
0
;
i
<
G_N_ELEMENTS
(
icons
)
-
1
;
++
i
)
for
(
i
=
0
;
i
<
G_N_ELEMENTS
(
icons
)
-
1
;
++
i
)
{
{
if
(
GDK_IS_PIXBUF
(
button
->
pixbufs
[
i
]))
if
(
GDK_IS_PIXBUF
(
button
->
pixbufs
[
i
]))
g_object_unref
(
G_OBJECT
(
button
->
pixbufs
[
i
]));
g_object_unref
(
G_OBJECT
(
button
->
pixbufs
[
i
]));
info
=
gtk_icon_theme_lookup_icon
(
gtk_icon_theme_get_default
(),
icons
[
i
],
button
->
icon_size
,
GTK_ICON_LOOKUP_USE_BUILTIN
);
button
->
pixbufs
[
i
]
=
gtk_icon_theme_load_icon
(
icon_theme
,
button
->
pixbufs
[
i
]
=
gtk_icon_info_load_symbolic_for_context
(
info
,
context
,
NULL
,
NULL
);
icons
[
i
],
button
->
icon_size
,
GTK_ICON_LOOKUP_USE_BUILTIN
,
NULL
);
}
}
/* Update the state of the button */
/* Update the state of the button */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment