mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 23:56:29 +02:00
Tweaking test dialog and adding browser test
This commit is contained in:
parent
fd0c130dc2
commit
781abdd047
2 changed files with 59 additions and 26 deletions
45
interface/resources/qml/Browser.qml
Normal file
45
interface/resources/qml/Browser.qml
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
import QtQuick 2.3
|
||||||
|
import QtQuick.Controls 1.2
|
||||||
|
import QtQuick.Window 2.2
|
||||||
|
import QtQuick.Dialogs 1.2
|
||||||
|
import QtQuick.Controls.Styles 1.3
|
||||||
|
import QtWebKit 3.0
|
||||||
|
|
||||||
|
CustomDialog {
|
||||||
|
title: "Test Dlg"
|
||||||
|
id: testDialog
|
||||||
|
objectName: "Browser"
|
||||||
|
width: 1280
|
||||||
|
height: 720
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: clientArea
|
||||||
|
// The client area
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: parent.margins
|
||||||
|
anchors.topMargin: parent.topMargin
|
||||||
|
|
||||||
|
|
||||||
|
ScrollView {
|
||||||
|
anchors.fill: parent
|
||||||
|
WebView {
|
||||||
|
id: webview
|
||||||
|
url: "http://slashdot.org"
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
// This is the behavior, and it applies a NumberAnimation to any attempt to set the x property
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
*/
|
|
@ -4,34 +4,20 @@ import QtQuick.Window 2.2
|
||||||
import QtQuick.Dialogs 1.2
|
import QtQuick.Dialogs 1.2
|
||||||
import QtQuick.Controls.Styles 1.3
|
import QtQuick.Controls.Styles 1.3
|
||||||
|
|
||||||
Item {
|
CustomDialog {
|
||||||
objectName: "TestDialog"
|
title: "Test Dlg"
|
||||||
id: testDialog
|
id: testDialog
|
||||||
width: 384
|
objectName: "TestDialog"
|
||||||
height: 384
|
width: 512
|
||||||
|
height: 512
|
||||||
scale: 0.0
|
scale: 0.0
|
||||||
|
|
||||||
onEnabledChanged: {
|
Item {
|
||||||
scale = enabled ? 1.0 : 0.0
|
id: clientArea
|
||||||
}
|
// The client area
|
||||||
onScaleChanged: {
|
|
||||||
visible = (scale != 0.0);
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
scale = 1.0
|
|
||||||
}
|
|
||||||
Behavior on scale {
|
|
||||||
NumberAnimation {
|
|
||||||
//This specifies how long the animation takes
|
|
||||||
duration: 400
|
|
||||||
//This selects an easing curve to interpolate with, the default is Easing.Linear
|
|
||||||
easing.type: Easing.InOutBounce
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomDialog {
|
|
||||||
title: "Test Dlg"
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors.margins: parent.margins
|
||||||
|
anchors.topMargin: parent.topMargin
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
property int d: 100
|
property int d: 100
|
||||||
|
@ -55,16 +41,18 @@ Item {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: parent.titleSize + 12
|
anchors.topMargin: parent.titleSize + 12
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomButton {
|
CustomButton {
|
||||||
x: 128
|
x: 128
|
||||||
y: 192
|
y: 192
|
||||||
|
text: "Test"
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: 12
|
anchors.bottomMargin: 12
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 12
|
anchors.rightMargin: 12
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.log("Click");
|
console.log("Click");
|
||||||
|
|
||||||
if (square.visible) {
|
if (square.visible) {
|
||||||
square.visible = false
|
square.visible = false
|
||||||
} else {
|
} else {
|
||||||
|
@ -76,7 +64,7 @@ Item {
|
||||||
CustomButton {
|
CustomButton {
|
||||||
id: customButton2
|
id: customButton2
|
||||||
y: 192
|
y: 192
|
||||||
text: "Close"
|
text: "Move"
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 12
|
anchors.leftMargin: 12
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
Loading…
Reference in a new issue