Advertisement
Guest User

Untitled

a guest
Feb 13th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Page {
  2.     objectName: "localCommentPage"
  3.     id: localCommentPage
  4.     tools: basicTools
  5.     orientationLock: PageOrientation.Automatic
  6.  
  7.     function setTextAreaSize() {
  8.         resizeTextArea()
  9.         container.contentY = 0
  10.     }
  11.     function resizeTextArea () {
  12.         commentArea.width = parent.width
  13.         commentArea.height = commentArea.text.paintedHeight
  14.     }
  15.     Rectangle {
  16.         id: commentRec
  17.         anchors.fill: parent
  18.         color: "#BBB"
  19.         Flickable {
  20.             id: container
  21.             x: 0
  22.             y: 0
  23.             width: parent.width
  24.             height: parent.height
  25.             contentWidth: commentArea.width
  26.             contentHeight: Math.max(parent.height,commentArea.height)
  27.             TextArea {
  28.                 id: commentArea
  29.                 width: parent.width
  30. //                height: text.paintedHeight
  31. //                anchors.fill: parent
  32.                 readOnly: true
  33.                 font.pixelSize: 32
  34.                 text: rootWindow.localCommentText
  35.                 wrapMode: TextEdit.Wrap
  36.             }
  37.         }
  38.         ScrollDecorator {
  39.             id: scrolldecorator
  40.             flickableItem: container
  41.         }
  42.     }
  43.     onRotationChanged: {
  44.         console.log("LocalCommentPage: Screen rotated!")
  45.         setTextAreaSize()
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement