Line
Link Here
|
0 |
-- a/editor.completion/src/org/netbeans/modules/editor/completion/DocumentationScrollPane.java Wed Feb 22 06:03:52 2017 +0000 |
0 |
++ b/editor.completion/src/org/netbeans/modules/editor/completion/DocumentationScrollPane.java Fri Nov 03 12:17:40 2017 -0400 |
Lines 81-86
Link Here
|
81 |
* @author Martin Roskanin, Dusan Balek |
81 |
* @author Martin Roskanin, Dusan Balek |
82 |
*/ |
82 |
*/ |
83 |
public class DocumentationScrollPane extends JScrollPane { |
83 |
public class DocumentationScrollPane extends JScrollPane { |
|
|
84 |
private static final String TEXT_ZOOM_PROPERTY = "text-zoom"; // Defined in DocumentView in editor.lib2 |
84 |
|
85 |
|
85 |
private static final String BACK = "org/netbeans/modules/editor/completion/resources/back.png"; //NOI18N |
86 |
private static final String BACK = "org/netbeans/modules/editor/completion/resources/back.png"; //NOI18N |
86 |
private static final String FORWARD = "org/netbeans/modules/editor/completion/resources/forward.png"; //NOI18N |
87 |
private static final String FORWARD = "org/netbeans/modules/editor/completion/resources/forward.png"; //NOI18N |
Lines 130-135
Link Here
|
130 |
|
131 |
|
131 |
// Add the completion doc view |
132 |
// Add the completion doc view |
132 |
view = new HTMLDocView(bgColor); |
133 |
view = new HTMLDocView(bgColor); |
|
|
134 |
Integer textZoom = (Integer) editorComponent.getClientProperty(TEXT_ZOOM_PROPERTY); |
135 |
// Use the same logic as in o.n.editor.GlyphGutter.update(). |
136 |
if (textZoom != null && textZoom != 0) { |
137 |
Font font = view.getFont(); |
138 |
if (Math.max(font.getSize() + textZoom, 2) == 2) { |
139 |
textZoom = -(font.getSize() - 2); |
140 |
} |
141 |
view.setFont(new Font(font.getFamily(), font.getStyle(), |
142 |
font.getSize() + textZoom)); |
143 |
} |
144 |
|
133 |
view.addHyperlinkListener(new HyperlinkAction()); |
145 |
view.addHyperlinkListener(new HyperlinkAction()); |
134 |
setViewportView(view); |
146 |
setViewportView(view); |
135 |
-- a/editor.completion/src/org/netbeans/modules/editor/completion/HTMLDocView.java Wed Feb 22 06:03:52 2017 +0000 |
147 |
++ b/editor.completion/src/org/netbeans/modules/editor/completion/HTMLDocView.java Fri Nov 03 12:19:35 2017 -0400 |
Lines 46-51
Link Here
|
46 |
package org.netbeans.modules.editor.completion; |
46 |
package org.netbeans.modules.editor.completion; |
47 |
|
47 |
|
48 |
import java.awt.Color; |
48 |
import java.awt.Color; |
|
|
49 |
import java.awt.Font; |
49 |
import java.awt.Insets; |
50 |
import java.awt.Insets; |
50 |
import java.awt.Rectangle; |
51 |
import java.awt.Rectangle; |
51 |
import java.awt.event.MouseEvent; |
52 |
import java.awt.event.MouseEvent; |
Lines 194-205
Link Here
|
194 |
private void setBodyFontInCSS() { |
195 |
private void setBodyFontInCSS() { |
195 |
javax.swing.text.html.StyleSheet css = |
196 |
javax.swing.text.html.StyleSheet css = |
196 |
new javax.swing.text.html.StyleSheet(); |
197 |
new javax.swing.text.html.StyleSheet(); |
197 |
java.awt.Font f = new EditorUI().getDefaultColoring().getFont(); |
198 |
java.awt.Font editorFont = new EditorUI().getDefaultColoring().getFont(); |
198 |
setFont(f); |
199 |
// do not use monospaced font, just adjust fontsize |
|
|
200 |
Font useFont = |
201 |
new Font(getFont().getFamily(), Font.PLAIN, editorFont.getSize()); |
202 |
setFont(useFont); |
199 |
try { |
203 |
try { |
200 |
css.addRule(new StringBuilder("body, div { font-size: ").append(f.getSize()) // NOI18N |
204 |
css.addRule(new StringBuilder("body, div { font-size: ").append(useFont.getSize()) // NOI18N |
201 |
.append("; font-family: ").append(getFont().getFamily()).append(";}").toString()); // NOI18N |
205 |
.append("; font-family: ").append(useFont.getFamily()).append(";}").toString()); // NOI18N |
202 |
// do not use monospaced font, just adjust fontsize |
|
|
203 |
} catch (Exception e) { |
206 |
} catch (Exception e) { |
204 |
} |
207 |
} |
205 |
css.addStyleSheet(htmlKit.getStyleSheet()); |
208 |
css.addStyleSheet(htmlKit.getStyleSheet()); |