On Wed, Nov 6, 2013 at 1:27 PM, Edward K. Ream <[email protected]> wrote:
> It looks like the viewrendered widget doesn't handle the css properly. So
> I'll test the output here:
> http://www.w3schools.com/html/tryit.asp?filename=tryhtml_intro
>
> Presumably, this is a good reason to fix bug 782009:
> viewrendered plugin should use QWebView
I played with this and it was straightforward to get working for @html
nodes. I didn't try to change it for @rst. Here are the changes I made
locally:
diff --git a/leo/plugins/viewrendered.py b/leo/plugins/viewrendered.py
index 631b8e9..ce16060 100755
--- a/leo/plugins/viewrendered.py
+++ b/leo/plugins/viewrendered.py
@@ -223,6 +223,7 @@ except ImportError:
import PyQt4.QtCore as QtCore
import PyQt4.QtGui as QtGui
import PyQt4.QtSvg as QtSvg
+import PyQt4.QtWebKit as QtWebKit
#@-<< imports >>
#@+<< define stylesheet >>
@@ -516,6 +517,7 @@ class ViewRenderedController(QtGui.QWidget):
self.splitter_index = None # The index of the rendering pane
in the splitter.
self.svg_class = QtSvg.QSvgWidget
self.text_class = QtGui.QTextBrowser # QtGui.QTextEdit #
qtGui.LeoQTextBrowser
+ self.html_class = QtWebKit.QWebView
self.graphics_class = QtGui.QGraphicsWidget
self.vp = None # The present video player.
self.w = None # The present widget in the rendering pane.
@@ -770,11 +772,15 @@ class ViewRenderedController(QtGui.QWidget):
pc = self
+ if pc.must_change_widget(pc.html_class):
+ w = pc.html_class()
+ pc.embed_widget(w)
+ assert (w == pc.w)
+ else:
+ w = pc.w
+
pc.show()
- w = pc.ensure_text_widget()
- w.setReadOnly(False)
w.setHtml(s)
- w.setReadOnly(True)
#@+node:ekr.20110320120020.14482: *4* update_image
def update_image (self,s,keywords):
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.