Java Reference
In-Depth Information
The useDefaultClose variable indicates whether to use a default close mecha-
nism or whether the close should be under the control of the developer. We have
chosen to implement our own close button so we will set this to false. The
default is true. When the application is “closed,” it actually docks back into the
browser page, if the page is still visible.
In our application, we use a ControlButton to close the application. There are
two important concepts here. One is that the ControlButton is only visible when
the application is not docked to the browser. Figure 9.5 shows the close button.
Figure 9.5
Close Button
Listing 9.6 shows the implementation of the close button.
Listing 9.6
Close Button
ControlButton {
translateY: bind gap/2
translateX: bind scene.width - 2 * gap
visible: bind not isBrowser
width: bind gap-6
height: bind gap-6
centerShape: Circle {
radius: bind (gap-8)/2;
fill: RadialGradient {
stops: [
Stop {
offset: 0.0
color: Color.WHITE
},
Stop {
offset: 1.0
continues
Search WWH ::




Custom Search