|
@@ -6,7 +6,7 @@ import os, re
|
|
from PyQt5 import QtCore
|
|
from PyQt5 import QtCore
|
|
from PyQt5.QtCore import QUrl, QSettings, QSizeF
|
|
from PyQt5.QtCore import QUrl, QSettings, QSizeF
|
|
from PyQt5.QtGui import QKeySequence, QFont
|
|
from PyQt5.QtGui import QKeySequence, QFont
|
|
-from PyQt5.QtWidgets import QWidget, QTabWidget, QVBoxLayout, QHBoxLayout, QSplitter, QPlainTextEdit, QShortcut, QPushButton, QCheckBox
|
|
+from PyQt5.QtWidgets import QWidget, QTabWidget, QVBoxLayout, QHBoxLayout, QSplitter, QPlainTextEdit, QShortcut, QPushButton, QCheckBox, QSpinBox, QLabel
|
|
from PyQt5.QtWebKit import QWebSettings
|
|
from PyQt5.QtWebKit import QWebSettings
|
|
from PyQt5.QtWebKitWidgets import QWebView, QWebInspector
|
|
from PyQt5.QtWebKitWidgets import QWebView, QWebInspector
|
|
from PyQt5.QtPrintSupport import QPrintPreviewDialog, QPrinter
|
|
from PyQt5.QtPrintSupport import QPrintPreviewDialog, QPrinter
|
|
@@ -74,6 +74,14 @@ class WebViewToolBar(QWidget):
|
|
def __init__(self, parent):
|
|
def __init__(self, parent):
|
|
super(WebViewToolBar, self).__init__(parent)
|
|
super(WebViewToolBar, self).__init__(parent)
|
|
self.parent = parent
|
|
self.parent = parent
|
|
|
|
+
|
|
|
|
+ font = QFont()
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ font.setPointSize(8)
|
|
|
|
+ self.setFont(font)
|
|
|
|
+
|
|
|
|
+
|
|
self.hbox = QHBoxLayout()
|
|
self.hbox = QHBoxLayout()
|
|
self.hbox.setContentsMargins(0,0,0,0)
|
|
self.hbox.setContentsMargins(0,0,0,0)
|
|
|
|
|
|
@@ -101,7 +109,23 @@ class WebViewToolBar(QWidget):
|
|
self.hbox.addStretch()
|
|
self.hbox.addStretch()
|
|
|
|
|
|
|
|
|
|
|
|
+ self.hbox.addWidget(QLabel("Zoom:"))
|
|
|
|
+ self.zoom = QSpinBox(self)
|
|
|
|
+
|
|
|
|
+ self.hbox.addWidget(self.zoom)
|
|
|
|
+
|
|
|
|
|
|
|
|
+ self.hbox.addWidget(QLabel("Page:"))
|
|
|
|
+ self.page = QSpinBox(self)
|
|
|
|
+
|
|
|
|
+ self.hbox.addWidget(self.page)
|
|
|
|
+
|
|
|
|
+ self.addpage = QPushButton("&Add Page", self)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ self.hbox.addWidget(self.addpage)
|
|
|
|
|
|
self.hbox.addStretch()
|
|
self.hbox.addStretch()
|
|
|
|
|
|
@@ -114,12 +138,12 @@ class WebViewToolBar(QWidget):
|
|
self.reload.clicked.connect(self.onReload)
|
|
self.reload.clicked.connect(self.onReload)
|
|
self.hbox.addWidget(self.reload)
|
|
self.hbox.addWidget(self.reload)
|
|
|
|
|
|
- self.imprim = QPushButton("&Print", self)
|
|
+ self.genpdf = QPushButton("&PDF", self)
|
|
-
|
|
+
|
|
|
|
|
|
-
|
|
+
|
|
- self.imprim.clicked.connect(self.onPrint)
|
|
+ self.genpdf.clicked.connect(self.onGenPDF)
|
|
- self.hbox.addWidget(self.imprim)
|
|
+ self.hbox.addWidget(self.genpdf)
|
|
|
|
|
|
self.setLayout(self.hbox)
|
|
self.setLayout(self.hbox)
|
|
|
|
|
|
@@ -140,9 +164,9 @@ class WebViewToolBar(QWidget):
|
|
print("onReload")
|
|
print("onReload")
|
|
|
|
|
|
|
|
|
|
- def onPrint(self):
|
|
+ def onGenPDF(self):
|
|
- print("onReload")
|
|
+ print("onGenPDF")
|
|
- self.parent.webkitview.onPrint()
|
|
+ self.parent.webkitview.ongenPDF()
|
|
|
|
|
|
|
|
|
|
class CodeEditor(QPlainTextEdit):
|
|
class CodeEditor(QPlainTextEdit):
|
|
@@ -169,6 +193,16 @@ class CodeEditor(QPlainTextEdit):
|
|
self.textChanged.connect(self.onTextChanged)
|
|
self.textChanged.connect(self.onTextChanged)
|
|
|
|
|
|
|
|
|
|
|
|
+ font = QFont()
|
|
|
|
+ font.setFamily("Droid Sans Mono")
|
|
|
|
+ font.setFixedPitch(True)
|
|
|
|
+ font.setPointSize(12)
|
|
|
|
+ self.setFont(font)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
def onTextChanged(self):
|
|
def onTextChanged(self):
|
|
|
|
|
|
|
|
|
|
@@ -210,14 +244,6 @@ class Editor(QWidget):
|
|
self.layout.addWidget(self.tabs)
|
|
self.layout.addWidget(self.tabs)
|
|
self.setLayout(self.layout)
|
|
self.setLayout(self.layout)
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
def refresh(self):
|
|
def refresh(self):
|
|
self.scsstab.setText()
|
|
self.scsstab.setText()
|
|
self.jstab.setText()
|
|
self.jstab.setText()
|