Advertisement
Guest User

Untitled

a guest
Feb 13th, 2013
127
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.  
  16.     Rectangle {
  17.         id: commentRec
  18.         anchors.fill: parent
  19.         color: "#9B9"
  20.         Flickable {
  21.             id: container
  22.             x: 0
  23.             y: 0
  24.             anchors.fill: parent
  25.             contentWidth: parent.width
  26.             contentHeight: Math.max(parent.height,commentArea.text.paintedHeight)
  27.             TextArea {
  28.                 id: commentArea
  29.                 anchors.fill: parent
  30.                 readOnly: true
  31.                 font.pixelSize: 32
  32.                 text: rootWindow.localCommentText
  33.                 wrapMode: TextEdit.Wrap
  34.             }
  35.         }
  36.         ScrollDecorator {
  37.             id: scrolldecorator
  38.             flickableItem: container
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement