Advertisement
Guest User

Untitled

a guest
Feb 12th, 2014
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. import QtQuick 2.0
  2. import Ubuntu.Components 0.1
  3. import Communi 3.0
  4.  
  5. Item{
  6. id: background
  7. width: parent.width
  8. height: parent.height
  9. property IrcBuffer buffer
  10. MessageFormatter {
  11. id: formatter
  12. }
  13. Connections {
  14. target: buffer
  15. onMessageReceived: {
  16. var line = formatter.formatMessage(message)
  17. if (line){
  18. textArea.insert(textArea.selectionEnd," \n")
  19. textArea.insert(textArea.selectionEnd,line)
  20. textArea.insert(textArea.selectionEnd," \n")
  21. }
  22. }
  23. }
  24. TextArea{
  25. id: textArea
  26. width: parent.width
  27. height: Math.round(parent.height)
  28. readOnly: true
  29. cursorVisible: false
  30. renderType: Text.QtRendering
  31. textFormat: TextEdit.RichText
  32. wrapMode: Text.WordWrap
  33. font.pixelSize: 12
  34. selectByMouse: false
  35. text: ""
  36. onLinkActivated: Qt.openUrlExternally(link)
  37. // SequentialAnimation on font.letterSpacing {
  38. // NumberAnimation { from: -2; to: 0; easing.type: Easing.InQuad; duration: 1200 }
  39. // ScriptAction {
  40. // script: {
  41. // background.y = (background.height / 4) + (Math.random() * background.height / 2)
  42. // background.x = (background.width / 4) + (Math.random() * background.width / 2)
  43. // }
  44. // }
  45. }
  46. }
  47. // Scrollbar{
  48. // flickableItem: textArea
  49.  
  50. // }
  51. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement