Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual

Page 225

Advertising
background image

KTD-S0057-I

Page 221 Linux® Programming Examples (DebianTM)


KTAM3874/pITX Software Guide


}

return

url

}

url: fixUrl (webBrowser.urlString)

smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions

focus:

true

onAlert: console.log (message)

function doZoom (zoom, centerX, centerY)

{

if

(centerX)

{

var sc = zoom*contentsScale

scaleAnim.to

=

sc

flickVX.from

=

flickable.contentX

flickVX.to = Math.max (0, Math.min (centerX - flickable.width / 2, webView.width * sc - flickable.width))

finalX.value

=

flickVX.to

flickVY.from

=

flickable.contentY

flickVY.to = Math.max (0, Math.min (centerY - flickable.height / 2, webView.height * sc - flickable.height))

finalY.value

=

flickVY.to

quickZoom.start

()

}

}

Keys.onLeftPressed: webView.contentsScale -= 0.1

Keys.onRightPressed: webView.contentsScale += 0.1

preferredWidth:

flickable.width

preferredHeight:

flickable.height

contentsScale:

1

onContentsSizeChanged:

{

// zoom out

contentsScale = Math.min (1, flickable.width / contentsSize.width)

}

onUrlChanged:

{

// got to topleft

flickable.contentX = 0

flickable.contentY = 0

if (url != null)

{

header.editUrl

=

url.toString

()

}

}

onDoubleClick:

{

if (! heuristicZoom (clickX, clickY, 2.5))

{

var zf = flickable.width / contentsSize.width

if (zf >= contentsScale)

zf = 2.0 * contentsScale // zoom in (else zooming out)

Advertising
This manual is related to the following products: