Background Images in body pane?

55 views
Skip to first unread message

tfer

unread,
Jul 13, 2012, 4:57:57 PM7/13/12
to leo-e...@googlegroups.com
I was wondering if the Qt widget used for body text has a provision for background images?

I'm thinking that it might be interesting to have some wallpapers/tiles to visually represent various categories of methods, e.g. initors, setters, getters, etc.  Maybe ones that hint at the uses of a particular design pattern.  Maybe us a uA to control setting?

Tom

Edward K. Ream

unread,
May 1, 2013, 5:19:52 AM5/1/13
to leo-editor
On Fri, Jul 13, 2012 at 3:57 PM, tfer <tfeth...@aol.com> wrote:
I was wondering if the Qt widget used for body text has a provision for background images?

Sorry for the delay in responding.  Leo's body pane is a QTextBrowser:
http://qt-project.org/doc/qt-4.8/qtextbrowser.html
a subclass of QTextEdit.  QTextBrowser also inherits from QFrame and QWidget, so there *might* be a way to have a background image "leak" through the text.

Edward

Terry Brown

unread,
May 1, 2013, 9:42:44 AM5/1/13
to leo-e...@googlegroups.com
QTextEdit#richTextEdit { background-image: url('/home/tbrown/Desktop/cow2.jpg'); }

in the stylesheet gives the effect attached (i.e. it works).

If you wanted node specific backgrounds Leo would have to start setting
an attribute on the body widget, probably the gnx, so you could do

QTextEdit#richTextEdit[leo_gnx='tbrown.20130430222443.19340'] {
background-image: url('/home/tbrown/Desktop/cow2.jpg');
}

Cheers -Terry
del.jpg

Edward K. Ream

unread,
May 1, 2013, 10:23:38 AM5/1/13
to leo-editor
On Wed, May 1, 2013 at 8:42 AM, Terry Brown <terry_...@yahoo.com> wrote:


QTextEdit#richTextEdit { background-image: url('/home/tbrown/Desktop/cow2.jpg'); }

in the stylesheet gives the effect attached (i.e. it works).

If you wanted node specific backgrounds Leo would have to start setting
an attribute on the body widget, probably the gnx, so you could do

QTextEdit#richTextEdit[leo_gnx='tbrown.20130430222443.19340'] {
  background-image: url('/home/tbrown/Desktop/cow2.jpg');
}

Wow!  Thanks for this.  LeoUser wrote a version of Leo in Jython (using the Swing classes), and he claimed that he could watch *movies* in the body pane :-)

I'll add this to the Leo/To Document list.  Not sure yet how that list is going to get translated into action.  Still reading Getting Things Done :-)

Edward
Reply all
Reply to author
Forward
0 new messages