FirstPage.qml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import QtQuick 2.0
  2. import Sailfish.Silica 1.0
  3. import QtWebKit 3.0
  4. Page {
  5. id: page
  6. // The effective value will be restricted by ApplicationWindow.allowedOrientations
  7. allowedOrientations: Orientation.All
  8. // To enable PullDownMenu, place our content in a SilicaFlickable
  9. SilicaWebView {
  10. id: webView
  11. anchors.fill: parent
  12. quickScroll: true
  13. quickScrollAnimating: true
  14. _cookiesEnabled: true
  15. antialiasing: true
  16. VerticalScrollDecorator {}
  17. // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView
  18. PullDownMenu {
  19. // MenuItem {
  20. // text: qsTr("Show Page 2")
  21. // onClicked: pageStack.push(Qt.resolvedUrl("SecondPage.qml"))
  22. // }
  23. }
  24. //header: navarea
  25. anchors {
  26. top: parent.top
  27. left: parent.left
  28. right: parent.right
  29. bottom: navarea.top
  30. }
  31. url: "https://m.onvista.de"
  32. }
  33. Rectangle {
  34. id: navarea
  35. height: Theme.iconSizeLarge
  36. width: parent.width
  37. antialiasing: true
  38. color: Theme.secondaryColor
  39. opacity: 100
  40. anchors.top: webView.bottom
  41. IconButton
  42. {
  43. id: navback
  44. icon.source: "image://theme/icon-m-back?" + (pressed
  45. ? Theme.highlightColor
  46. : Theme.primaryColor)
  47. onClicked: webView.goBack()
  48. }
  49. IconButton
  50. {
  51. id: navhome
  52. icon.source: Qt.resolvedUrl("fallbackFavIcon.png")
  53. anchors.left: navback.right
  54. // wie kommen wir zurück auf die hauptseite?
  55. onClicked: webView.loadHtml(webView.url)
  56. }
  57. IconButton
  58. {
  59. id: navforward
  60. icon.source: "image://theme/icon-m-forward?" + (pressed
  61. ? Theme.highlightColor
  62. : Theme.primaryColor)
  63. anchors.left: navhome.right
  64. onClicked: webView.goForward()
  65. }
  66. Label
  67. {
  68. id: navlabel
  69. text: webView.title
  70. anchors.left: navforward.right
  71. }
  72. }
  73. }