summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--components/Button.qml6
-rw-r--r--components/TextArea.qml7
-rw-r--r--components/custom/BasicButton.qml12
-rw-r--r--components/custom/TextField.qml1
-rw-r--r--examples/Gallery.qml1
-rw-r--r--qmldesktopviewer/qmldesktopviewer.cpp1
-rw-r--r--src/qtoplevelwindow.cpp3
7 files changed, 26 insertions, 5 deletions
diff --git a/components/Button.qml b/components/Button.qml
index 403479ad..b0df9273 100644
--- a/components/Button.qml
+++ b/components/Button.qml
@@ -9,7 +9,7 @@ Components.Button {
property alias containsMouse: tooltip.containsMouse
property variant sizehint: backgroundItem.sizeFromContents(80, 6)
- property bool defaultbutton
+ property bool defaultbutton: false
property string hint
TooltipArea {
@@ -31,7 +31,7 @@ Components.Button {
hint: button.hint
// If no icon, let the style do the drawing
- activeControl: focus ? "default" : ""
+ activeControl: defaultbutton ? "default" : "f"
}
label: Item {
@@ -56,6 +56,6 @@ Components.Button {
}
}
}
- Keys.onSpacePressed:clicked()
+ Keys.onSpacePressed:animateClick()
}
diff --git a/components/TextArea.qml b/components/TextArea.qml
index c5c8f77b..f78f87cc 100644
--- a/components/TextArea.qml
+++ b/components/TextArea.qml
@@ -13,11 +13,17 @@ ScrollArea {
property alias readOnly: edit.readOnly
property bool tabChangesFocus: false
property alias font: edit.font
+ property alias activeFocusOnPress: edit.activeFocusOnPress
highlightOnFocus: true
property int documentMargins: 4
frame: true
+ function append (string) {
+ text += "\n" + string
+ verticalScrollBar.value = verticalScrollBar.maximumValue
+ }
+
Item {
anchors.left: parent.left
anchors.top: parent.top
@@ -32,6 +38,7 @@ ScrollArea {
selectByMouse: true
readOnly: false
color: syspal.text
+
SystemPalette {
id: syspal
colorGroup: enabled ? SystemPalette.Active : SystemPalette.Disabled
diff --git a/components/custom/BasicButton.qml b/components/custom/BasicButton.qml
index 1ac4b11c..52700fc2 100644
--- a/components/custom/BasicButton.qml
+++ b/components/custom/BasicButton.qml
@@ -25,6 +25,18 @@ Item {
width: backgroundLoader.item.width
height: backgroundLoader.item.height
+ function animateClick() {
+ behavior.pressed = true
+ behavior.clicked()
+ animateClickTimer.start()
+ }
+
+ Timer {
+ id: animateClickTimer
+ interval: 250
+ onTriggered: behavior.pressed = false
+ }
+
Loader {
id: backgroundLoader
anchors.fill: parent
diff --git a/components/custom/TextField.qml b/components/custom/TextField.qml
index 55d5619b..2ddefc46 100644
--- a/components/custom/TextField.qml
+++ b/components/custom/TextField.qml
@@ -24,6 +24,7 @@ FocusScope {
property alias echoMode: textInput.echoMode
property alias cursorPosition: textInput.cursorPosition
property alias inputMethodHints: textInput.inputMethodHints
+ property alias activeFocusOnPress: textInput.activeFocusOnPress
property color textColor: syspal.text
property color backgroundColor: syspal.base
diff --git a/examples/Gallery.qml b/examples/Gallery.qml
index 1e4fa44f..b1a8a66d 100644
--- a/examples/Gallery.qml
+++ b/examples/Gallery.qml
@@ -144,7 +144,6 @@ Rectangle {
text:"Close"
width: 98
tooltip:"Press me, to close this window again"
- defaultbutton:true
onClicked: window1.visible = false
}
Button {
diff --git a/qmldesktopviewer/qmldesktopviewer.cpp b/qmldesktopviewer/qmldesktopviewer.cpp
index 6fd07a12..dcefe9a1 100644
--- a/qmldesktopviewer/qmldesktopviewer.cpp
+++ b/qmldesktopviewer/qmldesktopviewer.cpp
@@ -132,7 +132,6 @@ void QmlDesktopViewer::registerTypes()
static bool registered = false;
if (!registered) {
- qDebug() << "registerying types now";
// registering only for exposing the DeviceOrientation::Orientation enum
// qmlRegisterUncreatableType<QDesktopItem>("Qt",4,7,"Desktop", QLatin1String("Do not create objects of type Desktop"));
// qmlRegisterUncreatableType<QDesktopItem>("QtQuick",1,0,"Desktop",QLatin1String("Do not create objects of type Desktop"));
diff --git a/src/qtoplevelwindow.cpp b/src/qtoplevelwindow.cpp
index 14660a3d..b233183a 100644
--- a/src/qtoplevelwindow.cpp
+++ b/src/qtoplevelwindow.cpp
@@ -5,6 +5,9 @@
QTopLevelWindow::QTopLevelWindow()
: QMainWindow(), _view(new QDeclarativeView), _positionIsDefined(false) {
setVisible(false);
+ // Ensure that we have a default size, otherwise an empty window statement will
+ // result in no window
+ resize(QSize(100, 100));
setCentralWidget(_view);
setAttribute(Qt::WA_DeleteOnClose);
}