mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-11 21:20:09 +00:00
Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598 Signed-off-by: Javier Jardón <jjardon@gnome.org> Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
This commit is contained in:
parent
a18e2370bf
commit
b140884fec
@ -392,7 +392,8 @@ gtk_rotated_bin_size_request (GtkWidget *widget,
|
|||||||
child_requisition.height = 0;
|
child_requisition.height = 0;
|
||||||
|
|
||||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||||
gtk_widget_size_request (bin->child, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (bin->child),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
s = sin (bin->angle);
|
s = sin (bin->angle);
|
||||||
c = cos (bin->angle);
|
c = cos (bin->angle);
|
||||||
|
@ -316,7 +316,8 @@ gtk_mirror_bin_size_request (GtkWidget *widget,
|
|||||||
child_requisition.height = 0;
|
child_requisition.height = 0;
|
||||||
|
|
||||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||||
gtk_widget_size_request (bin->child, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (bin->child),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||||
requisition->width = border_width * 2 + child_requisition.width + 10;
|
requisition->width = border_width * 2 + child_requisition.width + 10;
|
||||||
|
@ -58,7 +58,7 @@ of their children.
|
|||||||
<para>
|
<para>
|
||||||
The size requisition phase of the widget layout process operates top-down.
|
The size requisition phase of the widget layout process operates top-down.
|
||||||
It starts at a top-level widget, typically a #GtkWindow. The top-level widget
|
It starts at a top-level widget, typically a #GtkWindow. The top-level widget
|
||||||
asks its child for its size requisition by calling gtk_widget_size_request().
|
asks its child for its size requisition by calling gtk_size_request_get_size().
|
||||||
To determine its requisition, the child asks its own children for their
|
To determine its requisition, the child asks its own children for their
|
||||||
requisitions and so on. Finally, the top-level widget will get a requisition
|
requisitions and so on. Finally, the top-level widget will get a requisition
|
||||||
back from its child.
|
back from its child.
|
||||||
|
@ -37,7 +37,7 @@ The #GtkFileChooserButton supports the #GtkFileChooserAction<!--
|
|||||||
<para>
|
<para>
|
||||||
The #GtkFileChooserButton will ellipsize the label,
|
The #GtkFileChooserButton will ellipsize the label,
|
||||||
and thus will thus request little horizontal space. To give the button
|
and thus will thus request little horizontal space. To give the button
|
||||||
more space, you should call gtk_widget_size_request(),
|
more space, you should call gtk_size_request_get_size(),
|
||||||
gtk_file_chooser_button_set_width_chars(), or pack the button in
|
gtk_file_chooser_button_set_width_chars(), or pack the button in
|
||||||
such a way that other interface elements give space to the widget.
|
such a way that other interface elements give space to the widget.
|
||||||
</para>
|
</para>
|
||||||
|
@ -405,7 +405,8 @@ gtk_accel_label_expose_event (GtkWidget *widget,
|
|||||||
|
|
||||||
ac_width = gtk_accel_label_get_accel_width (accel_label);
|
ac_width = gtk_accel_label_get_accel_width (accel_label);
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
gtk_widget_size_request (widget, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
|
||||||
|
&requisition, NULL);
|
||||||
|
|
||||||
if (allocation.width >= requisition.width + ac_width)
|
if (allocation.width >= requisition.width + ac_width)
|
||||||
{
|
{
|
||||||
|
@ -1157,11 +1157,13 @@ gtk_assistant_size_request (GtkWidget *widget,
|
|||||||
GtkAssistantPage *page = list->data;
|
GtkAssistantPage *page = list->data;
|
||||||
gint w, h;
|
gint w, h;
|
||||||
|
|
||||||
gtk_widget_size_request (page->page, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (page->page),
|
||||||
|
&child_requisition, NULL);
|
||||||
width = MAX (width, child_requisition.width);
|
width = MAX (width, child_requisition.width);
|
||||||
height = MAX (height, child_requisition.height);
|
height = MAX (height, child_requisition.height);
|
||||||
|
|
||||||
gtk_widget_size_request (page->title, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (page->title),
|
||||||
|
&child_requisition, NULL);
|
||||||
w = child_requisition.width;
|
w = child_requisition.width;
|
||||||
h = child_requisition.height;
|
h = child_requisition.height;
|
||||||
|
|
||||||
@ -1177,16 +1179,19 @@ gtk_assistant_size_request (GtkWidget *widget,
|
|||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_size_request (priv->sidebar_image, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->sidebar_image),
|
||||||
|
&child_requisition, NULL);
|
||||||
width += child_requisition.width;
|
width += child_requisition.width;
|
||||||
height = MAX (height, child_requisition.height);
|
height = MAX (height, child_requisition.height);
|
||||||
|
|
||||||
gtk_widget_set_size_request (priv->header_image, header_width, header_height);
|
gtk_widget_set_size_request (priv->header_image, header_width, header_height);
|
||||||
gtk_widget_size_request (priv->header_image, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->header_image),
|
||||||
|
&child_requisition, NULL);
|
||||||
width = MAX (width, header_width) + 2 * header_padding;
|
width = MAX (width, header_width) + 2 * header_padding;
|
||||||
height += header_height + 2 * header_padding;
|
height += header_height + 2 * header_padding;
|
||||||
|
|
||||||
gtk_widget_size_request (priv->action_area, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->action_area),
|
||||||
|
&child_requisition, NULL);
|
||||||
width = MAX (width, child_requisition.width);
|
width = MAX (width, child_requisition.width);
|
||||||
height += child_requisition.height + ACTION_AREA_SPACING;
|
height += child_requisition.height + ACTION_AREA_SPACING;
|
||||||
|
|
||||||
|
@ -451,7 +451,8 @@ gtk_button_box_child_requisition (GtkWidget *widget,
|
|||||||
if (gtk_widget_get_visible (child))
|
if (gtk_widget_get_visible (child))
|
||||||
{
|
{
|
||||||
nchildren += 1;
|
nchildren += 1;
|
||||||
gtk_widget_size_request (child, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
|
||||||
|
&child_requisition, NULL);
|
||||||
avg_w += child_requisition.width + ipad_w;
|
avg_w += child_requisition.width + ipad_w;
|
||||||
avg_h += child_requisition.height + ipad_h;
|
avg_h += child_requisition.height + ipad_h;
|
||||||
}
|
}
|
||||||
|
@ -18,15 +18,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "gtkcellrendereraccel.h"
|
||||||
|
|
||||||
|
#include "gdk/gdkkeysyms.h"
|
||||||
|
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkaccelgroup.h"
|
#include "gtkaccelgroup.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
#include "gtkcellrendereraccel.h"
|
|
||||||
#include "gtklabel.h"
|
#include "gtklabel.h"
|
||||||
#include "gtkeventbox.h"
|
#include "gtkeventbox.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gdk/gdkkeysyms.h"
|
|
||||||
|
|
||||||
|
|
||||||
static void gtk_cell_renderer_accel_get_property (GObject *object,
|
static void gtk_cell_renderer_accel_get_property (GObject *object,
|
||||||
@ -413,7 +417,8 @@ gtk_cell_renderer_accel_get_size (GtkCellRenderer *cell,
|
|||||||
if (priv->sizing_label == NULL)
|
if (priv->sizing_label == NULL)
|
||||||
priv->sizing_label = gtk_label_new (_("New accelerator..."));
|
priv->sizing_label = gtk_label_new (_("New accelerator..."));
|
||||||
|
|
||||||
gtk_widget_size_request (priv->sizing_label, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->sizing_label),
|
||||||
|
&requisition, NULL);
|
||||||
|
|
||||||
GTK_CELL_RENDERER_CLASS (gtk_cell_renderer_accel_parent_class)->get_size (cell, widget, cell_area,
|
GTK_CELL_RENDERER_CLASS (gtk_cell_renderer_accel_parent_class)->get_size (cell, widget, cell_area,
|
||||||
x_offset, y_offset, width, height);
|
x_offset, y_offset, width, height);
|
||||||
|
@ -18,11 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <stdlib.h>
|
|
||||||
#include "gtkcellrenderertext.h"
|
#include "gtkcellrenderertext.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "gtkeditable.h"
|
#include "gtkeditable.h"
|
||||||
#include "gtkcellsizerequest.h"
|
#include "gtkcellsizerequest.h"
|
||||||
#include "gtkentry.h"
|
#include "gtkentry.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
@ -1928,8 +1932,9 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell,
|
|||||||
g_object_set_data_full (G_OBJECT (priv->entry), I_(GTK_CELL_RENDERER_TEXT_PATH), g_strdup (path), g_free);
|
g_object_set_data_full (G_OBJECT (priv->entry), I_(GTK_CELL_RENDERER_TEXT_PATH), g_strdup (path), g_free);
|
||||||
|
|
||||||
gtk_editable_select_region (GTK_EDITABLE (priv->entry), 0, -1);
|
gtk_editable_select_region (GTK_EDITABLE (priv->entry), 0, -1);
|
||||||
|
|
||||||
gtk_widget_size_request (priv->entry, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->entry),
|
||||||
|
&requisition, NULL);
|
||||||
if (requisition.height < cell_area->height)
|
if (requisition.height < cell_area->height)
|
||||||
{
|
{
|
||||||
GtkBorder *style_border;
|
GtkBorder *style_border;
|
||||||
|
@ -238,8 +238,9 @@ gtk_check_button_size_request (GtkWidget *widget,
|
|||||||
if (child && gtk_widget_get_visible (child))
|
if (child && gtk_widget_get_visible (child))
|
||||||
{
|
{
|
||||||
GtkRequisition child_requisition;
|
GtkRequisition child_requisition;
|
||||||
|
|
||||||
gtk_widget_size_request (child, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
requisition->width += child_requisition.width + indicator_spacing;
|
requisition->width += child_requisition.width + indicator_spacing;
|
||||||
requisition->height += child_requisition.height;
|
requisition->height += child_requisition.height;
|
||||||
|
@ -26,12 +26,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "gtkcolorsel.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "gdkconfig.h"
|
#include "gdkconfig.h"
|
||||||
#include "gdk/gdkkeysyms.h"
|
#include "gdk/gdkkeysyms.h"
|
||||||
#include "gtkcolorsel.h"
|
|
||||||
#include "gtkhsv.h"
|
#include "gtkhsv.h"
|
||||||
#include "gtkwindow.h"
|
#include "gtkwindow.h"
|
||||||
#include "gtkselection.h"
|
#include "gtkselection.h"
|
||||||
@ -57,6 +59,7 @@
|
|||||||
#include "gtksettings.h"
|
#include "gtksettings.h"
|
||||||
#include "gtkstock.h"
|
#include "gtkstock.h"
|
||||||
#include "gtkaccessible.h"
|
#include "gtkaccessible.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
|
|
||||||
@ -1357,7 +1360,8 @@ popup_position_func (GtkMenu *menu,
|
|||||||
gdk_window_get_origin (gtk_widget_get_window (widget),
|
gdk_window_get_origin (gtk_widget_get_window (widget),
|
||||||
&root_x, &root_y);
|
&root_x, &root_y);
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (menu), &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
|
||||||
|
&req, NULL);
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
|
|
||||||
/* Put corner of menu centered on color cell */
|
/* Put corner of menu centered on color cell */
|
||||||
|
@ -1529,7 +1529,8 @@ gtk_combo_box_menu_position_below (GtkMenu *menu,
|
|||||||
if (GTK_SHADOW_NONE != combo_box->priv->shadow_type)
|
if (GTK_SHADOW_NONE != combo_box->priv->shadow_type)
|
||||||
sx -= gtk_widget_get_style (GTK_WIDGET (combo_box))->xthickness;
|
sx -= gtk_widget_get_style (GTK_WIDGET (combo_box))->xthickness;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (menu), &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
|
||||||
|
&req, NULL);
|
||||||
|
|
||||||
if (gtk_widget_get_direction (GTK_WIDGET (combo_box)) == GTK_TEXT_DIR_LTR)
|
if (gtk_widget_get_direction (GTK_WIDGET (combo_box)) == GTK_TEXT_DIR_LTR)
|
||||||
*x = sx;
|
*x = sx;
|
||||||
@ -1705,14 +1706,16 @@ gtk_combo_box_list_position (GtkComboBox *combo_box,
|
|||||||
hpolicy = vpolicy = GTK_POLICY_NEVER;
|
hpolicy = vpolicy = GTK_POLICY_NEVER;
|
||||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolled_window),
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolled_window),
|
||||||
hpolicy, vpolicy);
|
hpolicy, vpolicy);
|
||||||
gtk_widget_size_request (priv->scrolled_window, &popup_req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->scrolled_window),
|
||||||
|
&popup_req, NULL);
|
||||||
|
|
||||||
if (popup_req.width > *width)
|
if (popup_req.width > *width)
|
||||||
{
|
{
|
||||||
hpolicy = GTK_POLICY_ALWAYS;
|
hpolicy = GTK_POLICY_ALWAYS;
|
||||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolled_window),
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolled_window),
|
||||||
hpolicy, vpolicy);
|
hpolicy, vpolicy);
|
||||||
gtk_widget_size_request (priv->scrolled_window, &popup_req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->scrolled_window),
|
||||||
|
&popup_req, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
*height = popup_req.height;
|
*height = popup_req.height;
|
||||||
@ -2168,7 +2171,8 @@ gtk_combo_box_update_requested_width (GtkComboBox *combo_box,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define GTK_COMBO_BOX_SIZE_ALLOCATE_BUTTON \
|
#define GTK_COMBO_BOX_SIZE_ALLOCATE_BUTTON \
|
||||||
gtk_widget_size_request (combo_box->priv->button, &req); \
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (combo_box->priv->button), \
|
||||||
|
&req, NULL); \
|
||||||
\
|
\
|
||||||
if (is_rtl) \
|
if (is_rtl) \
|
||||||
child.x = allocation->x + shadow_width; \
|
child.x = allocation->x + shadow_width; \
|
||||||
@ -2254,7 +2258,8 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
|
|||||||
|
|
||||||
|
|
||||||
/* handle the children */
|
/* handle the children */
|
||||||
gtk_widget_size_request (priv->arrow, &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->arrow),
|
||||||
|
&req, NULL);
|
||||||
child.width = req.width;
|
child.width = req.width;
|
||||||
if (!is_rtl)
|
if (!is_rtl)
|
||||||
child.x += width - req.width;
|
child.x += width - req.width;
|
||||||
@ -2263,7 +2268,8 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
|
|||||||
gtk_widget_size_allocate (priv->arrow, &child);
|
gtk_widget_size_allocate (priv->arrow, &child);
|
||||||
if (is_rtl)
|
if (is_rtl)
|
||||||
child.x += req.width;
|
child.x += req.width;
|
||||||
gtk_widget_size_request (priv->separator, &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->separator),
|
||||||
|
&req, NULL);
|
||||||
child.width = req.width;
|
child.width = req.width;
|
||||||
if (!is_rtl)
|
if (!is_rtl)
|
||||||
child.x -= req.width;
|
child.x -= req.width;
|
||||||
@ -2910,7 +2916,8 @@ gtk_cell_view_menu_item_new (GtkComboBox *combo_box,
|
|||||||
gtk_tree_path_free (path);
|
gtk_tree_path_free (path);
|
||||||
|
|
||||||
gtk_combo_box_sync_cells (combo_box, GTK_CELL_LAYOUT (cell_view));
|
gtk_combo_box_sync_cells (combo_box, GTK_CELL_LAYOUT (cell_view));
|
||||||
gtk_widget_size_request (cell_view, &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (cell_view),
|
||||||
|
&req, NULL);
|
||||||
gtk_widget_show (cell_view);
|
gtk_widget_show (cell_view);
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
|
@ -25,16 +25,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "gtkcontainer.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "gtkcontainer.h"
|
|
||||||
#include "gtkbuildable.h"
|
#include "gtkbuildable.h"
|
||||||
#include "gtkbuilderprivate.h"
|
#include "gtkbuilderprivate.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtkwindow.h"
|
#include "gtkwindow.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtktoolbar.h"
|
#include "gtktoolbar.h"
|
||||||
@ -1482,8 +1485,9 @@ gtk_container_real_check_resize (GtkContainer *container)
|
|||||||
GtkWidget *widget = GTK_WIDGET (container);
|
GtkWidget *widget = GTK_WIDGET (container);
|
||||||
GtkAllocation allocation;
|
GtkAllocation allocation;
|
||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
|
|
||||||
gtk_widget_size_request (widget, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
|
||||||
|
&requisition, NULL);
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
|
|
||||||
if (requisition.width > allocation.width ||
|
if (requisition.width > allocation.width ||
|
||||||
|
@ -8508,7 +8508,8 @@ popup_position_func (GtkMenu *menu,
|
|||||||
gtk_menu_set_monitor (menu, monitor_num);
|
gtk_menu_set_monitor (menu, monitor_num);
|
||||||
|
|
||||||
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
|
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
|
||||||
gtk_widget_size_request (entry->popup_menu, &menu_req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (entry->popup_menu),
|
||||||
|
&menu_req, NULL);
|
||||||
gdk_drawable_get_size (entry->text_area, NULL, &height);
|
gdk_drawable_get_size (entry->text_area, NULL, &height);
|
||||||
gtk_entry_get_cursor_locations (entry, CURSOR_STANDARD, &strong_x, NULL);
|
gtk_entry_get_cursor_locations (entry, CURSOR_STANDARD, &strong_x, NULL);
|
||||||
_gtk_entry_effective_inner_border (entry, &inner_border);
|
_gtk_entry_effective_inner_border (entry, &inner_border);
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "gtkentrycompletion.h"
|
#include "gtkentrycompletion.h"
|
||||||
|
|
||||||
#include "gtkentryprivate.h"
|
#include "gtkentryprivate.h"
|
||||||
#include "gtkcelllayout.h"
|
#include "gtkcelllayout.h"
|
||||||
|
|
||||||
@ -28,6 +30,7 @@
|
|||||||
#include "gtktreeselection.h"
|
#include "gtktreeselection.h"
|
||||||
#include "gtktreeview.h"
|
#include "gtktreeview.h"
|
||||||
#include "gtkscrolledwindow.h"
|
#include "gtkscrolledwindow.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtkvbox.h"
|
#include "gtkvbox.h"
|
||||||
#include "gtkwindow.h"
|
#include "gtkwindow.h"
|
||||||
#include "gtkentry.h"
|
#include "gtkentry.h"
|
||||||
@ -1449,9 +1452,11 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
|
|||||||
else
|
else
|
||||||
gtk_widget_hide (completion->priv->action_view);
|
gtk_widget_hide (completion->priv->action_view);
|
||||||
|
|
||||||
gtk_widget_size_request (completion->priv->popup_window, &popup_req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (completion->priv->popup_window),
|
||||||
gtk_widget_size_request (completion->priv->entry, &entry_req);
|
&popup_req, NULL);
|
||||||
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (completion->priv->entry),
|
||||||
|
&entry_req, NULL);
|
||||||
|
|
||||||
if (x < monitor.x)
|
if (x < monitor.x)
|
||||||
x = monitor.x;
|
x = monitor.x;
|
||||||
else if (x + popup_req.width > monitor.x + monitor.width)
|
else if (x + popup_req.width > monitor.x + monitor.width)
|
||||||
|
@ -25,7 +25,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "gtkeventbox.h"
|
#include "gtkeventbox.h"
|
||||||
|
|
||||||
|
#include "gtksizerequest.h"
|
||||||
|
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
|
|
||||||
@ -499,8 +503,9 @@ gtk_event_box_size_request (GtkWidget *widget,
|
|||||||
if (child && gtk_widget_get_visible (child))
|
if (child && gtk_widget_get_visible (child))
|
||||||
{
|
{
|
||||||
GtkRequisition child_requisition;
|
GtkRequisition child_requisition;
|
||||||
|
|
||||||
gtk_widget_size_request (child, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
requisition->width += child_requisition.width;
|
requisition->width += child_requisition.width;
|
||||||
requisition->height += child_requisition.height;
|
requisition->height += child_requisition.height;
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "gtkfilechooserdefault.h"
|
||||||
|
|
||||||
#include "gdk/gdkkeysyms.h"
|
#include "gdk/gdkkeysyms.h"
|
||||||
#include "gtkalignment.h"
|
#include "gtkalignment.h"
|
||||||
#include "gtkbindings.h"
|
#include "gtkbindings.h"
|
||||||
@ -33,7 +35,6 @@
|
|||||||
#include "gtkentry.h"
|
#include "gtkentry.h"
|
||||||
#include "gtkexpander.h"
|
#include "gtkexpander.h"
|
||||||
#include "gtkfilechooserprivate.h"
|
#include "gtkfilechooserprivate.h"
|
||||||
#include "gtkfilechooserdefault.h"
|
|
||||||
#include "gtkfilechooserdialog.h"
|
#include "gtkfilechooserdialog.h"
|
||||||
#include "gtkfilechooserembed.h"
|
#include "gtkfilechooserembed.h"
|
||||||
#include "gtkfilechooserentry.h"
|
#include "gtkfilechooserentry.h"
|
||||||
@ -61,6 +62,7 @@
|
|||||||
#include "gtkscrolledwindow.h"
|
#include "gtkscrolledwindow.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
#include "gtkseparatormenuitem.h"
|
||||||
#include "gtksizegroup.h"
|
#include "gtksizegroup.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtkstock.h"
|
#include "gtkstock.h"
|
||||||
#include "gtktable.h"
|
#include "gtktable.h"
|
||||||
#include "gtktooltip.h"
|
#include "gtktooltip.h"
|
||||||
@ -4107,7 +4109,8 @@ popup_position_func (GtkMenu *menu,
|
|||||||
|
|
||||||
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
|
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (menu), &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
|
||||||
|
&req, NULL);
|
||||||
|
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
*x += (allocation.width - req.width) / 2;
|
*x += (allocation.width - req.width) / 2;
|
||||||
@ -7849,20 +7852,23 @@ gtk_file_chooser_default_get_default_size (GtkFileChooserEmbed *chooser_embed,
|
|||||||
impl->preview_widget &&
|
impl->preview_widget &&
|
||||||
gtk_widget_get_visible (impl->preview_widget))
|
gtk_widget_get_visible (impl->preview_widget))
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (impl->preview_box, &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (impl->preview_box),
|
||||||
|
&req, NULL);
|
||||||
*default_width += PREVIEW_HBOX_SPACING + req.width;
|
*default_width += PREVIEW_HBOX_SPACING + req.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (impl->extra_widget &&
|
if (impl->extra_widget &&
|
||||||
gtk_widget_get_visible (impl->extra_widget))
|
gtk_widget_get_visible (impl->extra_widget))
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (impl->extra_align, &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (impl->extra_align),
|
||||||
|
&req, NULL);
|
||||||
*default_height += gtk_box_get_spacing (GTK_BOX (chooser_embed)) + req.height;
|
*default_height += gtk_box_get_spacing (GTK_BOX (chooser_embed)) + req.height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (GTK_WIDGET (impl), &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (impl),
|
||||||
|
&req, NULL);
|
||||||
*default_width = req.width;
|
*default_width = req.width;
|
||||||
*default_height = req.height;
|
*default_height = req.height;
|
||||||
}
|
}
|
||||||
|
@ -20,13 +20,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "gtkfilechooserprivate.h"
|
|
||||||
#include "gtkfilechooserdialog.h"
|
#include "gtkfilechooserdialog.h"
|
||||||
|
|
||||||
|
#include "gtkfilechooserprivate.h"
|
||||||
#include "gtkfilechooserwidget.h"
|
#include "gtkfilechooserwidget.h"
|
||||||
#include "gtkfilechooserutils.h"
|
#include "gtkfilechooserutils.h"
|
||||||
#include "gtkfilechooserembed.h"
|
#include "gtkfilechooserembed.h"
|
||||||
#include "gtkfilechoosersettings.h"
|
#include "gtkfilechoosersettings.h"
|
||||||
#include "gtkfilesystem.h"
|
#include "gtkfilesystem.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtktypebuiltins.h"
|
#include "gtktypebuiltins.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
|
|
||||||
@ -196,8 +199,10 @@ file_chooser_widget_default_size_changed (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
/* Force a size request of everything before we start. This will make sure
|
/* Force a size request of everything before we start. This will make sure
|
||||||
* that widget->requisition is meaningful. */
|
* that widget->requisition is meaningful. */
|
||||||
gtk_widget_size_request (GTK_WIDGET (dialog), &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (dialog),
|
||||||
gtk_widget_size_request (widget, &widget_req);
|
&req, NULL);
|
||||||
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
|
||||||
|
&widget_req, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
_gtk_file_chooser_embed_get_default_size (GTK_FILE_CHOOSER_EMBED (priv->widget),
|
_gtk_file_chooser_embed_get_default_size (GTK_FILE_CHOOSER_EMBED (priv->widget),
|
||||||
|
@ -19,15 +19,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "gtkfilechooserentry.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "gtkalignment.h"
|
#include "gtkalignment.h"
|
||||||
#include "gtkcelllayout.h"
|
#include "gtkcelllayout.h"
|
||||||
#include "gtkcellrenderertext.h"
|
#include "gtkcellrenderertext.h"
|
||||||
#include "gtkentry.h"
|
#include "gtkentry.h"
|
||||||
#include "gtkfilechooserentry.h"
|
|
||||||
#include "gtklabel.h"
|
#include "gtklabel.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtkwindow.h"
|
#include "gtkwindow.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
|
|
||||||
@ -1023,7 +1026,8 @@ show_completion_feedback_window (GtkFileChooserEntry *chooser_entry)
|
|||||||
GtkAllocation entry_allocation;
|
GtkAllocation entry_allocation;
|
||||||
int feedback_x, feedback_y;
|
int feedback_x, feedback_y;
|
||||||
|
|
||||||
gtk_widget_size_request (chooser_entry->completion_feedback_window, &feedback_req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (chooser_entry->completion_feedback_window),
|
||||||
|
&feedback_req, NULL);
|
||||||
|
|
||||||
gdk_window_get_origin (gtk_widget_get_window (widget), &entry_x, &entry_y);
|
gdk_window_get_origin (gtk_widget_get_window (widget), &entry_x, &entry_y);
|
||||||
gtk_widget_get_allocation (widget, &entry_allocation);
|
gtk_widget_get_allocation (widget, &entry_allocation);
|
||||||
|
@ -352,7 +352,8 @@ gtk_fixed_size_request (GtkWidget *widget,
|
|||||||
|
|
||||||
if (gtk_widget_get_visible (child->widget))
|
if (gtk_widget_get_visible (child->widget))
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (child->widget, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
requisition->height = MAX (requisition->height,
|
requisition->height = MAX (requisition->height,
|
||||||
child->y +
|
child->y +
|
||||||
|
@ -581,7 +581,10 @@ gtk_handle_box_size_request (GtkWidget *widget,
|
|||||||
* won't have any useful hint for our size otherwise.
|
* won't have any useful hint for our size otherwise.
|
||||||
*/
|
*/
|
||||||
if (child)
|
if (child)
|
||||||
gtk_widget_size_request (child, &child_requisition);
|
{
|
||||||
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
child_requisition.width = 0;
|
child_requisition.width = 0;
|
||||||
|
@ -1455,8 +1455,9 @@ gtk_icon_view_size_request (GtkWidget *widget,
|
|||||||
tmp_list = tmp_list->next;
|
tmp_list = tmp_list->next;
|
||||||
|
|
||||||
if (gtk_widget_get_visible (child->widget))
|
if (gtk_widget_get_visible (child->widget))
|
||||||
gtk_widget_size_request (child->widget, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
||||||
}
|
&child_requisition, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -442,8 +442,8 @@ gtk_image_menu_item_size_request (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkRequisition child_requisition;
|
GtkRequisition child_requisition;
|
||||||
|
|
||||||
gtk_widget_size_request (priv->image,
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->image),
|
||||||
&child_requisition);
|
&child_requisition, NULL);
|
||||||
|
|
||||||
child_width = child_requisition.width;
|
child_width = child_requisition.width;
|
||||||
child_height = child_requisition.height;
|
child_height = child_requisition.height;
|
||||||
|
@ -6137,7 +6137,8 @@ popup_position_func (GtkMenu *menu,
|
|||||||
*x += allocation.x;
|
*x += allocation.x;
|
||||||
*y += allocation.y;
|
*y += allocation.y;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (menu), &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
|
||||||
|
&req, NULL);
|
||||||
|
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
|
|
||||||
|
@ -995,7 +995,8 @@ gtk_layout_size_request (GtkWidget *widget,
|
|||||||
|
|
||||||
tmp_list = tmp_list->next;
|
tmp_list = tmp_list->next;
|
||||||
|
|
||||||
gtk_widget_size_request (child->widget, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
||||||
|
&child_requisition, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "gtklinkbutton.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "gtkclipboard.h"
|
#include "gtkclipboard.h"
|
||||||
@ -33,12 +35,11 @@
|
|||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtkmenu.h"
|
#include "gtkmenu.h"
|
||||||
#include "gtkmenuitem.h"
|
#include "gtkmenuitem.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtkstock.h"
|
#include "gtkstock.h"
|
||||||
#include "gtkshow.h"
|
#include "gtkshow.h"
|
||||||
#include "gtktooltip.h"
|
#include "gtktooltip.h"
|
||||||
|
|
||||||
#include "gtklinkbutton.h"
|
|
||||||
|
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
|
|
||||||
|
|
||||||
@ -368,7 +369,8 @@ popup_position_func (GtkMenu *menu,
|
|||||||
|
|
||||||
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
|
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
|
||||||
|
|
||||||
gtk_widget_size_request (priv->popup_menu, &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->popup_menu),
|
||||||
|
&req, NULL);
|
||||||
|
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
*x += allocation.width / 2;
|
*x += allocation.width / 2;
|
||||||
|
@ -2051,7 +2051,9 @@ gtk_menu_set_tearoff_hints (GtkMenu *menu,
|
|||||||
if (gtk_widget_get_visible (menu->tearoff_scrollbar))
|
if (gtk_widget_get_visible (menu->tearoff_scrollbar))
|
||||||
{
|
{
|
||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
gtk_widget_size_request (menu->tearoff_scrollbar, &requisition);
|
|
||||||
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (menu->tearoff_scrollbar),
|
||||||
|
&requisition, NULL);
|
||||||
width += requisition.width;
|
width += requisition.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2203,8 +2205,9 @@ gtk_menu_set_tearoff_state (GtkMenu *menu,
|
|||||||
|
|
||||||
/* Update menu->requisition
|
/* Update menu->requisition
|
||||||
*/
|
*/
|
||||||
gtk_widget_size_request (GTK_WIDGET (menu), NULL);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
|
||||||
|
NULL, NULL);
|
||||||
|
|
||||||
gtk_menu_set_tearoff_hints (menu, width);
|
gtk_menu_set_tearoff_hints (menu, width);
|
||||||
|
|
||||||
gtk_widget_realize (menu->tearoff_window);
|
gtk_widget_realize (menu->tearoff_window);
|
||||||
@ -5452,7 +5455,8 @@ child_at (GtkMenu *menu,
|
|||||||
{
|
{
|
||||||
GtkRequisition child_requisition;
|
GtkRequisition child_requisition;
|
||||||
|
|
||||||
gtk_widget_size_request (children->data, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (children->data),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
if (_gtk_menu_item_is_selectable (children->data) &&
|
if (_gtk_menu_item_is_selectable (children->data) &&
|
||||||
child_offset >= lower &&
|
child_offset >= lower &&
|
||||||
|
@ -311,7 +311,8 @@ gtk_menu_bar_size_request (GtkWidget *widget,
|
|||||||
gint toggle_size;
|
gint toggle_size;
|
||||||
|
|
||||||
GTK_MENU_ITEM (child)->show_submenu_indicator = FALSE;
|
GTK_MENU_ITEM (child)->show_submenu_indicator = FALSE;
|
||||||
gtk_widget_size_request (child, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
|
||||||
|
&child_requisition, NULL);
|
||||||
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
|
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
|
||||||
&toggle_size);
|
&toggle_size);
|
||||||
|
|
||||||
|
@ -22,12 +22,15 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "gtkmenutoolbutton.h"
|
#include "gtkmenutoolbutton.h"
|
||||||
|
|
||||||
#include "gtktogglebutton.h"
|
#include "gtktogglebutton.h"
|
||||||
#include "gtkarrow.h"
|
#include "gtkarrow.h"
|
||||||
#include "gtkhbox.h"
|
#include "gtkhbox.h"
|
||||||
#include "gtkvbox.h"
|
#include "gtkvbox.h"
|
||||||
#include "gtkmenu.h"
|
#include "gtkmenu.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
|
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
|
|
||||||
@ -267,7 +270,8 @@ menu_position_func (GtkMenu *menu,
|
|||||||
GdkScreen *screen;
|
GdkScreen *screen;
|
||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (priv->menu), &menu_req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->menu),
|
||||||
|
&menu_req, NULL);
|
||||||
|
|
||||||
orientation = gtk_tool_item_get_orientation (GTK_TOOL_ITEM (button));
|
orientation = gtk_tool_item_get_orientation (GTK_TOOL_ITEM (button));
|
||||||
direction = gtk_widget_get_direction (widget);
|
direction = gtk_widget_get_direction (widget);
|
||||||
@ -307,7 +311,8 @@ menu_position_func (GtkMenu *menu,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
gdk_window_get_origin (GTK_BUTTON (priv->arrow_button)->event_window, x, y);
|
gdk_window_get_origin (GTK_BUTTON (priv->arrow_button)->event_window, x, y);
|
||||||
gtk_widget_size_request (priv->arrow_button, &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->arrow_button),
|
||||||
|
&req, NULL);
|
||||||
|
|
||||||
gtk_widget_get_allocation (priv->arrow_button, &arrow_allocation);
|
gtk_widget_get_allocation (priv->arrow_button, &arrow_allocation);
|
||||||
|
|
||||||
|
@ -1856,8 +1856,9 @@ gtk_notebook_size_request (GtkWidget *widget,
|
|||||||
if (gtk_widget_get_visible (page->child))
|
if (gtk_widget_get_visible (page->child))
|
||||||
{
|
{
|
||||||
vis_pages++;
|
vis_pages++;
|
||||||
gtk_widget_size_request (page->child, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (page->child),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
requisition->width = MAX (requisition->width,
|
requisition->width = MAX (requisition->width,
|
||||||
child_requisition.width);
|
child_requisition.width);
|
||||||
requisition->height = MAX (requisition->height,
|
requisition->height = MAX (requisition->height,
|
||||||
@ -1913,8 +1914,8 @@ gtk_notebook_size_request (GtkWidget *widget,
|
|||||||
if (!gtk_widget_get_visible (page->tab_label))
|
if (!gtk_widget_get_visible (page->tab_label))
|
||||||
gtk_widget_show (page->tab_label);
|
gtk_widget_show (page->tab_label);
|
||||||
|
|
||||||
gtk_widget_size_request (page->tab_label,
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (page->tab_label),
|
||||||
&child_requisition);
|
&child_requisition, NULL);
|
||||||
|
|
||||||
page->requisition.width = child_requisition.width + 2 * style->xthickness;
|
page->requisition.width = child_requisition.width + 2 * style->xthickness;
|
||||||
page->requisition.height = child_requisition.height + 2 * style->ythickness;
|
page->requisition.height = child_requisition.height + 2 * style->ythickness;
|
||||||
@ -1949,7 +1950,8 @@ gtk_notebook_size_request (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
if (priv->action_widget[i])
|
if (priv->action_widget[i])
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (priv->action_widget[i], &action_widget_requisition[i]);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->action_widget[i]),
|
||||||
|
&action_widget_requisition[i], NULL);
|
||||||
action_widget_requisition[i].width += style->xthickness;
|
action_widget_requisition[i].width += style->xthickness;
|
||||||
action_widget_requisition[i].height += style->ythickness;
|
action_widget_requisition[i].height += style->ythickness;
|
||||||
}
|
}
|
||||||
@ -2711,7 +2713,8 @@ popup_position_func (GtkMenu *menu,
|
|||||||
gdk_window_get_origin (gtk_widget_get_window (w), x, y);
|
gdk_window_get_origin (gtk_widget_get_window (w), x, y);
|
||||||
|
|
||||||
gtk_widget_get_allocation (w, &allocation);
|
gtk_widget_get_allocation (w, &allocation);
|
||||||
gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
|
||||||
|
&requisition, NULL);
|
||||||
|
|
||||||
if (gtk_widget_get_direction (w) == GTK_TEXT_DIR_RTL)
|
if (gtk_widget_get_direction (w) == GTK_TEXT_DIR_RTL)
|
||||||
*x += allocation.x + allocation.width - requisition.width;
|
*x += allocation.x + allocation.width - requisition.width;
|
||||||
@ -3331,7 +3334,8 @@ on_drag_icon_expose (GtkWidget *widget,
|
|||||||
notebook = GTK_WIDGET (data);
|
notebook = GTK_WIDGET (data);
|
||||||
child = gtk_bin_get_child (GTK_BIN (widget));
|
child = gtk_bin_get_child (GTK_BIN (widget));
|
||||||
|
|
||||||
gtk_widget_size_request (widget, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
|
||||||
|
&requisition, NULL);
|
||||||
gap_pos = get_tab_gap_pos (GTK_NOTEBOOK (notebook));
|
gap_pos = get_tab_gap_pos (GTK_NOTEBOOK (notebook));
|
||||||
|
|
||||||
gtk_paint_extension (gtk_widget_get_style (notebook),
|
gtk_paint_extension (gtk_widget_get_style (notebook),
|
||||||
|
@ -18,8 +18,12 @@
|
|||||||
* Alexander Larsson <alexl@redhat.com>
|
* Alexander Larsson <alexl@redhat.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "gtkoffscreenwindow.h"
|
#include "gtkoffscreenwindow.h"
|
||||||
|
|
||||||
|
#include "gtksizerequest.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:gtkoffscreenwindow
|
* SECTION:gtkoffscreenwindow
|
||||||
* @short_description: A toplevel container widget used to manage offscreen
|
* @short_description: A toplevel container widget used to manage offscreen
|
||||||
@ -69,7 +73,8 @@ gtk_offscreen_window_size_request (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkRequisition child_req;
|
GtkRequisition child_req;
|
||||||
|
|
||||||
gtk_widget_size_request (child, &child_req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
|
||||||
|
&child_req, NULL);
|
||||||
|
|
||||||
requisition->width += child_req.width;
|
requisition->width += child_req.width;
|
||||||
requisition->height += child_req.height;
|
requisition->height += child_req.height;
|
||||||
@ -171,7 +176,8 @@ gtk_offscreen_window_resize (GtkWidget *widget)
|
|||||||
GtkAllocation allocation = { 0, 0 };
|
GtkAllocation allocation = { 0, 0 };
|
||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
|
|
||||||
gtk_widget_size_request (widget, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
|
||||||
|
&requisition, NULL);
|
||||||
|
|
||||||
allocation.width = requisition.width;
|
allocation.width = requisition.width;
|
||||||
allocation.height = requisition.height;
|
allocation.height = requisition.height;
|
||||||
|
@ -805,7 +805,8 @@ gtk_paned_size_request (GtkWidget *widget,
|
|||||||
|
|
||||||
if (priv->child1 && gtk_widget_get_visible (priv->child1))
|
if (priv->child1 && gtk_widget_get_visible (priv->child1))
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (priv->child1, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->child1),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
requisition->height = child_requisition.height;
|
requisition->height = child_requisition.height;
|
||||||
requisition->width = child_requisition.width;
|
requisition->width = child_requisition.width;
|
||||||
@ -813,7 +814,8 @@ gtk_paned_size_request (GtkWidget *widget,
|
|||||||
|
|
||||||
if (priv->child2 && gtk_widget_get_visible (priv->child2))
|
if (priv->child2 && gtk_widget_get_visible (priv->child2))
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (priv->child2, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->child2),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||||
{
|
{
|
||||||
|
@ -334,8 +334,9 @@ gtk_path_bar_size_request (GtkWidget *widget,
|
|||||||
for (list = path_bar->button_list; list; list = list->next)
|
for (list = path_bar->button_list; list; list = list->next)
|
||||||
{
|
{
|
||||||
button_data = BUTTON_DATA (list->data);
|
button_data = BUTTON_DATA (list->data);
|
||||||
gtk_widget_size_request (button_data->button, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (button_data->button),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
if (button_data->type == NORMAL_BUTTON)
|
if (button_data->type == NORMAL_BUTTON)
|
||||||
/* Use 2*Height as button width because of ellipsized label. */
|
/* Use 2*Height as button width because of ellipsized label. */
|
||||||
requisition->width = MAX (child_requisition.height * 2, requisition->width);
|
requisition->width = MAX (child_requisition.height * 2, requisition->width);
|
||||||
@ -353,8 +354,10 @@ gtk_path_bar_size_request (GtkWidget *widget,
|
|||||||
if (path_bar->button_list && path_bar->button_list->next != NULL)
|
if (path_bar->button_list && path_bar->button_list->next != NULL)
|
||||||
requisition->width += (path_bar->spacing + path_bar->slider_width) * 2;
|
requisition->width += (path_bar->spacing + path_bar->slider_width) * 2;
|
||||||
|
|
||||||
gtk_widget_size_request (path_bar->up_slider_button, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (path_bar->up_slider_button),
|
||||||
gtk_widget_size_request (path_bar->down_slider_button, &child_requisition);
|
&child_requisition, NULL);
|
||||||
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (path_bar->down_slider_button),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||||
requisition->width += border_width * 2;
|
requisition->width += border_width * 2;
|
||||||
|
@ -1411,8 +1411,9 @@ create_application_page (GtkPrintOperation *op)
|
|||||||
const char *tab_label;
|
const char *tab_label;
|
||||||
|
|
||||||
/* Make the template the size of the custom widget size request */
|
/* Make the template the size of the custom widget size request */
|
||||||
gtk_widget_size_request (op->priv->custom_widget, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (op->priv->custom_widget),
|
||||||
|
&requisition, NULL);
|
||||||
|
|
||||||
base_units = GetDialogBaseUnits ();
|
base_units = GetDialogBaseUnits ();
|
||||||
baseunitX = LOWORD (base_units);
|
baseunitX = LOWORD (base_units);
|
||||||
baseunitY = HIWORD (base_units);
|
baseunitY = HIWORD (base_units);
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
#include "gtkscrolledwindow.h"
|
#include "gtkscrolledwindow.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
#include "gtkseparatormenuitem.h"
|
||||||
#include "gtksizegroup.h"
|
#include "gtksizegroup.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtktable.h"
|
#include "gtktable.h"
|
||||||
#include "gtktreemodelsort.h"
|
#include "gtktreemodelsort.h"
|
||||||
#include "gtktreemodelfilter.h"
|
#include "gtktreemodelfilter.h"
|
||||||
@ -945,7 +946,8 @@ set_default_size (GtkRecentChooserDefault *impl)
|
|||||||
height = (impl->icon_size + font_size) * NUM_LINES;
|
height = (impl->icon_size + font_size) * NUM_LINES;
|
||||||
|
|
||||||
/* Use at least the requisition size... */
|
/* Use at least the requisition size... */
|
||||||
gtk_widget_size_request (widget, &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
|
||||||
|
&req, NULL);
|
||||||
width = MAX (width, req.width);
|
width = MAX (width, req.width);
|
||||||
height = MAX (height, req.height);
|
height = MAX (height, req.height);
|
||||||
|
|
||||||
@ -1847,7 +1849,8 @@ popup_position_func (GtkMenu *menu,
|
|||||||
gdk_window_get_origin (gtk_widget_get_window (widget),
|
gdk_window_get_origin (gtk_widget_get_window (widget),
|
||||||
x, y);
|
x, y);
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (menu), &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
|
||||||
|
&req, NULL);
|
||||||
|
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
*x += (allocation.width - req.width) / 2;
|
*x += (allocation.width - req.width) / 2;
|
||||||
|
@ -1851,10 +1851,10 @@ gtk_scrolled_window_get_size (GtkSizeRequest *widget,
|
|||||||
natural_req.width = 0;
|
natural_req.width = 0;
|
||||||
natural_req.height = 0;
|
natural_req.height = 0;
|
||||||
|
|
||||||
gtk_widget_size_request (priv->hscrollbar,
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->hscrollbar),
|
||||||
&hscrollbar_requisition);
|
&hscrollbar_requisition, NULL);
|
||||||
gtk_widget_size_request (priv->vscrollbar,
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->vscrollbar),
|
||||||
&vscrollbar_requisition);
|
&vscrollbar_requisition, NULL);
|
||||||
|
|
||||||
child = gtk_bin_get_child (bin);
|
child = gtk_bin_get_child (bin);
|
||||||
if (child && gtk_widget_get_visible (child))
|
if (child && gtk_widget_get_visible (child))
|
||||||
|
@ -26,15 +26,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "gtksocket.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "gdk/gdkkeysyms.h"
|
#include "gdk/gdkkeysyms.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtkwindow.h"
|
#include "gtkwindow.h"
|
||||||
#include "gtkplug.h"
|
#include "gtkplug.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtksocket.h"
|
|
||||||
#include "gtksocketprivate.h"
|
#include "gtksocketprivate.h"
|
||||||
#include "gtkdnd.h"
|
#include "gtkdnd.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
@ -457,7 +460,8 @@ gtk_socket_size_request (GtkWidget *widget,
|
|||||||
|
|
||||||
if (socket->plug_widget)
|
if (socket->plug_widget)
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (socket->plug_widget, requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (socket->plug_widget),
|
||||||
|
requisition, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -28,14 +28,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "gtkstatusicon.h"
|
#include "gtkstatusicon.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkiconfactory.h"
|
#include "gtkiconfactory.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtktrayicon.h"
|
#include "gtktrayicon.h"
|
||||||
|
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
@ -2379,7 +2381,8 @@ gtk_status_icon_position_menu (GtkMenu *menu,
|
|||||||
|
|
||||||
gdk_window_get_origin (window, x, y);
|
gdk_window_get_origin (window, x, y);
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (menu), &menu_req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
|
||||||
|
&menu_req, NULL);
|
||||||
|
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
if (_gtk_tray_icon_get_orientation (tray_icon) == GTK_ORIENTATION_VERTICAL)
|
if (_gtk_tray_icon_get_orientation (tray_icon) == GTK_ORIENTATION_VERTICAL)
|
||||||
|
@ -1039,7 +1039,8 @@ gtk_table_size_request_init (GtkTable *table)
|
|||||||
children = children->next;
|
children = children->next;
|
||||||
|
|
||||||
if (gtk_widget_get_visible (child->widget))
|
if (gtk_widget_get_visible (child->widget))
|
||||||
gtk_widget_size_request (child->widget, NULL);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
||||||
|
NULL, NULL);
|
||||||
|
|
||||||
if (child->left_attach == (child->right_attach - 1) && child->xexpand)
|
if (child->left_attach == (child->right_attach - 1) && child->xexpand)
|
||||||
priv->cols[child->left_attach].expand = TRUE;
|
priv->cols[child->left_attach].expand = TRUE;
|
||||||
|
@ -3312,8 +3312,6 @@ gtk_text_view_size_request (GtkWidget *widget,
|
|||||||
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
||||||
&old_req, NULL);
|
&old_req, NULL);
|
||||||
|
|
||||||
gtk_widget_size_request (child->widget, &child_req);
|
|
||||||
|
|
||||||
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
||||||
&child_req, NULL);
|
&child_req, NULL);
|
||||||
|
|
||||||
@ -3327,8 +3325,9 @@ gtk_text_view_size_request (GtkWidget *widget,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
GtkRequisition child_req;
|
GtkRequisition child_req;
|
||||||
|
|
||||||
gtk_widget_size_request (child->widget, &child_req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
||||||
|
&child_req, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp_list = g_slist_next (tmp_list);
|
tmp_list = g_slist_next (tmp_list);
|
||||||
@ -8098,8 +8097,9 @@ popup_position_func (GtkMenu *menu,
|
|||||||
&cursor_rect);
|
&cursor_rect);
|
||||||
|
|
||||||
gtk_text_view_get_visible_rect (text_view, &onscreen_rect);
|
gtk_text_view_get_visible_rect (text_view, &onscreen_rect);
|
||||||
|
|
||||||
gtk_widget_size_request (text_view->priv->popup_menu, &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (text_view->priv->popup_menu),
|
||||||
|
&req, NULL);
|
||||||
|
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
|
|
||||||
|
@ -928,8 +928,9 @@ gtk_toolbar_size_request (GtkWidget *widget,
|
|||||||
|
|
||||||
if (priv->show_arrow)
|
if (priv->show_arrow)
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (priv->arrow_button, &arrow_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->arrow_button),
|
||||||
|
&arrow_requisition, NULL);
|
||||||
|
|
||||||
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||||
long_req = arrow_requisition.width;
|
long_req = arrow_requisition.width;
|
||||||
else
|
else
|
||||||
@ -2325,9 +2326,9 @@ gtk_toolbar_set_drop_highlight_item (GtkToolbar *toolbar,
|
|||||||
|
|
||||||
g_assert (content);
|
g_assert (content);
|
||||||
g_assert (toolbar_content_is_placeholder (content));
|
g_assert (toolbar_content_is_placeholder (content));
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (priv->highlight_tool_item),
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->highlight_tool_item),
|
||||||
&requisition);
|
&requisition, NULL);
|
||||||
|
|
||||||
toolbar_content_set_expand (content, gtk_tool_item_get_expand (tool_item));
|
toolbar_content_set_expand (content, gtk_tool_item_get_expand (tool_item));
|
||||||
|
|
||||||
@ -2590,10 +2591,12 @@ menu_position_func (GtkMenu *menu,
|
|||||||
GdkRectangle monitor;
|
GdkRectangle monitor;
|
||||||
gint monitor_num;
|
gint monitor_num;
|
||||||
GdkScreen *screen;
|
GdkScreen *screen;
|
||||||
|
|
||||||
gtk_widget_size_request (priv->arrow_button, &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->arrow_button),
|
||||||
gtk_widget_size_request (GTK_WIDGET (menu), &menu_req);
|
&req, NULL);
|
||||||
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
|
||||||
|
&menu_req, NULL);
|
||||||
|
|
||||||
screen = gtk_widget_get_screen (GTK_WIDGET (menu));
|
screen = gtk_widget_get_screen (GTK_WIDGET (menu));
|
||||||
monitor_num = gdk_screen_get_monitor_at_window (screen,
|
monitor_num = gdk_screen_get_monitor_at_window (screen,
|
||||||
gtk_widget_get_window (priv->arrow_button));
|
gtk_widget_get_window (priv->arrow_button));
|
||||||
@ -3322,8 +3325,8 @@ toolbar_content_size_request (ToolbarContent *content,
|
|||||||
GtkToolbar *toolbar,
|
GtkToolbar *toolbar,
|
||||||
GtkRequisition *requisition)
|
GtkRequisition *requisition)
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (GTK_WIDGET (content->item),
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (content->item),
|
||||||
requisition);
|
requisition, NULL);
|
||||||
if (content->is_placeholder &&
|
if (content->is_placeholder &&
|
||||||
content->disappearing)
|
content->disappearing)
|
||||||
{
|
{
|
||||||
|
@ -22,12 +22,14 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "gtktoolitem.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "gtktoolitem.h"
|
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
#include "gtktoolshell.h"
|
#include "gtktoolshell.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
#include "gtkseparatormenuitem.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
#include "gtkactivatable.h"
|
#include "gtkactivatable.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
@ -500,7 +502,8 @@ gtk_tool_item_size_request (GtkWidget *widget,
|
|||||||
child = gtk_bin_get_child (GTK_BIN (widget));
|
child = gtk_bin_get_child (GTK_BIN (widget));
|
||||||
if (child && gtk_widget_get_visible (child))
|
if (child && gtk_widget_get_visible (child))
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (child, requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
|
||||||
|
requisition, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -554,7 +554,8 @@ gtk_tool_item_group_size_request (GtkWidget *widget,
|
|||||||
|
|
||||||
if (priv->children && gtk_tool_item_group_get_label_widget (group))
|
if (priv->children && gtk_tool_item_group_get_label_widget (group))
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (priv->header, requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->header),
|
||||||
|
requisition, NULL);
|
||||||
gtk_widget_show (priv->header);
|
gtk_widget_show (priv->header);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -687,7 +688,8 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
|
|||||||
GtkRequisition req = {0, 0};
|
GtkRequisition req = {0, 0};
|
||||||
guint width;
|
guint width;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (child->item), &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->item),
|
||||||
|
&req, NULL);
|
||||||
|
|
||||||
width = udiv (req.width, item_size.width);
|
width = udiv (req.width, item_size.width);
|
||||||
col += width;
|
col += width;
|
||||||
@ -745,7 +747,8 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
|
|||||||
GtkRequisition req = {0, 0};
|
GtkRequisition req = {0, 0};
|
||||||
guint width;
|
guint width;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (child->item), &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->item),
|
||||||
|
&req, NULL);
|
||||||
|
|
||||||
width = udiv (req.width, item_size.width);
|
width = udiv (req.width, item_size.width);
|
||||||
|
|
||||||
@ -800,7 +803,8 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
|
|||||||
GtkRequisition req = {0, 0};
|
GtkRequisition req = {0, 0};
|
||||||
guint width;
|
guint width;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (child->item), &req);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->item),
|
||||||
|
&req, NULL);
|
||||||
|
|
||||||
width = udiv (req.width, item_size.width);
|
width = udiv (req.width, item_size.width);
|
||||||
col += width;
|
col += width;
|
||||||
@ -832,7 +836,8 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkRequisition child_requisition;
|
GtkRequisition child_requisition;
|
||||||
|
|
||||||
gtk_widget_size_request (priv->header, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->header),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
if (GTK_ORIENTATION_VERTICAL == orientation)
|
if (GTK_ORIENTATION_VERTICAL == orientation)
|
||||||
inquery->height += child_requisition.height;
|
inquery->height += child_requisition.height;
|
||||||
@ -882,7 +887,8 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget,
|
|||||||
/* place the header widget */
|
/* place the header widget */
|
||||||
if (gtk_widget_get_visible (priv->header))
|
if (gtk_widget_get_visible (priv->header))
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (priv->header, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->header),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
if (GTK_ORIENTATION_VERTICAL == orientation)
|
if (GTK_ORIENTATION_VERTICAL == orientation)
|
||||||
{
|
{
|
||||||
@ -966,7 +972,8 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget,
|
|||||||
|
|
||||||
if (!child->homogeneous)
|
if (!child->homogeneous)
|
||||||
{
|
{
|
||||||
gtk_widget_size_request (GTK_WIDGET (child->item), &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->item),
|
||||||
|
&child_requisition, NULL);
|
||||||
child_requisition.width = MIN (child_requisition.width, item_area.width);
|
child_requisition.width = MIN (child_requisition.width, item_area.width);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2297,7 +2304,8 @@ _gtk_tool_item_group_item_size_request (GtkToolItemGroup *group,
|
|||||||
if (!child->homogeneous && child->expand)
|
if (!child->homogeneous && child->expand)
|
||||||
new_row = TRUE;
|
new_row = TRUE;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (child->item), &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->item),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
if (!homogeneous_only || child->homogeneous)
|
if (!homogeneous_only || child->homogeneous)
|
||||||
item_size->width = MAX (item_size->width, child_requisition.width);
|
item_size->width = MAX (item_size->width, child_requisition.width);
|
||||||
@ -2383,7 +2391,8 @@ _gtk_tool_item_group_get_size_for_limit (GtkToolItemGroup *group,
|
|||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (group), &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (group),
|
||||||
|
&requisition, NULL);
|
||||||
|
|
||||||
if (!priv->collapsed || priv->animation_timeout)
|
if (!priv->collapsed || priv->animation_timeout)
|
||||||
{
|
{
|
||||||
|
@ -365,7 +365,8 @@ gtk_tool_palette_size_request (GtkWidget *widget,
|
|||||||
if (!group->widget)
|
if (!group->widget)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (group->widget), &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (group->widget),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation)
|
if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation)
|
||||||
{
|
{
|
||||||
|
@ -21,10 +21,11 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "gtktooltip.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "gtktooltip.h"
|
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkwindow.h"
|
#include "gtkwindow.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
@ -32,6 +33,7 @@
|
|||||||
#include "gtkimage.h"
|
#include "gtkimage.h"
|
||||||
#include "gtkhbox.h"
|
#include "gtkhbox.h"
|
||||||
#include "gtkalignment.h"
|
#include "gtkalignment.h"
|
||||||
|
#include "gtksizerequest.h"
|
||||||
|
|
||||||
|
|
||||||
#undef DEBUG_TOOLTIP
|
#undef DEBUG_TOOLTIP
|
||||||
@ -937,7 +939,8 @@ gtk_tooltip_position (GtkTooltip *tooltip,
|
|||||||
|
|
||||||
screen = gtk_widget_get_screen (new_tooltip_widget);
|
screen = gtk_widget_get_screen (new_tooltip_widget);
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (tooltip->current_window), &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (tooltip->current_window),
|
||||||
|
&requisition, NULL);
|
||||||
|
|
||||||
monitor_num = gdk_screen_get_monitor_at_point (screen,
|
monitor_num = gdk_screen_get_monitor_at_point (screen,
|
||||||
tooltip->last_x,
|
tooltip->last_x,
|
||||||
|
@ -1972,8 +1972,9 @@ gtk_tree_view_size_request_columns (GtkTreeView *tree_view)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
column = list->data;
|
column = list->data;
|
||||||
|
|
||||||
gtk_widget_size_request (column->button, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (column->button),
|
||||||
|
&requisition, NULL);
|
||||||
column->button_request = requisition.width;
|
column->button_request = requisition.width;
|
||||||
tree_view->priv->header_height = MAX (tree_view->priv->header_height, requisition.height);
|
tree_view->priv->header_height = MAX (tree_view->priv->header_height, requisition.height);
|
||||||
}
|
}
|
||||||
@ -2066,7 +2067,8 @@ gtk_tree_view_size_request (GtkWidget *widget,
|
|||||||
tmp_list = tmp_list->next;
|
tmp_list = tmp_list->next;
|
||||||
|
|
||||||
if (gtk_widget_get_visible (child->widget))
|
if (gtk_widget_get_visible (child->widget))
|
||||||
gtk_widget_size_request (child->widget, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
||||||
|
&child_requisition, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6189,7 +6191,8 @@ validate_visible_area (GtkTreeView *tree_view)
|
|||||||
* same when we get our next size_allocate. If we don't do this, we'll be
|
* same when we get our next size_allocate. If we don't do this, we'll be
|
||||||
* in an inconsistent state if we call top_row_to_dy. */
|
* in an inconsistent state if we call top_row_to_dy. */
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (tree_view), &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (tree_view),
|
||||||
|
&requisition, NULL);
|
||||||
tree_view->priv->hadjustment->upper = MAX (tree_view->priv->hadjustment->upper, (gfloat)requisition.width);
|
tree_view->priv->hadjustment->upper = MAX (tree_view->priv->hadjustment->upper, (gfloat)requisition.width);
|
||||||
tree_view->priv->vadjustment->upper = MAX (tree_view->priv->vadjustment->upper, (gfloat)requisition.height);
|
tree_view->priv->vadjustment->upper = MAX (tree_view->priv->vadjustment->upper, (gfloat)requisition.height);
|
||||||
gtk_adjustment_changed (tree_view->priv->hadjustment);
|
gtk_adjustment_changed (tree_view->priv->hadjustment);
|
||||||
@ -6377,7 +6380,8 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize)
|
|||||||
* same when we get our next size_allocate. If we don't do this, we'll be
|
* same when we get our next size_allocate. If we don't do this, we'll be
|
||||||
* in an inconsistent state when we call top_row_to_dy. */
|
* in an inconsistent state when we call top_row_to_dy. */
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (tree_view), &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (tree_view),
|
||||||
|
&requisition, NULL);
|
||||||
tree_view->priv->hadjustment->upper = MAX (tree_view->priv->hadjustment->upper, (gfloat)requisition.width);
|
tree_view->priv->hadjustment->upper = MAX (tree_view->priv->hadjustment->upper, (gfloat)requisition.width);
|
||||||
tree_view->priv->vadjustment->upper = MAX (tree_view->priv->vadjustment->upper, (gfloat)requisition.height);
|
tree_view->priv->vadjustment->upper = MAX (tree_view->priv->vadjustment->upper, (gfloat)requisition.height);
|
||||||
gtk_adjustment_changed (tree_view->priv->hadjustment);
|
gtk_adjustment_changed (tree_view->priv->hadjustment);
|
||||||
@ -6440,7 +6444,8 @@ do_presize_handler (GtkTreeView *tree_view)
|
|||||||
{
|
{
|
||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (tree_view), &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (tree_view),
|
||||||
|
&requisition, NULL);
|
||||||
|
|
||||||
tree_view->priv->hadjustment->upper = MAX (tree_view->priv->hadjustment->upper, (gfloat)requisition.width);
|
tree_view->priv->hadjustment->upper = MAX (tree_view->priv->hadjustment->upper, (gfloat)requisition.width);
|
||||||
tree_view->priv->vadjustment->upper = MAX (tree_view->priv->vadjustment->upper, (gfloat)requisition.height);
|
tree_view->priv->vadjustment->upper = MAX (tree_view->priv->vadjustment->upper, (gfloat)requisition.height);
|
||||||
@ -14271,7 +14276,8 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view,
|
|||||||
gdk_drawable_get_size (tree_window,
|
gdk_drawable_get_size (tree_window,
|
||||||
&tree_width,
|
&tree_width,
|
||||||
&tree_height);
|
&tree_height);
|
||||||
gtk_widget_size_request (search_dialog, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (search_dialog),
|
||||||
|
&requisition, NULL);
|
||||||
|
|
||||||
if (tree_x + tree_width > gdk_screen_get_width (screen))
|
if (tree_x + tree_width > gdk_screen_get_width (screen))
|
||||||
x = gdk_screen_get_width (screen) - requisition.width;
|
x = gdk_screen_get_width (screen) - requisition.width;
|
||||||
@ -14888,7 +14894,8 @@ gtk_tree_view_real_start_editing (GtkTreeView *tree_view,
|
|||||||
gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE);
|
gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE);
|
||||||
cell_area->y += pre_val - (int)tree_view->priv->vadjustment->value;
|
cell_area->y += pre_val - (int)tree_view->priv->vadjustment->value;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (cell_editable), &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (cell_editable),
|
||||||
|
&requisition, NULL);
|
||||||
|
|
||||||
GTK_TREE_VIEW_SET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS);
|
GTK_TREE_VIEW_SET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS);
|
||||||
|
|
||||||
|
@ -8370,7 +8370,7 @@ gtk_widget_set_size_request (GtkWidget *widget,
|
|||||||
* @height indicates that that dimension has not been set explicitly
|
* @height indicates that that dimension has not been set explicitly
|
||||||
* and the natural requisition of the widget will be used intead. See
|
* and the natural requisition of the widget will be used intead. See
|
||||||
* gtk_widget_set_size_request(). To get the size a widget will
|
* gtk_widget_set_size_request(). To get the size a widget will
|
||||||
* actually use, call gtk_widget_size_request() instead of
|
* actually request, call gtk_size_request_get_size() instead of
|
||||||
* this function.
|
* this function.
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
|
@ -189,7 +189,8 @@ gtk_win32_embed_widget_realize (GtkWidget *widget)
|
|||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
GtkAllocation allocation = { 0, 0, 200, 200 };
|
GtkAllocation allocation = { 0, 0, 200, 200 };
|
||||||
|
|
||||||
gtk_widget_size_request (widget, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
|
||||||
|
&requisition, NULL);
|
||||||
if (requisition.width || requisition.height)
|
if (requisition.width || requisition.height)
|
||||||
{
|
{
|
||||||
/* non-empty window */
|
/* non-empty window */
|
||||||
|
@ -4828,7 +4828,8 @@ gtk_window_realize (GtkWidget *widget)
|
|||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
GtkAllocation allocation = { 0, 0, 200, 200 };
|
GtkAllocation allocation = { 0, 0, 200, 200 };
|
||||||
|
|
||||||
gtk_widget_size_request (widget, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
|
||||||
|
&requisition, NULL);
|
||||||
if (requisition.width || requisition.height)
|
if (requisition.width || requisition.height)
|
||||||
{
|
{
|
||||||
/* non-empty window */
|
/* non-empty window */
|
||||||
@ -6032,8 +6033,9 @@ gtk_window_compute_configure_request (GtkWindow *window,
|
|||||||
widget = GTK_WIDGET (window);
|
widget = GTK_WIDGET (window);
|
||||||
|
|
||||||
screen = gtk_window_check_screen (window);
|
screen = gtk_window_check_screen (window);
|
||||||
|
|
||||||
gtk_widget_size_request (widget, NULL);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
|
||||||
|
NULL, NULL);
|
||||||
gtk_window_compute_configure_request_size (window, (guint *)&w, (guint *)&h);
|
gtk_window_compute_configure_request_size (window, (guint *)&w, (guint *)&h);
|
||||||
|
|
||||||
gtk_window_compute_hints (window, &new_geometry, &new_flags);
|
gtk_window_compute_hints (window, &new_geometry, &new_flags);
|
||||||
@ -6711,8 +6713,8 @@ gtk_window_constrain_size (GtkWindow *window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Compute the set of geometry hints and flags for a window
|
/* Compute the set of geometry hints and flags for a window
|
||||||
* based on the application set geometry, and requisiition
|
* based on the application set geometry, and requisition
|
||||||
* of the window. gtk_widget_size_request() must have been
|
* of the window. gtk_size_request_get_size() must have been
|
||||||
* called first.
|
* called first.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
@ -1695,8 +1695,9 @@ on_status_toplevel_configure (GtkWidget *toplevel,
|
|||||||
|
|
||||||
gdk_window_get_frame_extents (gtk_widget_get_window (toplevel),
|
gdk_window_get_frame_extents (gtk_widget_get_window (toplevel),
|
||||||
&rect);
|
&rect);
|
||||||
gtk_widget_size_request (status_window->window, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (status_window->window),
|
||||||
|
&requisition, NULL);
|
||||||
|
|
||||||
if (rect.y + rect.height + requisition.height < height)
|
if (rect.y + rect.height + requisition.height < height)
|
||||||
y = rect.y + rect.height;
|
y = rect.y + rect.height;
|
||||||
else
|
else
|
||||||
|
@ -479,7 +479,8 @@ gtk_offscreen_box_size_request (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkRequisition child_requisition;
|
GtkRequisition child_requisition;
|
||||||
|
|
||||||
gtk_widget_size_request (offscreen_box->child1, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (offscreen_box->child1),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
w = MAX (w, CHILD1_SIZE_SCALE * child_requisition.width);
|
w = MAX (w, CHILD1_SIZE_SCALE * child_requisition.width);
|
||||||
h += CHILD1_SIZE_SCALE * child_requisition.height;
|
h += CHILD1_SIZE_SCALE * child_requisition.height;
|
||||||
@ -489,7 +490,8 @@ gtk_offscreen_box_size_request (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkRequisition child_requisition;
|
GtkRequisition child_requisition;
|
||||||
|
|
||||||
gtk_widget_size_request (offscreen_box->child2, &child_requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (offscreen_box->child2),
|
||||||
|
&child_requisition, NULL);
|
||||||
|
|
||||||
w = MAX (w, CHILD2_SIZE_SCALE * child_requisition.width);
|
w = MAX (w, CHILD2_SIZE_SCALE * child_requisition.width);
|
||||||
h += CHILD2_SIZE_SCALE * child_requisition.height;
|
h += CHILD2_SIZE_SCALE * child_requisition.height;
|
||||||
|
@ -2475,7 +2475,8 @@ create_rotated_text (GtkWidget *widget)
|
|||||||
gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (window)));
|
gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (window)));
|
||||||
|
|
||||||
gtk_widget_set_size_request (drawing_area, DEFAULT_TEXT_RADIUS * 2, DEFAULT_TEXT_RADIUS * 2);
|
gtk_widget_set_size_request (drawing_area, DEFAULT_TEXT_RADIUS * 2, DEFAULT_TEXT_RADIUS * 2);
|
||||||
gtk_widget_size_request (window, &requisition);
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (window),
|
||||||
|
&requisition, NULL);
|
||||||
gtk_widget_set_size_request (drawing_area, -1, -1);
|
gtk_widget_set_size_request (drawing_area, -1, -1);
|
||||||
gtk_window_resize (GTK_WINDOW (window), requisition.width, requisition.height);
|
gtk_window_resize (GTK_WINDOW (window), requisition.width, requisition.height);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user