Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 4.20 KB | None | 0 0
  1. >>>>>>>>>>main.qml<<<<<<<<<<<<<<
  2.  
  3.  
  4. property string activeLanguage : "de"
  5.  
  6. areas[i].name_en = areas[i].name_en.replace(/\\u00AD/g, '\u00AD');
  7. areas[i].name_en = areas[i].name_en.replace(/\s+and\s+/g, ' & ');
  8.  
  9.  
  10. >>>>>>>>>>>>>Menubar.qml<<<<<<<<<<<
  11.  
  12.         Item {
  13.             id : deToggle
  14.  
  15.             property bool active : true
  16.  
  17.             anchors.horizontalCenter : parent.horizontalCenter
  18.  
  19.             width  : 78
  20.             height : 78
  21.  
  22.             TapArea {
  23.                 id : deToggleTapArea
  24.  
  25.                 anchors.fill : parent
  26.  
  27.                 mouseEnabled : true
  28.                 onTap : {
  29.                     portrait_.timerInactive.restart()
  30.                     deToggle.active = true
  31.                     enToggle.active = false
  32.                     template_.activeLanguage = "de";
  33.                 }
  34.             }
  35.  
  36.             Image {
  37.                 id : deToggleIconOn
  38.  
  39.                 visible : deToggle.active
  40.  
  41.                 anchors.centerIn : parent
  42.                 source : "germanOn.png"
  43.             }
  44.  
  45.             Image {
  46.                 id : deToggleIconOff
  47.  
  48.                 visible : !deToggle.active
  49.  
  50.                 anchors.centerIn : parent
  51.                 source : "germanOff.png"
  52.             }
  53.         }
  54.  
  55.         Item {
  56.             id : enToggle
  57.  
  58.             property bool active : false
  59.  
  60.             anchors.horizontalCenter : parent.horizontalCenter
  61.  
  62.             width  : 78
  63.             height : 78
  64.  
  65.             TapArea {
  66.                 id : enToggleTapArea
  67.  
  68.                 anchors.fill : parent
  69.  
  70.                 mouseEnabled : true
  71.                 onTap : {
  72.                     portrait_.timerInactive.restart()
  73.                     enToggle.active = true
  74.                     deToggle.active = false
  75.                     template_.activeLanguage = "en";
  76.                 }
  77.             }
  78.  
  79.             Image {
  80.                 id : enToggleIconOn
  81.  
  82.                 visible : enToggle.active
  83.  
  84.                 anchors.centerIn : parent
  85.                 source : "englishOn.png"
  86.             }
  87.  
  88.             Image {
  89.                 id : enToggleIconOff
  90.  
  91.                 visible : !enToggle.active
  92.  
  93.                 anchors.centerIn : parent
  94.                 source : "englishOff.png"
  95.             }
  96.         }
  97.  
  98. >>>>>>>>>>>Homescreen.qml<<<<<<<<<<<<<<<
  99.  
  100.         Text {
  101.             id : searchInput
  102.  
  103.             anchors {
  104.                 left   : parent.left
  105.                 verticalCenter : parent.verticalCenter
  106.                 leftMargin : 25
  107.             }
  108.  
  109.             color  : "#706f6f"
  110.             width  : 640
  111.  
  112.             text : {
  113.                 if (template_.activeLanguage === "de") {
  114.                     return "Nach Namen suchen ...";
  115.                 } else if (template_.activeLanguage === "en") {
  116.                     return "Search for Names ...";
  117.                 } else
  118.                     return "Nach Namen suchen ...";
  119.             }
  120.  
  121.             font.pixelSize : 32
  122.             font.family : "Lucida Sans Unicode"
  123.         }
  124.  
  125.     Text {
  126.         id : professionLabel
  127.  
  128.         anchors {
  129.             top : searchBar.bottom
  130.             horizontalCenter : parent.horizontalCenter
  131.             topMargin : 10
  132.         }
  133.  
  134.         color : "#706f6f"
  135.  
  136.         text : {
  137.             if (template_.activeLanguage === "de") {
  138.                 return "Fachgebiete";
  139.             } else if (template_.activeLanguage === "en") {
  140.                 return "Medical Fields";
  141.             } else
  142.                 return "Fachgebiete";
  143.         }
  144.  
  145.         font.pixelSize : 60
  146.         font.family : "Lucida Sans Unicode"
  147.         font.capitalization: Font.AllUppercase
  148.     }
  149.  
  150.  
  151.  
  152. >>>>>>>>>>>>>ProfessionDelegate.qml<<<<<<<<<<<<<<
  153.  
  154.     Text {
  155.         id : label
  156.  
  157.         text : modelData["name_" + template_.activeLanguage]
  158.  
  159.         color : "#706f6f"
  160.  
  161.         wrapMode: Text.Wrap
  162.         horizontalAlignment : Text.AlignHCenter
  163.  
  164.         anchors {
  165.             top : icon.bottom
  166.             horizontalCenter : parent.horizontalCenter
  167.             topMargin : 10
  168.         }
  169.  
  170.         width : parent.width - 20
  171.  
  172.         font.pixelSize : 16
  173.         font.family : "Lucida Sans Unicode"
  174.         font.capitalization: Font.AllUppercase
  175.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement