[Xfce4-commits] [panel-plugins/xfce4-timer-plugin] 09/22: Center progress bar in panel icon
noreply at xfce.org
noreply at xfce.org
Sat Dec 30 06:16:30 CET 2017
This is an automated email from the git hooks/post-receive script.
a n d 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-timer-plugin.
commit 15357f3a2356eb3c7c58e8e9f82620f9de2baeba
Author: Daniel Muñiz Fontoira <dani at damufo.com>
Date: Mon Dec 11 18:34:09 2017 +0100
Center progress bar in panel icon
---
panel-plugin/xfcetimer.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/panel-plugin/xfcetimer.c b/panel-plugin/xfcetimer.c
index 7f9e22d..e3110e9 100644
--- a/panel-plugin/xfcetimer.c
+++ b/panel-plugin/xfcetimer.c
@@ -22,7 +22,7 @@
milliseconds */
#define PBAR_THICKNESS 10
-#define BORDER 8
+#define BORDER 4
#define WIDGET_SPACING 2
#ifdef HAVE_CONFIG_H
@@ -1076,13 +1076,15 @@ static void add_pbar(XfcePanelPlugin *plugin, plugin_data *pd){
/* vertical bar */
if(xfce_panel_plugin_get_orientation(plugin)==GTK_ORIENTATION_HORIZONTAL){
pd->box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
- //gtk_container_set_border_width (GTK_CONTAINER(pd->box), BORDER/2);
- gtk_container_set_border_width (GTK_CONTAINER(pd->box), 0);
+ gtk_widget_set_halign (GTK_WIDGET (pd->pbar), GTK_ALIGN_CENTER);
+ gtk_widget_set_hexpand (GTK_WIDGET (pd->pbar), TRUE);
+ gtk_container_set_border_width (GTK_CONTAINER(pd->box), BORDER/2);
+ //gtk_container_set_border_width (GTK_CONTAINER(pd->box), 0);
gtk_container_add(GTK_CONTAINER(plugin),pd->box);
gtk_orientable_set_orientation(GTK_ORIENTABLE(pd->pbar),
GTK_ORIENTATION_VERTICAL);
- gtk_widget_set_size_request(GTK_WIDGET(pd->pbar),PBAR_THICKNESS,0);
+ //gtk_widget_set_size_request(GTK_WIDGET(pd->pbar),PBAR_THICKNESS,0);
//gtk_box_pack_start(GTK_BOX(pd->box),
// gtk_separator_new(GTK_ORIENTATION_VERTICAL),
// FALSE, FALSE, 0);
@@ -1094,13 +1096,15 @@ static void add_pbar(XfcePanelPlugin *plugin, plugin_data *pd){
}
else{ /* horizontal bar */
pd->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- //gtk_container_set_border_width (GTK_CONTAINER(pd->box), BORDER/2);
+ gtk_widget_set_valign (GTK_WIDGET (pd->pbar), GTK_ALIGN_CENTER);
+ gtk_widget_set_vexpand (GTK_WIDGET (pd->pbar), TRUE);
+ //gtk_container_set_border_width (GTK_CONTAINER(pd->box), BORDER/2);
gtk_container_set_border_width (GTK_CONTAINER(pd->box), BORDER/2);
gtk_container_add(GTK_CONTAINER(plugin),pd->box);
gtk_orientable_set_orientation(GTK_ORIENTABLE(pd->pbar),
GTK_ORIENTATION_HORIZONTAL);
- gtk_widget_set_size_request(GTK_WIDGET(pd->pbar),0,PBAR_THICKNESS);
+ //gtk_widget_set_size_request(GTK_WIDGET(pd->pbar),0,PBAR_THICKNESS);
//gtk_box_pack_start(GTK_BOX(pd->box),
// gtk_separator_new(GTK_ORIENTATION_HORIZONTAL),
// FALSE, FALSE, 0);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list