Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick.Controls 1.0
- import QtQuick 2.0
- import Ubuntu.Components 1.1
- import com.canonical.Oxide 1.0
- import QtQuick.Controls.Styles 1.2
- import QtQuick.Window 2.0
- /*!
- \brief MainView with a Label and Button elements.
- */
- MainView {
- // objectName for functional testing purposes (autopilot-qt5)
- objectName: "mainView"
- // Note! applicationName needs to match the "name" field of the click manifest
- applicationName: "com.ubuntu.developer.mkamenjak77.bugapp"
- /*
- This property enables the application to change orientation
- when the device is rotated. The default is false.
- */
- //automaticOrientation: true
- // Removes the old toolbar and enables new features of the new header.
- useDeprecatedToolbar: false
- width: Screen.width
- height: Screen.height
- Page {
- Column {
- spacing: units.gu(1)
- height:parent.height
- width:parent.width
- anchors {
- fill: parent
- }
- /*
- Label {
- id: label
- objectName: "label"
- text: i18n.tr("Hello..")
- }*/
- Row{
- height:parent.height
- Column
- {
- TextArea {
- id:textfield;
- text: "http://google.com"
- width: units.gu(4)
- height: units.gu(75)
- contentWidth: units.gu(1.5)
- autoSize: true
- maximumLineCount: 0
- Keys.onReturnPressed: {
- if (textfield.text.substring(0, 7) != "http://")
- textfield.text = "http://" + textfield.text;
- webview.url = textfield.text
- }
- }
- Button {
- objectName: "button"
- width: units.gu(4)/*
- style: ButtonStyle {
- background: Rectangle {
- implicitWidth: 100
- implicitHeight: 25
- border.width: control.activeFocus ? 2 : 1
- border.color: "#888"
- radius: 4
- gradient: Gradient {
- GradientStop { position: 0 ; color: control.pressed ? "#ccc" : "#eee" }
- GradientStop { position: 1 ; color: control.pressed ? "#aaa" : "#ccc" }
- }
- }
- }*/
- text: i18n.tr("Osvježi")
- onClicked: {
- webview.reload()
- }
- }
- Button {
- objectName: "button"
- width: units.gu(4)/*
- style: ButtonStyle {
- background: Rectangle {
- implicitWidth: 100
- implicitHeight: 25
- border.width: control.activeFocus ? 2 : 1
- border.color: "#888"
- radius: 4
- gradient: Gradient {
- GradientStop { position: 0 ; color: control.pressed ? "#ccc" : "#eee" }
- GradientStop { position: 1 ; color: control.pressed ? "#aaa" : "#ccc" }
- }
- }
- }*/
- text: i18n.tr("Naprijed")
- onClicked: {
- webview.goForward()
- }
- }
- Button {
- objectName: "button"
- width: units.gu(4)/*
- style: ButtonStyle {
- background: Rectangle {
- implicitWidth: 100
- implicitHeight: 25
- border.width: control.activeFocus ? 2 : 1
- border.color: "#888"
- radius: 4
- gradient: Gradient {
- GradientStop { position: 0 ; color: control.pressed ? "#ccc" : "#eee" }
- GradientStop { position: 1 ; color: control.pressed ? "#aaa" : "#ccc" }
- }
- }
- }*/
- text: i18n.tr("Natrag")
- onClicked: {
- webview.goBack()
- }
- }
- }
- WebView {
- id: webview
- width: parent.width
- height: parent.height
- //onLoadFinished: area.contentY = -1 // workaround to force webview repaint
- Component.onCompleted: {
- url = textfield.text
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement