[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/kviewshell-0.7/kviewshell
From: Stefan Kebekus <kebekus () kde ! org>
Date: 2006-08-27 8:03:39
Message-ID: 1156665819.597990.25425.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 577624 by kebekus:
added framework so plugins can specify that they mark hyperlins themselves
M +1 -8 TODO-Before-RELEASE
M +19 -20 shell/documentWidget.cpp
M +7 -8 shell/optionDialogGUIWidget_base.ui
M +2 -1 shell/renderedDocumentPage.cpp
M +13 -2 shell/renderedDocumentPage.h
--- branches/work/kviewshell-0.7/kviewshell/TODO-Before-RELEASE #577623:577624
@@ -1,12 +1,5 @@
+- DVI mit verweisen auf nicht-existente Dateien macht immer noch Ärger
-- EPS funktioniert im Moment nicht mehr.
-
-- Man kommt nur an die PDF Hyperlink Daten, wenn man poppler die Links
-in die Pixmaps zeichnen lässt. Das sieht meiner Meinung grauslich aus,
-müsste aber in poppler behoben werden. Als Workaround könnte man jede
-Seite zweimal rendern - einmal mit Hyperlinks und dann ohne, dass wäre
-aber viel zu langsam.
-
- Die "Tips of the day" sind immer noch im DVI-Plugin und werden
manchmal auch angezeigt, wenn man eine DVI-Datei lädt (Ich konnte noch
kein Muster erkennen, wann das passiert). Wir sollten die Funktion ins
--- branches/work/kviewshell-0.7/kviewshell/shell/documentWidget.cpp #577623:577624
@@ -323,30 +323,29 @@
p.setWorldMatrix(transform());
// Underline hyperlinks
- if (dataModel->preferences()->underlineLinks() == \
KVSPrefs::EnumUnderlineLinks::Enabled ||
- dataModel->preferences()->underlineLinks() == \
KVSPrefs::EnumUnderlineLinks::OnlyOnHover)
- {
- int h = 2; // Height of line.
- for(int i = 0; i < (int)pageData->hyperLinkList.size(); i++)
- {
- if (dataModel->preferences()->underlineLinks() == \
KVSPrefs::EnumUnderlineLinks::OnlyOnHover &&
- i != indexOfUnderlinedLink)
- continue;
- int x = pageData->hyperLinkList[i].box.left();
- int w = pageData->hyperLinkList[i].box.width();
- int y = pageData->hyperLinkList[i].baseline;
-
- QRect hyperLinkRect(x, y, w, h);
- //if (hyperLinkRect.intersects(inverseMap(e->rect()))) //FIXME: need to \
transform events
- {
+ if (pageData->hyperlinks_are_marked == false) // If hyperlinks are marked already, \
we don't underline them + if (dataModel->preferences()->underlineLinks() == \
KVSPrefs::EnumUnderlineLinks::Enabled || + \
dataModel->preferences()->underlineLinks() == \
KVSPrefs::EnumUnderlineLinks::OnlyOnHover) { + int h = 2; // Height of line.
+ for(int i = 0; i < (int)pageData->hyperLinkList.size(); i++) {
+ if (dataModel->preferences()->underlineLinks() == \
KVSPrefs::EnumUnderlineLinks::OnlyOnHover && + i != indexOfUnderlinedLink)
+ continue;
+ int x = pageData->hyperLinkList[i].box.left();
+ int w = pageData->hyperLinkList[i].box.width();
+ int y = pageData->hyperLinkList[i].baseline;
+
+ QRect hyperLinkRect(x, y, w, h);
+ //if (hyperLinkRect.intersects(inverseMap(e->rect()))) //FIXME: need to \
transform events + {
#ifdef DEBUG_DOCUMENTWIDGET
- kdDebug(kvs::shell) << "Underline hyperlink \"" << \
pageData->hyperLinkList[i].linkText << "\"" << endl; + kdDebug(kvs::shell) \
<< "Underline hyperlink \"" << pageData->hyperLinkList[i].linkText << "\"" << endl; \
#endif
- p.fillRect(x, y, w, h, KGlobalSettings::linkColor());
+ p.fillRect(x, y, w, h, KGlobalSettings::linkColor());
+ }
}
}
- }
-
+
// Paint flashing frame, if appropriate
if (animationCounter > 0 && animationCounter < 10)
{
--- branches/work/kviewshell-0.7/kviewshell/shell/optionDialogGUIWidget_base.ui \
#577623:577624 @@ -35,7 +35,7 @@
</sizepolicy>
</property>
<property name="text">
- <string>Underline links:</string>
+ <string>Mark hyperlinks:</string>
</property>
</widget>
<widget class="QLabel" row="1" column="0">
@@ -94,29 +94,28 @@
<widget class="QComboBox" row="0" column="1">
<item>
<property name="text">
- <string>Enabled</string>
+ <string>Underline hyperlinks</string>
</property>
</item>
<item>
<property name="text">
- <string>Disabled</string>
+ <string>Do not mark hyperlinks</string>
</property>
</item>
<item>
<property name="text">
- <string>Only on Hover</string>
+ <string>Underline hyperlinks on hover</string>
</property>
</item>
<property name="name">
<cstring>kcfg_UnderlineLinks</cstring>
</property>
- <property name="whatsThis" stdset="0">
- <string><qt>Controls how hyperlinks are underlined:
+ <property name="toolTip" stdset="0">
+ <string><qt>Some documents specify how hyperlinks are marked \
on screen. For other documents, this field controls how hyperlinks are underlined. \
<ul> <li><b>Enabled</b>: Always underline links</li>
<li><b>Disabled</b>: Never underline links</li>
-<li><b>Only on Hover</b>: Underline when the mouse is moved over \
the link</li>
-</ul></qt></string>
+<li><b>Only on Hover</b>: Underline when the mouse is moved over \
the link</li></ul></qt></string> </property>
</widget>
<widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
--- branches/work/kviewshell-0.7/kviewshell/shell/renderedDocumentPage.cpp \
#577623:577624 @@ -5,7 +5,7 @@
// Widget for displaying TeX DVI files.
// Part of KDVI- A previewer for TeX DVI files.
//
-// (C) 2004 Stefan Kebekus. Distributed under the GPL.
+// (C) 2004--2006 Stefan Kebekus. Distributed under the GPL.
#include <config.h>
@@ -24,6 +24,7 @@
pageNr = 0;
isEmpty = true;
pageText = QString::null;
+ hyperlinks_are_marked = false;
}
--- branches/work/kviewshell-0.7/kviewshell/shell/renderedDocumentPage.h \
#577623:577624 @@ -5,7 +5,7 @@
// Widget for displaying TeX DVI files.
// Part of KDVI- A previewer for TeX DVI files.
//
-// (C) 2004-2005 Stefan Kebekus. Distributed under the GPL.
+// (C) 2004-2006 Stefan Kebekus. Distributed under the GPL.
#ifndef _rendereddocumentpage_h_
#define _rendereddocumentpage_h_
@@ -65,7 +65,6 @@
documentRenderer.drawPage() is used again.
@author Stefan Kebekus <kebekus@kde.org>
- @version 1.0.0
*/
class RenderedDocumentPage : public QObject
@@ -199,7 +198,19 @@
void setTransition(KPDFPageTransition* pageTransition);
+ /** Indicates if hyperlinks are drawn
+
+ Some document formats, e.g. PDF, specify how hyperlinks appear on
+ screen, and the hyperlink is drawn by the documentRenderer. In that
+ case, the documentRenderer sets this member to 'true'. KViewShell
+ will then not attempt to mark the hyperlink itself.
+
+ This member is set to 'false' in the constructor.
+ */
+ bool hyperlinks_are_marked;
+
private:
+
/** \brief Page number
Number of the page that this instance represents a value of '0'
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic