Advertisement
Guest User

Untitled

a guest
Jun 6th, 2013
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
q/kdb+ 1.87 KB | None | 0 0
  1. // Default empty project template
  2. import bb.cascades 1.0
  3.  
  4. // creates one page with a label
  5. Page {
  6.     Container {
  7.         id: containerID
  8.         topPadding: 20.0
  9.         layout: StackLayout {
  10.  
  11.         }
  12.         background: Color.create("#262626")
  13.        
  14.         Container {
  15.             layout: DockLayout {
  16.  
  17.             }
  18.             horizontalAlignment: HorizontalAlignment.Center
  19.             ImageView {
  20.                 id: night
  21.                 imageSource: "asset:///images/night.jpg"
  22.                 horizontalAlignment: HorizontalAlignment.Center
  23.  
  24.             }
  25.             ImageView {
  26.                 id: day
  27.                 imageSource: "asset:///images/day.jpg"
  28.                 opacity: 0.0
  29.                 horizontalAlignment: HorizontalAlignment.Center
  30.  
  31.             }
  32.  
  33.         }
  34.         Container {
  35.             layout: StackLayout {
  36.                 orientation: LayoutOrientation.LeftToRight
  37.  
  38.             }
  39.             topPadding: 25.0
  40.             bottomPadding: 25.0
  41.             leftPadding: 20.0
  42.             rightPadding: 20.0
  43.             ImageView {
  44.                 imageSource: "asset:///images/moon.png"
  45.                 horizontalAlignment: HorizontalAlignment.Center
  46.  
  47.             }
  48.             Slider {
  49.                 leftMargin: 20.0
  50.                 rightMargin: 20.0
  51.                 horizontalAlignment: HorizontalAlignment.Fill
  52.                 layoutProperties: StackLayoutProperties {
  53.                     spaceQuota: 1.0
  54.  
  55.                 }
  56.                 onImmediateValueChanged: {
  57.                    // This is where the day-night opacity value is done.
  58.                     day.opacity = immediateValue;
  59.                 }
  60.  
  61.             }
  62.             ImageView {
  63.                 imageSource: "asset:///images/sun.png"
  64.                 horizontalAlignment: HorizontalAlignment.Center
  65.  
  66.             }
  67.  
  68.         }
  69.  
  70.     }
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement