Advertisement
Guest User

meteo + parameter

a guest
Jun 3rd, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 4.30 KB | None | 0 0
  1.     Rectangle{
  2.         id:meteoContainer
  3.         x:35
  4.         y:35
  5.         width: 350
  6.         height: 200
  7.         color: "#243665"
  8.         opacity: 0
  9.         radius : 20
  10.         Rectangle {
  11.             id : hideButtoncontainer
  12.             width: 130
  13.             height : 25
  14.             x :(meteoContainer.width/2 - hideButton.width/2)
  15.             y : -hideButton.height -5
  16.             radius : 5
  17.             color: "#243665"
  18.  
  19.             Text {
  20.                 id: desaffichermeteo
  21.                 x: 8
  22.                 y: 2
  23.                 width: 105
  24.                 height: 25
  25.                 text: "Enlever météo"
  26.                 color: "white"
  27.             }
  28.             Image {
  29.                 id: upArrow
  30.                 source: "qrc:/Images/move-to-next.png"
  31.                 x : 105
  32.                 y : 0
  33.                 rotation: 270
  34.                 width: 25
  35.                 height: 25
  36.                 fillMode: Image.PreserveAspectFit
  37.  
  38.  
  39.             }
  40.         }
  41.  
  42.         Button{
  43.             id: hideButton
  44.             width: 130
  45.             height : 25
  46.             x :(meteoContainer.width/2 - hideButton.width/2)
  47.             y : -hideButton.height - 5
  48.             opacity: 0
  49.  
  50.  
  51.             /*Rectangle{
  52.                 radius : 10
  53.                 color:"#243665"
  54.                 opacity: 0.9
  55.             }*/
  56.  
  57.             onClicked:{
  58.                 animationOFFopacity.running = true;
  59.                 animationOFFx.running = true;
  60.                 animationOFFopacity2.running = true;
  61.  
  62.             }
  63.         }
  64.         WeatherAddon{
  65.             id:element
  66.         }
  67.         PropertyAnimation {
  68.             id: animationOFFx;
  69.             target: meteoContainer;
  70.             property: "y";
  71.             to: 35;
  72.             duration: 400
  73.         }
  74.         PropertyAnimation{
  75.             id : animationOFFopacity
  76.             target: meteoContainer
  77.             property: "opacity"
  78.             to : 0
  79.             duration: 200
  80.         }
  81.     }
  82.  
  83.  
  84.     Rectangle {
  85.         id: rectangleparameter
  86.         x: 35
  87.         y: 35
  88.         width: 350
  89.         height: 390
  90.         color: "#243665"
  91.         opacity: 0.9
  92.         radius : 20
  93.  
  94.         Keys.onPressed: {
  95.             if(event.key === Qt.Key_Enter){
  96.                 valider.validate();
  97.             }
  98.         }
  99.  
  100.         PropertyAnimation{
  101.             id : animationOFFopacity2
  102.             target: showButtoncontainer
  103.             property: "opacity"
  104.             to : 1
  105.             duration: 200
  106.         }
  107.  
  108.         PropertyAnimation{
  109.             id : animationONopacity2
  110.             target: showButtoncontainer
  111.             property: "opacity"
  112.             to : 0
  113.             duration: 200
  114.         }
  115.  
  116.         Rectangle {
  117.             id : showButtoncontainer
  118.             width: 75
  119.             height : 25
  120.             x :(rectangleparameter.width/2 - showButton.width/2)
  121.             y : rectangleparameter.height + 5
  122.             radius : 5
  123.             color: "#243665"
  124.  
  125.             Text {
  126.                 id: affichermeteo
  127.                 x: 8
  128.                 y: 2
  129.                 width: 50
  130.                 height: 25
  131.                 text: "météo"
  132.                 color: "white"
  133.             }
  134.             Image {
  135.                 id: downArrow
  136.                 source: "qrc:/Images/move-to-next.png"
  137.                 x : 50
  138.                 y : 0
  139.                 rotation: 90
  140.                 width: 25
  141.                 height: 25
  142.                 fillMode: Image.PreserveAspectFit
  143.  
  144.  
  145.             }
  146.         }
  147.  
  148.  
  149.         Button{
  150.             id: showButton
  151.             width: 75
  152.             height : 25
  153.             x :(rectangleparameter.width/2 - showButton.width/2)
  154.             y : rectangleparameter.height + 5
  155.             opacity : 0
  156.             onClicked:{
  157.                 animationONopacity.running = true;
  158.                 animationONx.running = true;
  159.                 animationONopacity2.running = true;
  160.             }
  161.         }
  162.  
  163.         PropertyAnimation {
  164.             id: animationONx;
  165.             target: meteoContainer;
  166.             property: "y";
  167.             to: 550;
  168.             duration: 400
  169.         }
  170.         PropertyAnimation{
  171.             id : animationONopacity
  172.             target: meteoContainer
  173.             property: "opacity"
  174.             to : 0.9
  175.             duration: 400
  176.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement