Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 180669 | Differences between
and this patch

Collapse All | Expand All

(-)branches/gtk-2-10/gtk/gtkfilechooserdefault.c (-55 / +76 lines)
Lines 272-277 Link Here
272
							 GtkStyle              *previous_style);
272
							 GtkStyle              *previous_style);
273
static void     gtk_file_chooser_default_screen_changed (GtkWidget             *widget,
273
static void     gtk_file_chooser_default_screen_changed (GtkWidget             *widget,
274
							 GdkScreen             *previous_screen);
274
							 GdkScreen             *previous_screen);
275
static void     gtk_file_chooser_default_size_allocate  (GtkWidget             *widget,
276
							 GtkAllocation         *allocation);
275
277
276
static gboolean       gtk_file_chooser_default_set_current_folder 	   (GtkFileChooser    *chooser,
278
static gboolean       gtk_file_chooser_default_set_current_folder 	   (GtkFileChooser    *chooser,
277
									    const GtkFilePath *path,
279
									    const GtkFilePath *path,
Lines 310-318 Link Here
310
static void           gtk_file_chooser_default_get_default_size       (GtkFileChooserEmbed *chooser_embed,
312
static void           gtk_file_chooser_default_get_default_size       (GtkFileChooserEmbed *chooser_embed,
311
								       gint                *default_width,
313
								       gint                *default_width,
312
								       gint                *default_height);
314
								       gint                *default_height);
313
static void           gtk_file_chooser_default_get_resizable_hints    (GtkFileChooserEmbed *chooser_embed,
315
static gboolean       gtk_file_chooser_default_get_resizable          (GtkFileChooserEmbed *chooser_embed);
314
								       gboolean            *resize_horizontally,
315
								       gboolean            *resize_vertically);
316
static gboolean       gtk_file_chooser_default_should_respond         (GtkFileChooserEmbed *chooser_embed);
316
static gboolean       gtk_file_chooser_default_should_respond         (GtkFileChooserEmbed *chooser_embed);
317
static void           gtk_file_chooser_default_initial_focus          (GtkFileChooserEmbed *chooser_embed);
317
static void           gtk_file_chooser_default_initial_focus          (GtkFileChooserEmbed *chooser_embed);
318
318
Lines 423-429 Link Here
423
static void location_button_toggled_cb (GtkToggleButton *toggle,
423
static void location_button_toggled_cb (GtkToggleButton *toggle,
424
					GtkFileChooserDefault *impl);
424
					GtkFileChooserDefault *impl);
425
static void location_switch_to_path_bar (GtkFileChooserDefault *impl);
425
static void location_switch_to_path_bar (GtkFileChooserDefault *impl);
426
426
static void settings_load               (GtkFileChooserDefault *impl);
427
427
428
428
429
429
Lines 485-490 Link Here
485
  widget_class->hierarchy_changed = gtk_file_chooser_default_hierarchy_changed;
485
  widget_class->hierarchy_changed = gtk_file_chooser_default_hierarchy_changed;
486
  widget_class->style_set = gtk_file_chooser_default_style_set;
486
  widget_class->style_set = gtk_file_chooser_default_style_set;
487
  widget_class->screen_changed = gtk_file_chooser_default_screen_changed;
487
  widget_class->screen_changed = gtk_file_chooser_default_screen_changed;
488
  widget_class->size_allocate = gtk_file_chooser_default_size_allocate;
488
489
489
  signals[LOCATION_POPUP] =
490
  signals[LOCATION_POPUP] =
490
    _gtk_binding_signal_new (I_("location-popup"),
491
    _gtk_binding_signal_new (I_("location-popup"),
Lines 665-671 Link Here
665
gtk_file_chooser_embed_default_iface_init (GtkFileChooserEmbedIface *iface)
666
gtk_file_chooser_embed_default_iface_init (GtkFileChooserEmbedIface *iface)
666
{
667
{
667
  iface->get_default_size = gtk_file_chooser_default_get_default_size;
668
  iface->get_default_size = gtk_file_chooser_default_get_default_size;
668
  iface->get_resizable_hints = gtk_file_chooser_default_get_resizable_hints;
669
  iface->get_resizable = gtk_file_chooser_default_get_resizable;
669
  iface->should_respond = gtk_file_chooser_default_should_respond;
670
  iface->should_respond = gtk_file_chooser_default_should_respond;
670
  iface->initial_focus = gtk_file_chooser_default_initial_focus;
671
  iface->initial_focus = gtk_file_chooser_default_initial_focus;
671
}
672
}
Lines 4998-5003 Link Here
4998
	      }
4999
	      }
4999
	    impl->action = action;
5000
	    impl->action = action;
5000
	    update_appearance (impl);
5001
	    update_appearance (impl);
5002
	    settings_load (impl);
5001
	  }
5003
	  }
5002
      }
5004
      }
5003
      break;
5005
      break;
Lines 5419-5424 Link Here
5419
  profile_end ("end", NULL);
5421
  profile_end ("end", NULL);
5420
}
5422
}
5421
5423
5424
static void
5425
gtk_file_chooser_default_size_allocate (GtkWidget     *widget,
5426
					GtkAllocation *allocation)
5427
{
5428
  GtkFileChooserDefault *impl;
5429
5430
  impl = GTK_FILE_CHOOSER_DEFAULT (widget);
5431
5432
  GTK_WIDGET_CLASS (_gtk_file_chooser_default_parent_class)->size_allocate (widget, allocation);
5433
5434
  if (!gtk_file_chooser_default_get_resizable (GTK_FILE_CHOOSER_EMBED (impl)))
5435
    {
5436
      /* The dialog is not resizable, we shouldn't
5437
       * trust in the size it has in this stage
5438
       */
5439
      return;
5440
    }
5441
5442
  impl->default_width = allocation->width;
5443
  impl->default_height = allocation->height;
5444
5445
  if (impl->preview_widget_active &&
5446
      impl->preview_widget &&
5447
      GTK_WIDGET_DRAWABLE (impl->preview_widget))
5448
    impl->default_width -= impl->preview_widget->allocation.width + PREVIEW_HBOX_SPACING;
5449
5450
  if (impl->extra_widget &&
5451
      GTK_WIDGET_DRAWABLE (impl->extra_widget))
5452
    impl->default_height -= GTK_BOX (widget)->spacing + impl->extra_widget->allocation.height;
5453
}
5454
5422
static gboolean
5455
static gboolean
5423
get_is_file_filtered (GtkFileChooserDefault *impl,
5456
get_is_file_filtered (GtkFileChooserDefault *impl,
5424
		      const GtkFilePath     *path,
5457
		      const GtkFilePath     *path,
Lines 7186-7234 Link Here
7186
			   gint      *height)
7219
			   gint      *height)
7187
{
7220
{
7188
  GtkFileChooserDefault *impl;
7221
  GtkFileChooserDefault *impl;
7189
  gint default_width, default_height;
7190
  int font_size;
7222
  int font_size;
7191
  GtkRequisition req;
7192
  GdkScreen *screen;
7223
  GdkScreen *screen;
7193
  double resolution;
7224
  double resolution;
7194
7225
7195
  g_assert (widget->style != NULL);
7226
  g_assert (widget->style != NULL);
7196
  impl = GTK_FILE_CHOOSER_DEFAULT (widget);
7227
  impl = GTK_FILE_CHOOSER_DEFAULT (widget);
7197
7228
7198
  screen = gtk_widget_get_screen (widget);
7229
  if (impl->default_width == 0 &&
7199
  if (screen)
7230
      impl->default_height == 0)
7200
    {
7231
    {
7201
      resolution = gdk_screen_get_resolution (screen);
7232
      screen = gtk_widget_get_screen (widget);
7202
      if (resolution < 0.0) /* will be -1 if the resolution is not defined in the GdkScreen */
7233
      if (screen)
7203
	resolution = 96.0;
7234
	{
7204
    }
7235
	  resolution = gdk_screen_get_resolution (screen);
7205
  else
7236
	  if (resolution < 0.0) /* will be -1 if the resolution is not defined in the GdkScreen */
7206
    resolution = 96.0; /* wheeee */
7237
	    resolution = 96.0;
7207
7238
	}
7208
  font_size = pango_font_description_get_size (widget->style->font_desc);
7239
      else
7209
  font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
7240
	resolution = 96.0; /* wheeee */
7210
7241
7211
  default_width = font_size * NUM_CHARS;
7242
      font_size = pango_font_description_get_size (widget->style->font_desc);
7212
  default_height = font_size * NUM_LINES;
7243
      font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
7213
7244
7214
  if (impl->preview_widget_active && impl->preview_widget)
7245
      impl->default_width = font_size * NUM_CHARS;
7215
    {
7246
      impl->default_height = font_size * NUM_LINES;
7216
      gtk_widget_size_request (impl->preview_box, &req);
7217
      default_width += PREVIEW_HBOX_SPACING + req.width;
7218
    }
7247
    }
7219
7248
7220
  if (impl->extra_widget)
7249
  *width = impl->default_width;
7221
    {
7250
  *height = impl->default_height;
7222
      gtk_widget_size_request (impl->extra_align, &req);
7223
      default_height += GTK_BOX (widget)->spacing + req.height;
7224
    }
7225
7226
  gtk_widget_size_request (widget, &req);
7227
  default_width = MAX (default_width, req.width);
7228
  default_height = MAX (default_height, req.height);
7229
7230
  *width = default_width;
7231
  *height = default_height;
7232
}
7251
}
7233
7252
7234
static void
7253
static void
Lines 7237-7271 Link Here
7237
					   gint                *default_height)
7256
					   gint                *default_height)
7238
{
7257
{
7239
  GtkFileChooserDefault *impl;
7258
  GtkFileChooserDefault *impl;
7259
  GtkRequisition req;
7240
7260
7241
  impl = GTK_FILE_CHOOSER_DEFAULT (chooser_embed);
7261
  impl = GTK_FILE_CHOOSER_DEFAULT (chooser_embed);
7242
  find_good_size_from_style (GTK_WIDGET (chooser_embed), default_width, default_height);
7262
  find_good_size_from_style (GTK_WIDGET (chooser_embed), default_width, default_height);
7263
7264
  if (impl->preview_widget_active &&
7265
      impl->preview_widget &&
7266
      GTK_WIDGET_VISIBLE (impl->preview_widget))
7267
    {
7268
      gtk_widget_size_request (impl->preview_box, &req);
7269
      *default_width += PREVIEW_HBOX_SPACING + req.width;
7270
    }
7271
7272
  if (impl->extra_widget &&
7273
      GTK_WIDGET_VISIBLE (impl->extra_widget))
7274
    {
7275
      gtk_widget_size_request (impl->extra_align, &req);
7276
      *default_height += GTK_BOX (chooser_embed)->spacing + req.height;
7277
    }
7243
}
7278
}
7244
7279
7245
static void
7280
static gboolean
7246
gtk_file_chooser_default_get_resizable_hints (GtkFileChooserEmbed *chooser_embed,
7281
gtk_file_chooser_default_get_resizable (GtkFileChooserEmbed *chooser_embed)
7247
					      gboolean            *resize_horizontally,
7248
					      gboolean            *resize_vertically)
7249
{
7282
{
7250
  GtkFileChooserDefault *impl;
7283
  GtkFileChooserDefault *impl;
7251
7284
7252
  g_return_if_fail (resize_horizontally != NULL);
7253
  g_return_if_fail (resize_vertically != NULL);
7254
7255
  impl = GTK_FILE_CHOOSER_DEFAULT (chooser_embed);
7285
  impl = GTK_FILE_CHOOSER_DEFAULT (chooser_embed);
7256
7286
7257
  *resize_horizontally = TRUE;
7287
  return (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
7258
  *resize_vertically = TRUE;
7288
	  impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
7259
7289
	  gtk_expander_get_expanded (GTK_EXPANDER (impl->save_expander)));
7260
  if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
7261
      impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
7262
    {
7263
      if (! gtk_expander_get_expanded (GTK_EXPANDER (impl->save_expander)))
7264
	{
7265
	  *resize_horizontally = FALSE;
7266
	  *resize_vertically = FALSE;
7267
	}
7268
    }
7269
}
7290
}
7270
7291
7271
struct switch_folder_closure {
7292
struct switch_folder_closure {
(-)branches/gtk-2-10/gtk/gtkfilechooserdialog.c (-129 / +33 lines)
Lines 87-96 Link Here
87
								   GTK_TYPE_FILE_CHOOSER_DIALOG,
87
								   GTK_TYPE_FILE_CHOOSER_DIALOG,
88
								   GtkFileChooserDialogPrivate);
88
								   GtkFileChooserDialogPrivate);
89
  dialog->priv = priv;
89
  dialog->priv = priv;
90
  dialog->priv->default_width = -1;
91
  dialog->priv->default_height = -1;
92
  dialog->priv->resize_horizontally = TRUE;
93
  dialog->priv->resize_vertically = TRUE;
94
  dialog->priv->response_requested = FALSE;
90
  dialog->priv->response_requested = FALSE;
95
91
96
  gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
92
  gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
Lines 151-175 Link Here
151
}
147
}
152
148
153
static void
149
static void
154
file_chooser_widget_update_hints (GtkFileChooserDialog *dialog,
155
				  gint                  width)
156
{
157
  GtkFileChooserDialogPrivate *priv;
158
  GdkGeometry geometry;
159
160
  priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
161
162
  geometry.min_width = (!priv->resize_horizontally ? width : -1);
163
  geometry.min_height = -1;
164
  geometry.max_width = (priv->resize_horizontally?G_MAXSHORT:-1);
165
  geometry.max_height = (priv->resize_vertically?G_MAXSHORT:-1);
166
167
  gtk_window_set_geometry_hints (GTK_WINDOW (dialog), NULL,
168
				 &geometry,
169
 				 GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
170
}
171
172
static void
173
clamp_to_screen (GtkWidget *widget,
150
clamp_to_screen (GtkWidget *widget,
174
		 gint      *width,
151
		 gint      *width,
175
		 gint      *height)
152
		 gint      *height)
Lines 193-323 Link Here
193
}
170
}
194
171
195
static void
172
static void
196
file_chooser_widget_default_realized_size_changed (GtkWidget            *widget,
173
file_chooser_widget_default_size_changed (GtkWidget            *widget,
197
						   GtkFileChooserDialog *dialog)
174
					  GtkFileChooserDialog *dialog)
198
{
175
{
199
  GtkFileChooserDialogPrivate *priv;
176
  GtkFileChooserDialogPrivate *priv;
200
  gint width;
177
  gint width, height;
201
  gint height;
202
  gint default_width, default_height;
178
  gint default_width, default_height;
203
  GtkRequisition req;
179
  GtkRequisition req, widget_req;
204
  gboolean resize_horizontally;
180
  gboolean resizable;
205
  gboolean resize_vertically;
206
  gboolean update_hints;
207
  gint dx = 0, dy = 0;
208
  gint cur_width, cur_height;
209
181
210
  priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
182
  priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
211
183
212
  /* Force a size request of everything before we start.  This will make sure
184
  /* Unset any previously set size */
213
   * that widget->requisition is meaningful. */
185
  gtk_widget_set_size_request (GTK_WIDGET (dialog), -1, -1);
214
  gtk_widget_size_request (GTK_WIDGET (dialog), &req);
215
  gtk_window_get_size (GTK_WINDOW (dialog), &cur_width, &cur_height);
216
  width = GTK_WIDGET (dialog)->requisition.width - priv->widget->requisition.width;
217
  height = GTK_WIDGET (dialog)->requisition.height - priv->widget->requisition.height;
218
  _gtk_file_chooser_embed_get_default_size (GTK_FILE_CHOOSER_EMBED (priv->widget),
219
					    &default_width, &default_height);
220
221
  /* Ideal target size modulo any resizing */
222
  width = default_width + width;
223
  height = default_height + height;
224
225
  /* Now, we test for resizability */
226
  update_hints = FALSE;
227
  _gtk_file_chooser_embed_get_resizable_hints (GTK_FILE_CHOOSER_EMBED (priv->widget),
228
					       &resize_horizontally,
229
					       &resize_vertically);
230
  resize_vertically = (!! resize_vertically);     /* normalize */
231
  resize_horizontally = (!! resize_horizontally);
232
186
233
  if (resize_horizontally && priv->resize_horizontally)
187
  if (GTK_WIDGET_DRAWABLE (widget))
234
    {
235
      dx = default_width - priv->default_width;
236
      priv->default_width = default_width;
237
    }
238
  else if (resize_horizontally && ! priv->resize_horizontally)
239
    {
240
      /* We restore to the ideal size + any change in default_size (which is not
241
       * expected).  It would be nicer to store the older size to restore to in
242
       * the future. */
243
      dx = default_width - priv->default_width;
244
      dx += width - cur_width;
245
      priv->default_width = default_width;
246
      update_hints = TRUE;
247
    }
248
  else
249
    {
188
    {
250
      update_hints = TRUE;
189
      /* Force a size request of everything before we start.  This will make sure
251
    }
190
       * that widget->requisition is meaningful. */
191
      gtk_widget_size_request (GTK_WIDGET (dialog), &req);
192
      gtk_widget_size_request (widget, &widget_req);
252
193
253
  if (resize_vertically && priv->resize_vertically)
194
      width = req.width - widget_req.width;
254
    {
195
      height = req.height - widget_req.height;
255
      dy = default_height - priv->default_height;
256
      priv->default_height = default_height;
257
    }
258
  else if (resize_vertically && ! priv->resize_vertically)
259
    {
260
      dy = default_height - priv->default_height;
261
      dy += height - cur_height;
262
      priv->default_height = default_height;
263
      update_hints = TRUE;
264
    }
196
    }
265
  else
197
  else
266
    {
198
    {
267
      update_hints = TRUE;
199
      width = GTK_WIDGET (dialog)->allocation.width - widget->allocation.width;
200
      height = GTK_WIDGET (dialog)->allocation.height - widget->allocation.height;
268
    }
201
    }
269
202
270
  priv->resize_horizontally = resize_horizontally;
203
  resizable = _gtk_file_chooser_embed_get_resizable (GTK_FILE_CHOOSER_EMBED (priv->widget));
271
  priv->resize_vertically = resize_vertically;
272
273
  if (dx != 0 || dy != 0)
274
    {
275
      gint new_width = cur_width + dx;
276
      gint new_height = cur_height + dy;
277
278
      clamp_to_screen (GTK_WIDGET (dialog), &new_width, &new_height);
279
      
280
      gtk_window_resize (GTK_WINDOW (dialog), new_width, new_height);
281
    }
282
283
  /* Only store the size if we can resize in that direction. */
284
  if (update_hints)
285
    file_chooser_widget_update_hints (dialog, width);
286
}
287
288
static void
289
file_chooser_widget_default_unrealized_size_changed (GtkWidget            *widget,
290
						     GtkFileChooserDialog *dialog)
291
{
292
  GtkFileChooserDialogPrivate *priv;
293
  GtkRequisition req;
294
  gint width, height;
295
296
  priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
297
  gtk_widget_size_request (GTK_WIDGET (dialog), &req);
298
299
  _gtk_file_chooser_embed_get_resizable_hints (GTK_FILE_CHOOSER_EMBED (priv->widget),
300
					       &(priv->resize_horizontally),
301
					       &(priv->resize_vertically));
302
  _gtk_file_chooser_embed_get_default_size (GTK_FILE_CHOOSER_EMBED (priv->widget),
204
  _gtk_file_chooser_embed_get_default_size (GTK_FILE_CHOOSER_EMBED (priv->widget),
303
					    &(priv->default_width), &(priv->default_height));
205
					    &default_width, &default_height);
304
  
305
  /* Determine how much space the rest of the dialog uses compared to priv->widget */
306
  width = priv->default_width + GTK_WIDGET (dialog)->requisition.width - priv->widget->requisition.width;
307
  height = priv->default_height + GTK_WIDGET (dialog)->requisition.height - priv->widget->requisition.height;
308
206
309
  gtk_window_set_default_size (GTK_WINDOW (dialog), width, height);
207
  /* Ideal target size plus any extra size */
310
  file_chooser_widget_update_hints (dialog, width);
208
  width = default_width + width + (2 * GTK_CONTAINER (dialog)->border_width);
311
}
209
  height = default_height + height + (2 * GTK_CONTAINER (dialog)->border_width);
312
210
313
static void
314
file_chooser_widget_default_size_changed (GtkWidget            *widget,
315
					  GtkFileChooserDialog *dialog)
316
{
317
  if (GTK_WIDGET_REALIZED (dialog))
211
  if (GTK_WIDGET_REALIZED (dialog))
318
    file_chooser_widget_default_realized_size_changed (widget, dialog);
212
    clamp_to_screen (GTK_WIDGET (dialog), &width, &height);
213
214
  if (resizable)
215
    {
216
      gtk_window_set_resizable (GTK_WINDOW (dialog), resizable);
217
      gtk_window_resize (GTK_WINDOW (dialog), width, height);
218
    }
319
  else
219
  else
320
    file_chooser_widget_default_unrealized_size_changed (widget, dialog);
220
    {
221
      gtk_widget_set_size_request (GTK_WIDGET (dialog), width, -1);
222
      gtk_window_set_resizable (GTK_WINDOW (dialog), resizable);
223
    }
321
}
224
}
322
225
323
static void
226
static void
Lines 487-492 Link Here
487
  if (!GTK_WIDGET_MAPPED (priv->widget))
390
  if (!GTK_WIDGET_MAPPED (priv->widget))
488
    gtk_widget_map (priv->widget);
391
    gtk_widget_map (priv->widget);
489
392
393
  file_chooser_widget_default_size_changed (priv->widget, dialog);
490
  _gtk_file_chooser_embed_initial_focus (GTK_FILE_CHOOSER_EMBED (priv->widget));
394
  _gtk_file_chooser_embed_initial_focus (GTK_FILE_CHOOSER_EMBED (priv->widget));
491
395
492
  GTK_WIDGET_CLASS (gtk_file_chooser_dialog_parent_class)->map (widget);
396
  GTK_WIDGET_CLASS (gtk_file_chooser_dialog_parent_class)->map (widget);
(-)branches/gtk-2-10/gtk/gtkfilechooserembed.c (-18 / +10 lines)
Lines 28-36 Link Here
28
static void delegate_get_default_size         (GtkFileChooserEmbed *chooser_embed,
28
static void delegate_get_default_size         (GtkFileChooserEmbed *chooser_embed,
29
					       gint                *default_width,
29
					       gint                *default_width,
30
					       gint                *default_height);
30
					       gint                *default_height);
31
static void delegate_get_resizable_hints      (GtkFileChooserEmbed *chooser_embed,
31
static gboolean delegate_get_resizable        (GtkFileChooserEmbed *chooser_embed);
32
					       gboolean            *resize_horizontally,
33
					       gboolean            *resize_vertically);
34
static gboolean delegate_should_respond       (GtkFileChooserEmbed *chooser_embed);
32
static gboolean delegate_should_respond       (GtkFileChooserEmbed *chooser_embed);
35
static void delegate_initial_focus            (GtkFileChooserEmbed *chooser_embed);
33
static void delegate_initial_focus            (GtkFileChooserEmbed *chooser_embed);
36
static void delegate_default_size_changed     (GtkFileChooserEmbed *chooser_embed,
34
static void delegate_default_size_changed     (GtkFileChooserEmbed *chooser_embed,
Lines 57-63 Link Here
57
_gtk_file_chooser_embed_delegate_iface_init (GtkFileChooserEmbedIface *iface)
55
_gtk_file_chooser_embed_delegate_iface_init (GtkFileChooserEmbedIface *iface)
58
{
56
{
59
  iface->get_default_size = delegate_get_default_size;
57
  iface->get_default_size = delegate_get_default_size;
60
  iface->get_resizable_hints = delegate_get_resizable_hints;
58
  iface->get_resizable = delegate_get_resizable;
61
  iface->should_respond = delegate_should_respond;
59
  iface->should_respond = delegate_should_respond;
62
  iface->initial_focus = delegate_initial_focus;
60
  iface->initial_focus = delegate_initial_focus;
63
}
61
}
Lines 96-108 Link Here
96
{
94
{
97
  _gtk_file_chooser_embed_get_default_size (get_delegate (chooser_embed), default_width, default_height);
95
  _gtk_file_chooser_embed_get_default_size (get_delegate (chooser_embed), default_width, default_height);
98
}
96
}
99
     
97
100
static void
98
static gboolean
101
delegate_get_resizable_hints (GtkFileChooserEmbed *chooser_embed,
99
delegate_get_resizable (GtkFileChooserEmbed *chooser_embed)
102
			      gboolean            *resize_horizontally,
103
			      gboolean            *resize_vertically)
104
{
100
{
105
  _gtk_file_chooser_embed_get_resizable_hints (get_delegate (chooser_embed), resize_horizontally, resize_vertically);
101
  return _gtk_file_chooser_embed_get_resizable (get_delegate (chooser_embed));
106
}
102
}
107
103
108
static gboolean
104
static gboolean
Lines 208-221 Link Here
208
  GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->initial_focus (chooser_embed);
204
  GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->initial_focus (chooser_embed);
209
}
205
}
210
206
211
void
207
gboolean
212
_gtk_file_chooser_embed_get_resizable_hints (GtkFileChooserEmbed *chooser_embed,
208
_gtk_file_chooser_embed_get_resizable (GtkFileChooserEmbed *chooser_embed)
213
					     gboolean            *resize_horizontally,
214
					     gboolean            *resize_vertically)
215
{
209
{
216
  g_return_if_fail (GTK_IS_FILE_CHOOSER_EMBED (chooser_embed));
210
  g_return_val_if_fail (GTK_IS_FILE_CHOOSER_EMBED (chooser_embed), FALSE);
217
  g_return_if_fail (resize_horizontally != NULL);
218
  g_return_if_fail (resize_vertically != NULL);
219
211
220
  GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->get_resizable_hints (chooser_embed, resize_horizontally, resize_vertically);
212
  return GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->get_resizable (chooser_embed);
221
}
213
}
(-)branches/gtk-2-10/gtk/gtkfilechooserembed.h (-7 / +2 lines)
Lines 43-51 Link Here
43
  void (*get_default_size)        (GtkFileChooserEmbed *chooser_embed,
43
  void (*get_default_size)        (GtkFileChooserEmbed *chooser_embed,
44
				   gint                *default_width,
44
				   gint                *default_width,
45
				   gint                *default_height);
45
				   gint                *default_height);
46
  void (*get_resizable_hints)     (GtkFileChooserEmbed *chooser_embed,
46
  gboolean (*get_resizable)       (GtkFileChooserEmbed *chooser_embed);
47
				   gboolean            *resize_horizontally,
48
				   gboolean            *resize_vertically);
49
47
50
  gboolean (*should_respond)      (GtkFileChooserEmbed *chooser_embed);
48
  gboolean (*should_respond)      (GtkFileChooserEmbed *chooser_embed);
51
49
Lines 61-70 Link Here
61
void  _gtk_file_chooser_embed_get_default_size    (GtkFileChooserEmbed *chooser_embed,
59
void  _gtk_file_chooser_embed_get_default_size    (GtkFileChooserEmbed *chooser_embed,
62
						   gint                *default_width,
60
						   gint                *default_width,
63
						   gint                *default_height);
61
						   gint                *default_height);
64
void  _gtk_file_chooser_embed_get_resizable_hints (GtkFileChooserEmbed *chooser_embed,
62
gboolean _gtk_file_chooser_embed_get_resizable  (GtkFileChooserEmbed *chooser_embed);
65
						   gboolean            *resize_horizontally,
66
						   gboolean            *resize_vertically);
67
68
gboolean _gtk_file_chooser_embed_should_respond (GtkFileChooserEmbed *chooser_embed);
63
gboolean _gtk_file_chooser_embed_should_respond (GtkFileChooserEmbed *chooser_embed);
69
64
70
void _gtk_file_chooser_embed_initial_focus (GtkFileChooserEmbed *chooser_embed);
65
void _gtk_file_chooser_embed_initial_focus (GtkFileChooserEmbed *chooser_embed);
(-)branches/gtk-2-10/gtk/gtkfilechooserprivate.h (-4 / +3 lines)
Lines 109-118 Link Here
109
  char *file_system;
109
  char *file_system;
110
110
111
  /* for use with GtkFileChooserEmbed */
111
  /* for use with GtkFileChooserEmbed */
112
  gint default_width;
113
  gint default_height;
114
  gboolean resize_horizontally;
115
  gboolean resize_vertically;
116
  gboolean response_requested;
112
  gboolean response_requested;
117
};
113
};
118
114
Lines 254-259 Link Here
254
  GSource *shortcuts_drag_outside_idle;
250
  GSource *shortcuts_drag_outside_idle;
255
#endif
251
#endif
256
252
253
  gint default_width;
254
  gint default_height;
255
257
  /* Flags */
256
  /* Flags */
258
257
259
  guint local_only : 1;
258
  guint local_only : 1;

Return to bug 180669