Skip to content

Commit

Permalink
Allow running it on the Desktop (windowed, no feedback)
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Dec 7, 2012
1 parent 80eb98d commit 459e0e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion gotovienna-qml
Expand Up @@ -428,7 +428,17 @@ if __name__ == '__main__':
# Assume test from source directory, use relative path
view.setSource(os.path.join(os.path.dirname(__file__), 'qml/main.qml'))

view.showFullScreen()
if '--windowed' in sys.argv:
desktop = app.desktop()
if desktop.height() < 1000:
FACTOR = .8
view.scale(FACTOR, FACTOR)
size = view.size()
size *= FACTOR
view.resize(size)
view.show()
else:
view.showFullScreen()

sys.exit(app.exec_())

6 changes: 3 additions & 3 deletions qml/LinePad.qml
Expand Up @@ -93,8 +93,8 @@ Rectangle {
margins: -30
}
onClicked: {
buttonFeedback.start()
inputLine.text = ''
buttonFeedback.start()
}
}
}
Expand Down Expand Up @@ -177,9 +177,9 @@ Rectangle {
MouseArea {
anchors.fill: parent
onClicked: {
if( inputElement.isCandidate) {
buttonFeedback.start()
if (inputElement.isCandidate) {
inputLine.text += modelData
buttonFeedback.start()
}
}
}
Expand Down

0 comments on commit 459e0e4

Please sign in to comment.