Merge branch 'release-v1.1.13' of https://gitee.com/jcnc-org/JNotepad into develop

This commit is contained in:
gewuyou 2023-09-17 21:24:30 +08:00
commit 98010e4411
6 changed files with 46 additions and 5 deletions

View File

@ -50,10 +50,9 @@ body:
label: 版本
description: 你当前正在使用我们软件的哪个版本/分支?
options:
- V1.1.11(默认)
- V1.1.12(最新)
- V1.1.13(最新开发版)
- V1.1.12(最新发行版)
- V1.1.11
- V1.1.10
- V1.1.9
- V1.1.8
validations:
required: true

View File

@ -1,7 +1,7 @@
<p align="center">
<img src="src/main/resources/img/icon.svg" alt="JNotepad Icon">
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">JNotepad</h1>
<h4 align="center" style="margin: 30px 0 30px; font-weight: bold;">JavaFx开发插件驱动创造无限可</h4>
<h4 align="center" style="margin: 30px 0 30px; font-weight: bold;">JavaFx开发插件驱动创造无限可</h4>
<p align="center">
<a href='https://gitee.com/jcnc-org/JNotepad/stargazers'><img
@ -36,6 +36,14 @@
</a>
</p>
[jnotepad-official-plugins]:https://gitee.com/jcnc-org/jnotepad-official-plugins
[jcnc-docs]:https://gitee.com/jcnc-org/docs
| 序号 | 相关仓库 | 链接地址 |
|:---: | :---------------: | :-----------------------------------:|
|1 | JNotepad插件仓库 | [点击访问][jnotepad-official-plugins] |
|2 | JCNC文档仓库 | [点击访问][jcnc-docs] |
JNotepad(Java Notepad)
是一款简约而强大的跨平台文本编辑器旨在提供用户友好的界面和丰富的功能以及插件化使用。无论你是在Linux、Windows还是macOS系统上使用JNotepad都能满足你对文本编辑和查看的需求。

View File

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

View File

@ -1,5 +1,7 @@
package org.jcnc.jnotepad.views.root.center.main.bottom.status;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Label;
@ -114,10 +116,31 @@ public class BottomStatusBox extends AbstractHorizontalBox {
CenterTab centerTab = instance.getSelected();
if (centerTab != null) {
updateEncodingLabel(centerTab.getCharset().name());
// 添加光标位置变化监听器
LineNumberTextArea textArea = centerTab.getLineNumberTextArea();
textArea.caretPositionProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
updateRowColumnLabel(textArea.getCaretPosition(), textArea.getText());
}
});
}
}
}
/**
* 更新行列信息
* @param caretPosition 光标位置
* @param text 文本内容
*/
private void updateRowColumnLabel(int caretPosition, String text) {
int row = getRow(caretPosition, text);
int column = getColumn(caretPosition, text);
statusLabel.setText(getStatusBarFormattedText(row, column, text.length()));
}
/**
* 获取光标所在行号
*

View File

@ -30,12 +30,18 @@ public class SidebarToolBar extends javafx.scene.control.ToolBar {
ImageView imageView = new ImageView(image);
imageView.setFitWidth(10);
imageView.setFitHeight(10);
imageView.setPreserveRatio(true);
// 设置水平缩放比例
imageView.setScaleX(2.5);
// 设置垂直缩放比例
imageView.setScaleY(2.5);
// 设置缩放比例
setButton.setGraphic(imageView);
setButton.setPrefWidth(imageView.getFitWidth() + 20);
setButton.setPrefHeight(imageView.getFitHeight() + 20);
// 将按钮添加到工具栏
getItems().addAll(setButton);

View File

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