[Xfce4-commits] [panel-plugins/xfce4-pulseaudio-plugin] 07/21: Show non-symbolic device icons, strip label from scalemenuitem and decrease icon size to 16
noreply at xfce.org
noreply at xfce.org
Sat Sep 23 21:27:33 CEST 2017
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-pulseaudio-plugin.
commit 1c71eb3b227066ee01fadcdd39b6b50d041a0e49
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Mon Sep 11 00:12:16 2017 -0400
Show non-symbolic device icons, strip label from scalemenuitem and decrease icon size to 16
---
panel-plugin/devicemenuitem.c | 4 +-
panel-plugin/pulseaudio-menu.c | 10 ++---
panel-plugin/scalemenuitem.c | 99 ++----------------------------------------
panel-plugin/scalemenuitem.h | 3 --
4 files changed, 9 insertions(+), 107 deletions(-)
diff --git a/panel-plugin/devicemenuitem.c b/panel-plugin/devicemenuitem.c
index 0d7f6d2..10130cf 100644
--- a/panel-plugin/devicemenuitem.c
+++ b/panel-plugin/devicemenuitem.c
@@ -187,9 +187,9 @@ device_menu_item_set_image_from_icon_name (DeviceMenuItem *item,
g_return_if_fail (IS_DEVICE_MENU_ITEM (item));
- img = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
+ img = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_LARGE_TOOLBAR);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), img);
G_GNUC_END_IGNORE_DEPRECATIONS
- gtk_image_set_pixel_size (GTK_IMAGE (img), 16);
+ gtk_image_set_pixel_size (GTK_IMAGE (img), 24);
}
diff --git a/panel-plugin/pulseaudio-menu.c b/panel-plugin/pulseaudio-menu.c
index b942113..ccefadf 100644
--- a/panel-plugin/pulseaudio-menu.c
+++ b/panel-plugin/pulseaudio-menu.c
@@ -449,7 +449,7 @@ pulseaudio_menu_new (PulseaudioVolume *volume,
sources = pulseaudio_volume_get_output_list (menu->volume);
if (g_list_length (sources) > 0) {
device_mi = device_menu_item_new_with_label (_("Audio Output"));
- device_menu_item_set_image_from_icon_name (DEVICE_MENU_ITEM (device_mi), "audio-speakers-symbolic");
+ device_menu_item_set_image_from_icon_name (DEVICE_MENU_ITEM (device_mi), "audio-speakers");
for (GList *list = sources; list != NULL; list = g_list_next (list)) {
device_menu_item_add_device (DEVICE_MENU_ITEM (device_mi), (gchar *)list->data, pulseaudio_volume_get_output_by_name (menu->volume, list->data));
@@ -464,8 +464,7 @@ pulseaudio_menu_new (PulseaudioVolume *volume,
/* output volume slider */
mi = scale_menu_item_new_with_range (0.0, volume_max, 1.0);
- scale_menu_item_set_image_from_icon_name (SCALE_MENU_ITEM (mi), "audio-volume-high-symbolic");
- scale_menu_item_set_description_label (SCALE_MENU_ITEM (mi), _("<b>Audio output volume</b>"));
+ scale_menu_item_set_image_from_icon_name (SCALE_MENU_ITEM (mi), "audio-volume-medium-symbolic");
/* range slider */
menu->range_output = scale_menu_item_get_scale (SCALE_MENU_ITEM (mi));
@@ -492,7 +491,7 @@ pulseaudio_menu_new (PulseaudioVolume *volume,
sources = pulseaudio_volume_get_input_list (menu->volume);
if (g_list_length (sources) > 0) {
device_mi = device_menu_item_new_with_label (_("Audio Input"));
- device_menu_item_set_image_from_icon_name (DEVICE_MENU_ITEM (device_mi), "audio-input-microphone-symbolic");
+ device_menu_item_set_image_from_icon_name (DEVICE_MENU_ITEM (device_mi), "audio-input-microphone");
for (GList *list = sources; list != NULL; list = g_list_next (list)) {
device_menu_item_add_device (DEVICE_MENU_ITEM (device_mi), (gchar *)list->data, pulseaudio_volume_get_input_by_name (menu->volume, list->data));
@@ -507,8 +506,7 @@ pulseaudio_menu_new (PulseaudioVolume *volume,
/* input volume slider */
mi = scale_menu_item_new_with_range (0.0, volume_max, 1.0);
- scale_menu_item_set_image_from_icon_name (SCALE_MENU_ITEM (mi), "microphone-sensitivity-high-symbolic");
- scale_menu_item_set_description_label (SCALE_MENU_ITEM (mi), _("<b>Audio input volume</b>"));
+ scale_menu_item_set_image_from_icon_name (SCALE_MENU_ITEM (mi), "microphone-sensitivity-medium-symbolic");
/* range slider */
menu->range_input = scale_menu_item_get_scale (SCALE_MENU_ITEM (mi));
diff --git a/panel-plugin/scalemenuitem.c b/panel-plugin/scalemenuitem.c
index a817dd4..492dc8a 100644
--- a/panel-plugin/scalemenuitem.c
+++ b/panel-plugin/scalemenuitem.c
@@ -53,9 +53,7 @@ static void update_packing (ScaleMenuItem * sel
struct _ScaleMenuItemPrivate {
GtkWidget *scale;
- GtkWidget *description_label;
GtkWidget *percentage_label;
- GtkWidget *vbox;
GtkWidget *hbox;
gboolean grabbed;
gboolean ignore_value_changed;
@@ -178,66 +176,36 @@ update_packing (ScaleMenuItem *self)
{
ScaleMenuItemPrivate *priv;
GtkBox *hbox;
- GtkBox *vbox;
g_return_if_fail (IS_SCALE_MENU_ITEM (self));
priv = GET_PRIVATE (self);
hbox = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
- vbox = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
TRACE("entering");
if (priv->hbox)
remove_children (GTK_CONTAINER (priv->hbox));
- if (priv->vbox)
- {
- remove_children (GTK_CONTAINER (priv->vbox));
- gtk_container_remove (GTK_CONTAINER (self), priv->vbox);
- }
priv->hbox = GTK_WIDGET(hbox);
- priv->vbox = GTK_WIDGET(vbox);
/* add the new layout */
- if (priv->description_label && priv->percentage_label)
- {
- /* [IC] Description
- * [ON] <----slider----> [percentage]%
- */
- gtk_box_pack_start (vbox, priv->description_label, FALSE, FALSE, 0);
- gtk_box_pack_start (vbox, priv->hbox, TRUE, TRUE, 0);
- gtk_box_pack_start (hbox, priv->scale, TRUE, TRUE, 0);
- gtk_box_pack_start (hbox, priv->percentage_label, FALSE, FALSE, 0);
- }
- else if (priv->description_label)
- {
- /* [IC] Description
- * [ON] <----slider---->
- */
- gtk_box_pack_start (vbox, priv->description_label, FALSE, FALSE, 0);
- gtk_box_pack_start (vbox, priv->hbox, TRUE, TRUE, 0);
- gtk_box_pack_start (hbox, priv->scale, TRUE, TRUE, 0);
- }
- else if (priv->percentage_label)
+ if (priv->percentage_label)
{
/* [ICON] <----slider----> [percentage]% */
- gtk_box_pack_start (vbox, priv->hbox, TRUE, TRUE, 0);
gtk_box_pack_start (hbox, priv->scale, TRUE, TRUE, 0);
gtk_box_pack_start (hbox, priv->percentage_label, FALSE, FALSE, 0);
}
else
{
/* [ICON] <----slider----> */
- gtk_box_pack_start (vbox, priv->hbox, TRUE, TRUE, 0);
gtk_box_pack_start (hbox, priv->scale, TRUE, TRUE, 0);
}
- gtk_widget_show_all (priv->vbox);
gtk_widget_show_all (priv->hbox);
- gtk_container_add (GTK_CONTAINER (self), priv->vbox);
+ gtk_container_add (GTK_CONTAINER (self), priv->hbox);
}
static void
@@ -381,7 +349,6 @@ scale_menu_item_new_with_range (gdouble min,
priv = GET_PRIVATE (scale_item);
priv->scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, min, max, step);
- priv->vbox = NULL;
priv->hbox = NULL;
g_signal_connect (priv->scale, "value-changed", G_CALLBACK (scale_menu_item_scale_value_changed), scale_item);
@@ -419,25 +386,6 @@ scale_menu_item_get_scale (ScaleMenuItem *menuitem)
return priv->scale;
}
-/**
- * scale_menu_item_get_description_label:
- * @menuitem: The #ScaleMenuItem
- *
- * Retrieves a string of the text for the description label widget.
- *
- * Return Value: The label text.
- **/
-const gchar*
-scale_menu_item_get_description_label (ScaleMenuItem *menuitem)
-{
- ScaleMenuItemPrivate *priv;
-
- g_return_val_if_fail (IS_SCALE_MENU_ITEM (menuitem), NULL);
-
- priv = GET_PRIVATE (menuitem);
-
- return gtk_label_get_text (GTK_LABEL (priv->description_label));
-}
/**
* scale_menu_item_get_percentage_label:
@@ -471,46 +419,6 @@ scale_menu_item_label_new (const gchar *str)
return label;
}
-/**
- * scale_menu_item_set_description_label:
- * @menuitem: The #ScaleMenuItem
- * @label: The label text
- *
- * Sets the text for the description label widget. If label is NULL
- * then the description label is removed from the #ScaleMenuItem.
- **/
-void
-scale_menu_item_set_description_label (ScaleMenuItem *menuitem,
- const gchar *label)
-{
- ScaleMenuItemPrivate *priv;
-
- g_return_if_fail (IS_SCALE_MENU_ITEM (menuitem));
-
- priv = GET_PRIVATE (menuitem);
-
- if (label == NULL && priv->description_label)
- {
- /* remove label */
- g_object_unref (priv->description_label);
- priv->description_label = NULL;
- return;
- }
-
- if (priv->description_label && label)
- {
- gtk_label_set_markup (GTK_LABEL (priv->description_label), label);
- }
- else if (label)
- {
- /* create label */
- priv->description_label = scale_menu_item_label_new (NULL);
- gtk_label_set_markup (GTK_LABEL (priv->description_label), label);
- }
-
- update_packing (menuitem);
-}
-
/**
* scale_menu_item_set_percentage_label:
@@ -585,9 +493,8 @@ scale_menu_item_set_image_from_icon_name (ScaleMenuItem *item,
g_return_if_fail (IS_SCALE_MENU_ITEM (item));
- img = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_LARGE_TOOLBAR);
+ img = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), img);
G_GNUC_END_IGNORE_DEPRECATIONS
- gtk_image_set_pixel_size (GTK_IMAGE (img), 24);
}
diff --git a/panel-plugin/scalemenuitem.h b/panel-plugin/scalemenuitem.h
index 2d793e2..482b95b 100644
--- a/panel-plugin/scalemenuitem.h
+++ b/panel-plugin/scalemenuitem.h
@@ -65,11 +65,8 @@ GtkWidget *scale_menu_item_new_with_range (gdouble min,
GtkWidget *scale_menu_item_get_scale (ScaleMenuItem *menuitem);
-const gchar *scale_menu_item_get_description_label (ScaleMenuItem *menuitem);
const gchar *scale_menu_item_get_percentage_label (ScaleMenuItem *menuitem);
-void scale_menu_item_set_description_label (ScaleMenuItem *menuitem,
- const gchar *label);
void scale_menu_item_set_percentage_label (ScaleMenuItem *menuitem,
const gchar *label);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list