Author: Antonio Cuni <[email protected]>
Branch: 
Changeset: r130:3909cbd0479c
Date: 2011-06-10 15:51 +0200
http://bitbucket.org/pypy/jitviewer/changeset/3909cbd0479c/

Log:    bah, put a workaround for a bug in the pyqt's webkit

diff --git a/bin/jitviewer.py b/bin/jitviewer.py
--- a/bin/jitviewer.py
+++ b/bin/jitviewer.py
@@ -96,8 +96,11 @@
             extra_data = ""
         if not all:
             loops = loops[:CUTOFF]
+
+        qt_workaround = ('Qt/4.7.2' in flask.request.user_agent.string)
         return flask.render_template('index.html', loops=loops,
                                      filename=self.filename,
+                                     qt_workaround=qt_workaround,
                                      extra_data=extra_data)
 
     def loop(self):
diff --git a/static/qt_workaround.css b/static/qt_workaround.css
new file mode 100644
--- /dev/null
+++ b/static/qt_workaround.css
@@ -0,0 +1,7 @@
+/* apparently, the QWebView included in Qt 4.7.2 cannot display Droid Sans
+   Mono or Andale Mono in bold, so we switch to some other monospaced font */
+
+.dmp {
+    font-family: Inconsolata, Courier New, Courier, monospace;
+       font-size: 14px;
+}
diff --git a/static/style.css b/static/style.css
--- a/static/style.css
+++ b/static/style.css
@@ -13,7 +13,7 @@
 
 html {background: rgba(238, 238, 238, 0.9);}
 body {
-       font-family: DroidSansMono, Andale Mono, Courier New, Courier, 
monospace;
+       font-family: DroidSansMono, Andale Mono, Inconsolata, Courier New, 
Courier, monospace;
        font-size: 13px;
        line-height: 22px;
        
diff --git a/templates/index.html b/templates/index.html
--- a/templates/index.html
+++ b/templates/index.html
@@ -4,6 +4,10 @@
   <link 
href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono&subset=latin' 
rel='stylesheet' type='text/css'>
   <link rel="stylesheet" type="text/css" href="/static/style.css"/>
   <link rel="stylesheet" type="text/css" href="/static/pygments.css"/>
+  {% if qt_workaround %}
+      <link rel="stylesheet" type="text/css" href="/static/qt_workaround.css"/>
+  {% endif %}
+
   <script src="/static/jquery.min.js"></script>
   <script src="/static/jquery.scrollTo-1.4.2-min.js"></script>
   <script src="/static/script.js"></script>
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to