LocationBarController QML Type

Bridge for location bar autohide functionality More...

Import Statement: import com.canonical.Oxide 1.15
Since: OxideQt 1.5
Instantiates: OxideQQuickLocationBarController

Properties

Methods

Detailed Description

LocationBarContoller provides a mechanism to allow applications to provide location bar autohide functionality. It assumes that the location bar is at the top of the view, and overlays the view when fully revealed.

LocationBarController works by calculating a position that the application should use to position its location bar (via the offset property), and by applying an appropriate offset to the web content and input events.

When in auto mode, this API allows applications to gradually reveal or hide their location bar as content is scrolled with touch gestures. It does this by consuming scroll gestures and calculating new location bar and content positions (actually, this calculation is done by the renderer compositor).

The application must specify the fully revealed height of its location bar by setting the height property.

Property Documentation

animated : bool

Whether transitions between different modes should be animated. The default value is true.

Note: Transitions will only be animated if the web process hasn't crashed and isn't hung.

This QML property was introduced in OxideQt 1.7.


contentOffset : real

This is the offset of the web content and input events, calculated by Oxide.

Possible values for this will range from 0 (fully hidden) to height (fully revealed).


height : real

The maximum height of the application's location bar. The default is 0.

Setting this to 0 effectively disables this API.


mode : enumeration

The operational mode of the LocationBarController. Possible values are:

ConstantDescription
LocationBarController.ModeAutoAuto hide and auto reveal of the location bar will be enabled, although there are several conditions that can override this to disable auto-hide or auto-reveal functionality.
LocationBarController.ModeShownThe location bar should be fully revealed.
LocationBarController.ModeHiddenThe location bar should be fully hidden.

The default is ModeAuto.


offset : real

This is the offset for the location bar, calculated by Oxide. The application should use the value of this to position its location bar accordingly.

Possible values for this will range from 0 (fully revealed) to -height (fully hidden).

The application should update the position of its location bar synchronously to avoid tearing.


Method Documentation

void hide(bool animate)

In auto mode, calling this will request that the location bar is hidden. Once it is hidden, auto reveal will continue functioning as normal.

The application can control whether the transition is animated by setting the animate argument appropriately.

Calling this in a mode other than auto or if auto-hide has been disabled by Oxide will have no effect.

This QML method was introduced in OxideQt 1.7.


void show(bool animate)

In auto mode, calling this will request that the location bar is revealed. Once it is revealed, auto hide will continue functioning as normal.

The application can control whether the transition is animated by setting the animate argument appropriately.

Calling this in a mode other than auto or if auto-reveal has been disabled by Oxide will have no effect.

This QML method was introduced in OxideQt 1.7.