{"action":"created","issue":{"url":"https://api.github.com/repos/samaaron/sonic-pi/issues/747","labels_url":"https://api.github.com/repos/samaaron/sonic-pi/issues/747/labels{/name}","comments_url":"https://api.github.com/repos/samaaron/sonic-pi/issues/747/comments","events_url":"https://api.github.com/repos/samaaron/sonic-pi/issues/747/events","html_url":"https://github.com/samaaron/sonic-pi/pull/747","id":112412300,"number":747,"title":"WIP: Transparent backgrounds for Log window and editor","user":{"login":"xavriley","id":369527,"avatar_url":"https://avatars.githubusercontent.com/u/369527?v=3","gravatar_id":"","url":"https://api.github.com/users/xavriley","html_url":"https://github.com/xavriley","followers_url":"https://api.github.com/users/xavriley/followers","following_url":"https://api.github.com/users/xavriley/following{/other_user}","gists_url":"https://api.github.com/users/xavriley/gists{/gist_id}","starred_url":"https://api.github.com/users/xavriley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavriley/subscriptions","organizations_url":"https://api.github.com/users/xavriley/orgs","repos_url":"https://api.github.com/users/xavriley/repos","events_url":"https://api.github.com/users/xavriley/events{/privacy}","received_events_url":"https://api.github.com/users/xavriley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-20T16:48:11Z","updated_at":"2015-10-23T21:47:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/samaaron/sonic-pi/pulls/747","html_url":"https://github.com/samaaron/sonic-pi/pull/747","diff_url":"https://github.com/samaaron/sonic-pi/pull/747.diff","patch_url":"https://github.com/samaaron/sonic-pi/pull/747.patch"},"body":"This is mostly the result of non-scientific Googling and random\r\ncopy-n-paste coding. At the moment I've only managed to make the log\r\nwindow transparent and there are several issues around repainting new\r\nlines. The black on the QScintilla/editor window is probably to do with\r\nthe underlying TabWidget. More investigation needed.\r\n\r\nSources as follows:\r\n\r\n- http://stackoverflow.com/a/18317002/2618015\r\n- https://forum.qt.io/topic/53911/qtabwidget-background-not-transparent/2\r\n- http://forum.qt.io/topic/1090/solved-how-to-get-an-simple-transparent-window/2\r\n- https://forum.qt.io/topic/17340/transparent-background/2\r\n\r\nThis is loosely related to @josephWilk's previous work on transparency\r\nhere:\r\nhttps://github.com/josephwilk/sonic-pi/commit/aa4c55042c5ad890329a8114d3dccb52495942f2\r\n\r\nLooks a bit like this\r\n\r\n![Transparent log](https://cloud.githubusercontent.com/assets/369527/10614538/ca5691ba-7752-11e5-8dd4-fd620e61dd16.png)\r\n"},"comment":{"url":"https://api.github.com/repos/samaaron/sonic-pi/issues/comments/150701028","html_url":"https://github.com/samaaron/sonic-pi/pull/747#issuecomment-150701028","issue_url":"https://api.github.com/repos/samaaron/sonic-pi/issues/747","id":150701028,"user":{"login":"josephwilk","id":9792,"avatar_url":"https://avatars.githubusercontent.com/u/9792?v=3","gravatar_id":"","url":"https://api.github.com/users/josephwilk","html_url":"https://github.com/josephwilk","followers_url":"https://api.github.com/users/josephwilk/followers","following_url":"https://api.github.com/users/josephwilk/following{/other_user}","gists_url":"https://api.github.com/users/josephwilk/gists{/gist_id}","starred_url":"https://api.github.com/users/josephwilk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephwilk/subscriptions","organizations_url":"https://api.github.com/users/josephwilk/orgs","repos_url":"https://api.github.com/users/josephwilk/repos","events_url":"https://api.github.com/users/josephwilk/events{/privacy}","received_events_url":"https://api.github.com/users/josephwilk/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T21:47:17Z","updated_at":"2015-10-23T21:47:17Z","body":"Text looks crisp now:\r\n![screen shot 2015-10-23 at 22 45 39](https://cloud.githubusercontent.com/assets/9792/10705706/d2f5fb76-79d7-11e5-9435-c28e4f294126.png)\r\n\r\nBut there the surface feels like its missing a paint event still. New lines dup onto old lines.\r\n\r\nSecret sauce:\r\n\r\nIn QtPlat.ccp\r\n\r\n```\r\nvoid SurfaceImpl::drawText(const PRectangle &rc, Font &font_, XYPOSITION ybase,\r\n        const char *s, int len, ColourDesired fore)\r\n{\r\n    QString qs = convertText(s, len);\r\n\r\n    QFont *f = PFont(font_.GetID());\r\n\r\n    if (f)\r\n        painter->setFont(*f);\r\n\r\n    painter->setPen(convertQColor(fore));\r\n    \r\n    painter->setCompositionMode( QPainter::CompositionMode_Clear );\r\n    painter->fillRect(QRectF(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top), Qt::transparent);\r\n    painter->setCompositionMode( QPainter::CompositionMode_SourceOver);    \r\n    painter->drawText(QPointF(rc.left, ybase), qs);\r\n}\r\n\r\n```\r\n"}}