fix:修改文本编辑器组件的边距

This commit is contained in:
许轲 2023-09-17 20:33:42 +08:00
parent f445c321ba
commit ee393300f9
2 changed files with 5 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package org.jcnc.jnotepad.ui.module; package org.jcnc.jnotepad.ui.module;
import javafx.geometry.Insets;
import org.fxmisc.richtext.LineNumberFactory; import org.fxmisc.richtext.LineNumberFactory;
import org.fxmisc.richtext.StyleClassedTextArea; import org.fxmisc.richtext.StyleClassedTextArea;
import org.jcnc.jnotepad.util.LogUtil; import org.jcnc.jnotepad.util.LogUtil;
@ -34,6 +35,9 @@ public class LineNumberTextArea extends StyleClassedTextArea {
* 用于创建 LineNumberTextArea 对象 * 用于创建 LineNumberTextArea 对象
*/ */
public LineNumberTextArea() { public LineNumberTextArea() {
//
setPadding(new Insets(8, 0, 0, 0));
// 设置 LineNumberTextArea 的样式包括边框和背景颜色 // 设置 LineNumberTextArea 的样式包括边框和背景颜色
getStyleClass().add("line-number-text-area"); getStyleClass().add("line-number-text-area");
this.setParagraphGraphicFactory(LineNumberFactory.get(this)); this.setParagraphGraphicFactory(LineNumberFactory.get(this));

View File

@ -26,6 +26,7 @@
-fx-background-color: -color-neutral-muted -fx-background-color: -color-neutral-muted
} }
.line-number-text-area .paragraph-box .text { .line-number-text-area .paragraph-box .text {
/*-fx-fill: -color-fg-default;*/ /*-fx-fill: -color-fg-default;*/
/* -fx-font-size: 18px;*/ /* -fx-font-size: 18px;*/