summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2004-10-07 11:24:44 +0000
committerBastien Nocera <hadess@src.gnome.org>2004-10-07 11:24:44 +0000
commit1d7ad1eec24f43ea88d5f0547330cdef2170fe88 (patch)
treeb7db16b236559603d2e6af98494f8556b159fe2d
parentb378a6320f20468d49b4310a0675f888f43451d0 (diff)
downloadtotem-1d7ad1eec24f43ea88d5f0547330cdef2170fe88.tar.gz
use totem_widget_set_preferred_size and only set the minimum size, so that
2004-10-07 Bastien Nocera <hadess@hadess.net> * src/bacon-video-widget-xine.c: (bacon_video_widget_new), (bacon_video_widget_size_request), (bacon_video_widget_set_scale_ratio): use totem_widget_set_preferred_size and only set the minimum size, so that we can still shrink the toplevel window after zooming to a big size (Closes: #125903)
-rw-r--r--ChangeLog9
-rw-r--r--src/backend/bacon-video-widget-xine.c34
-rw-r--r--src/bacon-video-widget-xine.c34
3 files changed, 17 insertions, 60 deletions
diff --git a/ChangeLog b/ChangeLog
index f971031e6..fa4c90714 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-10-07 Bastien Nocera <hadess@hadess.net>
+
+ * src/bacon-video-widget-xine.c: (bacon_video_widget_new),
+ (bacon_video_widget_size_request),
+ (bacon_video_widget_set_scale_ratio): use
+ totem_widget_set_preferred_size and only set the minimum size, so that
+ we can still shrink the toplevel window after zooming to a big size
+ (Closes: #125903)
+
2004-10-07 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* src/bacon-video-widget-gst.c:
diff --git a/src/backend/bacon-video-widget-xine.c b/src/backend/bacon-video-widget-xine.c
index 1b0021faf..f2eff06f8 100644
--- a/src/backend/bacon-video-widget-xine.c
+++ b/src/backend/bacon-video-widget-xine.c
@@ -1549,23 +1549,6 @@ bacon_video_widget_new (int width, int height,
bvw->priv->null_out = null_out;
- /* defaults are fine if both are negative */
- if (width > 0 && height > 0)
- {
- /* figure out the missing measure from the other one
- * with a 4:3 ratio */
- if (width <= 0)
- width = (int) (height * 4 / 3);
- if (height <= 0)
- height = (int) (width * 3 / 4);
- } else {
- width = 0;
- height = 0;
- }
-
- GTK_WIDGET(bvw)->requisition.width = width;
- GTK_WIDGET(bvw)->requisition.height = height;
-
bvw->priv->init_width = width;
bvw->priv->init_height = height;
@@ -1670,21 +1653,11 @@ bacon_video_widget_button_press (GtkWidget *widget, GdkEventButton *event)
static void
bacon_video_widget_size_request (GtkWidget *widget, GtkRequisition *requisition)
{
- BaconVideoWidget *bvw;
-
g_return_if_fail(widget != NULL);
g_return_if_fail(BACON_IS_VIDEO_WIDGET(widget));
- bvw = BACON_VIDEO_WIDGET (widget);
-
- if ((bvw->priv->init_width == 0) && (bvw->priv->init_height == 0)) {
- requisition->width = DEFAULT_WIDTH;
- requisition->height = DEFAULT_HEIGHT;
- } else {
- /* Requesting first allocation as a minimum */
- requisition->width = bvw->priv->init_width;
- requisition->height = bvw->priv->init_height;
- }
+ requisition->width = 240;
+ requisition->height = 180;
}
static void
@@ -3032,7 +3005,8 @@ bacon_video_widget_set_scale_ratio (BaconVideoWidget *bvw, gfloat ratio)
bvw->priv->video_height * ratio);
}
- gtk_window_resize (GTK_WINDOW (toplevel), new_w, new_h);
+ gtk_window_resize (GTK_WINDOW (toplevel), 1, 1);
+ totem_widget_set_preferred_size (toplevel, new_w, new_h);
}
int
diff --git a/src/bacon-video-widget-xine.c b/src/bacon-video-widget-xine.c
index 1b0021faf..f2eff06f8 100644
--- a/src/bacon-video-widget-xine.c
+++ b/src/bacon-video-widget-xine.c
@@ -1549,23 +1549,6 @@ bacon_video_widget_new (int width, int height,
bvw->priv->null_out = null_out;
- /* defaults are fine if both are negative */
- if (width > 0 && height > 0)
- {
- /* figure out the missing measure from the other one
- * with a 4:3 ratio */
- if (width <= 0)
- width = (int) (height * 4 / 3);
- if (height <= 0)
- height = (int) (width * 3 / 4);
- } else {
- width = 0;
- height = 0;
- }
-
- GTK_WIDGET(bvw)->requisition.width = width;
- GTK_WIDGET(bvw)->requisition.height = height;
-
bvw->priv->init_width = width;
bvw->priv->init_height = height;
@@ -1670,21 +1653,11 @@ bacon_video_widget_button_press (GtkWidget *widget, GdkEventButton *event)
static void
bacon_video_widget_size_request (GtkWidget *widget, GtkRequisition *requisition)
{
- BaconVideoWidget *bvw;
-
g_return_if_fail(widget != NULL);
g_return_if_fail(BACON_IS_VIDEO_WIDGET(widget));
- bvw = BACON_VIDEO_WIDGET (widget);
-
- if ((bvw->priv->init_width == 0) && (bvw->priv->init_height == 0)) {
- requisition->width = DEFAULT_WIDTH;
- requisition->height = DEFAULT_HEIGHT;
- } else {
- /* Requesting first allocation as a minimum */
- requisition->width = bvw->priv->init_width;
- requisition->height = bvw->priv->init_height;
- }
+ requisition->width = 240;
+ requisition->height = 180;
}
static void
@@ -3032,7 +3005,8 @@ bacon_video_widget_set_scale_ratio (BaconVideoWidget *bvw, gfloat ratio)
bvw->priv->video_height * ratio);
}
- gtk_window_resize (GTK_WINDOW (toplevel), new_w, new_h);
+ gtk_window_resize (GTK_WINDOW (toplevel), 1, 1);
+ totem_widget_set_preferred_size (toplevel, new_w, new_h);
}
int