GwyShrinkWrap

GwyShrinkWrap — Container shrinking natural sizes to minimum

Functions

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkBin
                    ╰── GwyShrinkWrap

Implemented Interfaces

GwyShrinkWrap implements AtkImplementorIface and GtkBuildable.

Includes

#include <libgwyui/gwyui.h>

Description

GwyShrinkWrap is a simple wrapper container widget which requests its child's minimum size as the natural size, essentially making it never request more than the minimum size. It is mainly useful for corner cases such as ellipsised labels, which have small minimum size but the natural size corresponds to the full text. This causes containers to give them a lot of space they do not need and can also make default window sizes unnecessarily large.

Child widgets that trade width for height may not behave reasonably inside because the shrinking breaks the trading.

Functions

gwy_shrink_wrap_new()

GtkWidget *
gwy_shrink_wrap_new (GtkSizeGroupMode mode);

Creates a new shrink-wrap container.

The mode is given as GtkSizeGroupMode because it has the same logic.

Parameters

mode

In which directions the shrinking should occur.

 

Returns

The new shrink-wrap widget.


gwy_shrink_wrap_set_mode()

void
gwy_shrink_wrap_set_mode (GwyShrinkWrap *shrinkwrap,
                          GtkSizeGroupMode mode);

Sets the direction in which a shrink-wrap container shrinks its child.

Parameters

shrinkwrap

A shrink-wrap container.

 

mode

In which directions the shrinking should occur.

 

gwy_shrink_wrap_get_mode()

GtkSizeGroupMode
gwy_shrink_wrap_get_mode (GwyShrinkWrap *shrinkwrap);

Reports the direction in which a shrink-wrap container shrinks its child.

Parameters

shrinkwrap

A shrink-wrap container.

 

Returns

The shrinking mode.

Types and Values

struct GwyShrinkWrap

struct GwyShrinkWrap;

struct GwyShrinkWrapClass

struct GwyShrinkWrapClass {
    GtkBinClass parent_class;
};