mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-04 09:40:19 +00:00
viewport: Use a convenience function
That function looks longer than not using it, but we'll need it in the next commit.
This commit is contained in:
parent
2e2e3a5e24
commit
b261fc64e2
@ -29,10 +29,11 @@
|
|||||||
#include "gtkadjustment.h"
|
#include "gtkadjustment.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
|
#include "gtkpixelcacheprivate.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkscrollable.h"
|
#include "gtkscrollable.h"
|
||||||
#include "gtktypebuiltins.h"
|
#include "gtktypebuiltins.h"
|
||||||
#include "gtkpixelcacheprivate.h"
|
#include "gtkwidgetprivate.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1050,10 +1051,11 @@ gtk_viewport_get_preferred_size (GtkWidget *widget,
|
|||||||
|
|
||||||
if (child && gtk_widget_get_visible (child))
|
if (child && gtk_widget_get_visible (child))
|
||||||
{
|
{
|
||||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
_gtk_widget_get_preferred_size_for_size (child,
|
||||||
gtk_widget_get_preferred_width (child, &child_min, &child_nat);
|
orientation,
|
||||||
else
|
-1,
|
||||||
gtk_widget_get_preferred_height (child, &child_min, &child_nat);
|
&child_min, &child_nat,
|
||||||
|
NULL, NULL);
|
||||||
|
|
||||||
minimum += child_min;
|
minimum += child_min;
|
||||||
natural += child_nat;
|
natural += child_nat;
|
||||||
|
Loading…
Reference in New Issue
Block a user