Commit fa148aa4 authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz
Browse files

Fix window list button size. Applet part of bug #310809.

2007-06-26  Vincent Untz  <vuntz@gnome.org>

	Fix window list button size.
	Applet part of bug #310809.

	* window-list.c: (applet_size_request): simplify a lot, since we don't
	care about the minimum width/height anymore. Also, the base for the
	size hints is 0 now, it's not the width of the child size request
	since the width of the child size request is the best size for the
	child, not the minimum size for it. Basically, size hints + size
	requests are just weird. You generally want to use one or another, not
	a mix like what was done before.

svn path=/trunk/; revision=10481
parent 21715d41
2007-06-26 Vincent Untz <vuntz@gnome.org>
Fix window list button size.
Applet part of bug #310809.
* window-list.c: (applet_size_request): simplify a lot, since we don't
care about the minimum width/height anymore. Also, the base for the
size hints is 0 now, it's not the width of the child size request
since the width of the child size request is the best size for the
child, not the minimum size for it. Basically, size hints + size
requests are just weird. You generally want to use one or another, not
a mix like what was done before.
2007-06-18 Vincent Untz <vuntz@gnome.org>
* window-list.c: (applet_realized): wnck_tasklist_set_screen() is
......
......@@ -483,48 +483,15 @@ applet_size_request (GtkWidget *widget,
int len;
const int *size_hints;
GtkRequisition child_req;
int i;
int maximum_size;
int *new_size_hints;
int new_len = 0;
WnckTasklist *wncktl = WNCK_TASKLIST (tasklist->tasklist);
gint minimum_size = 0;
if (tasklist->orientation == GTK_ORIENTATION_HORIZONTAL)
minimum_size = wnck_tasklist_get_minimum_width (wncktl);
else
minimum_size = wnck_tasklist_get_minimum_height (wncktl);
gtk_widget_get_child_requisition (tasklist->applet, &child_req);
size_hints = wnck_tasklist_get_size_hint_list (wncktl, &len);
g_assert (len % 2 == 0);
new_size_hints = g_new0 (int, len);
/* size_hints is an array of (max, min) int pairs
* where min(i) > max (i+1)
* convert it to clipped values
*/
maximum_size = tasklist->maximum_size - minimum_size;
g_assert (maximum_size >= 0);
for (i = 0; i < len; i += 2) {
if (size_hints[i + 1] <= maximum_size) {
/* this one should be stored */
if (size_hints[i] > maximum_size)
new_size_hints[new_len] = maximum_size;
else
new_size_hints[new_len] = size_hints[i];
new_size_hints[new_len + 1] = size_hints[i + 1];
new_len += 2;
}
}
panel_applet_set_size_hints (PANEL_APPLET (tasklist->applet),
new_size_hints,
new_len, child_req.width - 1);
g_free (new_size_hints);
size_hints, len, 0);
}
static GdkPixbuf*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment