Commit 9eb77022 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

fix up the size request stuff so we get back some widgets which

Sat Dec 22 15:12:42 2001  George Lebl <jirka@5z.com>

	* foobar-widget.c, gnome-run.c, panel-config.c, swallow.c: fix up
	  the size request stuff so we get back some widgets which
	  disappeared because I was a wanker.
parent 5d04c57f
Sat Dec 22 15:12:42 2001 George Lebl <jirka@5z.com>
* foobar-widget.c, gnome-run.c, panel-config.c, swallow.c: fix up
the size request stuff so we get back some widgets which
disappeared because I was a wanker.
Sat Dec 22 14:52:42 2001 George Lebl <jirka@5z.com>
* gnome-panel-screenshot.c, gnome-panel-properties.c, status.c:
......
......@@ -567,7 +567,7 @@ foobar_widget_set_clock_format (FoobarWidget *foo, const char *clock_format)
layout = gtk_widget_create_pango_layout (foo->clock_label, str_utf8);
pango_layout_get_pixel_size (layout, &width, NULL);
width += 8; /* Padding */
gtk_widget_set_size_request (foo->clock_label, width, 0);
gtk_widget_set_size_request (foo->clock_label, width, -1);
g_object_unref (G_OBJECT(layout));
}
}
......@@ -1033,8 +1033,9 @@ foobar_widget_instance_init (FoobarWidget *foo)
gtk_window_move (GTK_WINDOW (foo),
multiscreen_x (foo->screen),
multiscreen_y (foo->screen));
gtk_widget_set_size_request (GTK_WIDGET (foo),
multiscreen_width (foo->screen), -2);
g_object_set (G_OBJECT (foo),
"width_request", (int)multiscreen_width (foo->screen),
NULL);
foo->ebox = gtk_event_box_new ();
foo->hbox = gtk_hbox_new (FALSE, 0);
......@@ -1204,8 +1205,9 @@ foobar_widget_new (const char *panel_id, int screen)
gtk_window_move (GTK_WINDOW (foo),
multiscreen_x (foo->screen),
multiscreen_y (foo->screen));
gtk_widget_set_size_request (GTK_WIDGET (foo),
multiscreen_width (foo->screen), -2);
g_object_set (G_OBJECT (foo),
"width_request", (int)multiscreen_width (foo->screen),
NULL);
foobars = g_list_prepend (foobars, foo);
......
......@@ -603,8 +603,9 @@ create_advanced_contents (void)
gentry = gnome_entry_new ("gnome-run");
gtk_box_pack_start (GTK_BOX (hbox), gentry, TRUE, TRUE, 0);
/* 1/4 the width of the first screen should be a good value */
gtk_widget_set_size_request (GTK_WIDGET (gentry),
multiscreen_width (0) / 4, -2);
g_object_set (G_OBJECT (gentry),
"width_request", (int)(multiscreen_width (0) / 4),
NULL);
entry = gnome_entry_gtk_entry (GNOME_ENTRY (gentry));
......
......@@ -679,7 +679,7 @@ make_misc_widget (PerPanelConfig *ppc, gboolean avoiding)
1, 1, 1);
ppc->screen_spin = button =
gtk_spin_button_new (GTK_ADJUSTMENT (range), 1, 0);
gtk_widget_set_size_request (GTK_WIDGET (button), 65, 0);
gtk_widget_set_size_request (GTK_WIDGET (button), 65, -1);
g_object_set_data (G_OBJECT (button), "PerPanelConfig", ppc);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (button), ppc->screen);
g_signal_connect (G_OBJECT (button), "changed",
......@@ -1004,7 +1004,7 @@ floating_notebook_page (PerPanelConfig *ppc)
range = gtk_adjustment_new (ppc->x, 0, xlimit, 1, 10, 10);
ppc->x_spin = button =
gtk_spin_button_new (GTK_ADJUSTMENT (range), 1, 0);
gtk_widget_set_size_request (GTK_WIDGET (button), 65, 0);
gtk_widget_set_size_request (GTK_WIDGET (button), 65, -1);
g_object_set_data (G_OBJECT (button), "PerPanelConfig", ppc);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (button), ppc->x);
g_signal_connect (G_OBJECT (button), "changed",
......@@ -1018,7 +1018,7 @@ floating_notebook_page (PerPanelConfig *ppc)
range = gtk_adjustment_new (ppc->y, 0, ylimit, 1, 10, 10);
ppc->y_spin = button =
gtk_spin_button_new (GTK_ADJUSTMENT (range), 1, 0);
gtk_widget_set_size_request (GTK_WIDGET (button), 65, 0);
gtk_widget_set_size_request (GTK_WIDGET (button), 65, -1);
g_object_set_data (G_OBJECT (button), "PerPanelConfig", ppc);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (button), ppc->y);
g_signal_connect (G_OBJECT (button), "changed",
......@@ -1098,7 +1098,7 @@ sliding_notebook_page (PerPanelConfig *ppc)
adj = GTK_ADJUSTMENT(gtk_adjustment_new (ppc->offset, 0, range, 1, 10, 10));
ppc->offset_spin = button =
gtk_spin_button_new (adj, 1, 0);
gtk_widget_set_size_request (button, 100, 0);
gtk_widget_set_size_request (button, 100, -1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (button), ppc->offset);
g_signal_connect (G_OBJECT (button), "changed",
G_CALLBACK (sliding_set_offset), ppc);
......
......@@ -122,7 +122,7 @@ before_remove (Swallow *swallow)
/* make the socket again */
swallow->socket = gtk_socket_new ();
if (swallow->width != 0 || swallow->height != 0)
if (swallow->width > 0 || swallow->height > 0)
gtk_widget_set_size_request (swallow->socket,
swallow->width, swallow->height);
......@@ -350,6 +350,11 @@ static Swallow *
create_swallow_applet(const char *title, const char *path, int width, int height, SwallowOrient orient)
{
Swallow *swallow;
if (width == 0)
width = -1;
if (height == 0)
height = -1;
swallow = g_new (Swallow, 1);
swallow->ref_count = 1;
......@@ -360,8 +365,7 @@ create_swallow_applet(const char *title, const char *path, int width, int height
gtk_widget_show (swallow->ebox);
swallow->socket = gtk_socket_new ();
if (width != 0 || height != 0)
gtk_widget_set_size_request (swallow->socket, width, height);
gtk_widget_set_size_request (swallow->socket, width, height);
g_signal_connect_after (G_OBJECT (swallow->socket), "realize",
G_CALLBACK (socket_realized), swallow);
g_signal_connect (G_OBJECT (swallow->socket), "destroy",
......
Markdown is supported
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