[Xfce4-commits] <xfce4-panel:master> Tasklist: Bringing back 4.8 max-button-size property.
Nick Schermer
noreply at xfce.org
Fri Mar 30 21:32:01 CEST 2012
Updating branch refs/heads/master
to 42f1ea5f0fb3c64376328cd172e33019511bc1b3 (commit)
from df719a5472c7ce2a9fc42aa970b68b7218a03896 (commit)
commit 42f1ea5f0fb3c64376328cd172e33019511bc1b3
Author: Andrzej <ndrwrdck at gmail.com>
Date: Tue Mar 6 00:42:19 2012 +0900
Tasklist: Bringing back 4.8 max-button-size property.
plugins/tasklist/tasklist-widget.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index 934ed7e..ec0d035 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -44,6 +44,7 @@
+#define DEFAULT_BUTTON_SIZE (25)
#define DEFAULT_MAX_BUTTON_LENGTH (200)
#define DEFAULT_MENU_ICON_SIZE (16)
#define DEFAULT_MIN_BUTTON_LENGTH (DEFAULT_MAX_BUTTON_LENGTH / 4)
@@ -186,6 +187,7 @@ struct _XfceTasklist
/* gtk style properties */
gint max_button_length;
gint min_button_length;
+ gint max_button_size;
PangoEllipsizeMode ellipsize_mode;
gint minimized_icon_lucency;
gint menu_icon_size;
@@ -475,6 +477,14 @@ xfce_tasklist_class_init (XfceTasklistClass *klass)
EXO_PARAM_READABLE));
gtk_widget_class_install_style_property (gtkwidget_class,
+ g_param_spec_int ("max-button-size",
+ NULL,
+ "The maximum size of a window button",
+ 1, G_MAXINT,
+ DEFAULT_BUTTON_SIZE,
+ EXO_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (gtkwidget_class,
g_param_spec_enum ("ellipsize-mode",
NULL,
"The ellipsize mode used for the button label",
@@ -534,6 +544,7 @@ xfce_tasklist_init (XfceTasklist *tasklist)
tasklist->update_monitor_geometry_id = 0;
tasklist->max_button_length = DEFAULT_MAX_BUTTON_LENGTH;
tasklist->min_button_length = DEFAULT_MIN_BUTTON_LENGTH;
+ tasklist->max_button_size = DEFAULT_BUTTON_SIZE;
tasklist->minimized_icon_lucency = DEFAULT_ICON_LUCENCY;
tasklist->ellipsize_mode = DEFAULT_ELLIPSIZE_MODE;
tasklist->grouping = XFCE_TASKLIST_GROUPING_DEFAULT;
@@ -1091,6 +1102,7 @@ xfce_tasklist_style_set (GtkWidget *widget,
{
XfceTasklist *tasklist = XFCE_TASKLIST (widget);
gint max_button_length;
+ gint max_button_size;
gint min_button_length;
gint w, h;
@@ -1102,6 +1114,7 @@ xfce_tasklist_style_set (GtkWidget *widget,
"max-button-length", &max_button_length,
"min-button-length", &min_button_length,
"ellipsize-mode", &tasklist->ellipsize_mode,
+ "max-button-size", &max_button_size,
"minimized-icon-lucency", &tasklist->minimized_icon_lucency,
"menu-max-width-chars", &tasklist->menu_max_width_chars,
NULL);
@@ -1111,6 +1124,7 @@ xfce_tasklist_style_set (GtkWidget *widget,
/* update the widget */
if (tasklist->max_button_length != max_button_length
+ || tasklist->max_button_size != max_button_size
|| tasklist->min_button_length != min_button_length)
{
if (max_button_length > 0)
@@ -1125,6 +1139,8 @@ xfce_tasklist_style_set (GtkWidget *widget,
tasklist->min_button_length = min_button_length;
}
+ tasklist->max_button_size = max_button_size;
+
gtk_widget_queue_resize (widget);
}
}
More information about the Xfce4-commits
mailing list