type=peephole layouts

<layout id="new_peephole" type="peephole"/>

The contents of a layouts with type=peephole specify the peephole layout manager methods that get invoked to generate() its contents, just like all other layout managers' layouts. However there's only one actual method, get(), which only actual code can use, hence there are no peephole layout manager methods that get executed from a theme file.

Therefore type=peephole layouts are empty, but they still must exist. A container's name always names a layout, so it must exist and be empty.

Creating type=peephole layouts

A container with a type=peephole creates a container that uses the peephole layout manager.

Initializing x::w::new_scrollable_peepholelayoutmanagers

    <container>
      <name>new_peephole</name>
      <type>peephole</type>
      <config>
         <factory>initpeephole</factory>
      </config>
    </container>

    <!-- -->

<factory id="initpeephole" type="factory">
  <container>
    <type>grid</type>
    <name>peepholed_container</name>
  </container>
</factory>

<layout id="peepholed_container" type="grid">

  <!-- -->

The config element is required, and must contain a factory. Other elements are optional, and they set non-default values of the x::w::new_scrollable_peepholelayoutmanager that creates the peephole container.

factory

Sets the x::w::new_scrollable_peepholelayoutmanager's factory.

<config>
  <factory>initpeephole</factory>
</config>

<!-- -->

<factory id="initpeephole" type="factory">
  <container>
    <name>peephole_contents</name>
    <type>grid</type>
  </container>
</factory>

The mandatory factory specifies the id of a type=factory factory. The factory must generate a single widget which becomes the peepholed widget. It is typically a container of its own.

width

Sets the x::w::new_scrollable_peepholelayoutmanager's width_algorithm value:

<config>
  <factory>initpeephole</factory>
  <width>
    <min>peepholemin</min>
    <preferred>peepholepref</preferred>
    <max>peepholemax</min>
  </width>
</config>

This sets width_algorithm to a x::w::dim_axis_arg value.

<config>
  <factory>initpeephole</factory>
  <width>
    <automatic />
  </width>
</config>

This sets width_algorithm to a peephole_algorithm::automatic value.

<config>
  <factory>initpeephole</factory>
  <width>
    <stretch_peephole />
  </width>
</config>

This sets width_algorithm to a peephole_algorithm::stretch_peephole value.

height

Sets the x::w::new_scrollable_peepholelayoutmanager's height_algorithm value:

<config>
  <factory>initpeephole</factory>
  <height>
    <min>peepholemin</min>
    <preferred>peepholepref</preferred>
    <max>peepholemax</min>
  </height>
</config>

This sets height_algorithm to a x::w::dim_axis_arg value.

<config>
  <factory>initpeephole</factory>
  <height>
    <automatic />
  </height>
</config>

This sets height_algorithm to a peephole_algorithm::automatic value.

<config>
  <factory>initpeephole</factory>
  <height>
    <stretch_peephole />
  </height>
</config>

This sets height_algorithm to a peephole_algorithm::stretch_peephole value.

horizontal_alignment

Sets the x::w::new_scrollable_peepholelayoutmanager's horizontal_alignment value:

<config>
  <factory>initpeephole</factory>
  <horizontal_alignment>left</horizontal_alignment>
</config>

This element specifies a x::w::halign value.

vertical_alignment

Sets the x::w::new_scrollable_peepholelayoutmanager's vertical_alignment value:

<config>
  <factory>initpeephole</factory>
  <vertical_alignment>top</vertical_alignment>
</config>

This element specifies a x::w::valign value.

scroll

Sets the x::w::new_scrollable_peepholelayoutmanager's scroll value:

<config>
  <factory>initpeephole</factory>
  <scroll>
    <centered />
  </scroll>
</config>

<config>
  <factory>initpeephole</factory>
  <scroll>
    <minimal />
  </scroll>
</config>

This element sets scroll to peephole_scroll::centered or peephole_scroll::minimal.

width_truncate and height_truncate

Sets the x::w::new_scrollable_peepholelayoutmanager's width_truncate or height_truncate value to true:

<config>
  <factory>initpeephole</factory>
  <width_truncate />
  <height_truncate />
</config>
horizontal_scrollbar and vertical_scrollbar

Sets the x::w::new_scrollable_peepholelayoutmanager's horizontal_scrollbar or vertical_scrollbar value:

<config>
  <factory>initpeephole</factory>
  <horizontal_scrollbar>never</horizontal_scrollbar>
  <vertical_scrollbar>never</vertical_scrollbar>
</config>

This sets the corresponding x::w::scrollbar_visibility value.

Note

Setting both of them to never results in the peephole layout manager's container getting created with a x::w::new_peepholelayoutmanager instead of a x::w::new_scrollable_peepholelayoutmanager.

appearance

Sets the x::w::new_scrollable_peepholelayoutmanager's appearance value:

<config>
  <factory>initpeephole</factory>
  <appearance>custom_peephole</appearance>
</config>

The value of the element specifies an appearance object of type=peephole. This element is ignored when peepholes get created without any scroll-bars (never visibility for both horizontal and vertical scroll-bar.