Merge branch 'release-v1.1.13' of https://gitee.com/jcnc-org/JNotepad into develop
This commit is contained in:
commit
98010e4411
@ -50,10 +50,9 @@ body:
|
|||||||
label: 版本
|
label: 版本
|
||||||
description: 你当前正在使用我们软件的哪个版本/分支?
|
description: 你当前正在使用我们软件的哪个版本/分支?
|
||||||
options:
|
options:
|
||||||
- V1.1.11(默认)
|
- V1.1.13(最新开发版)
|
||||||
- V1.1.12(最新)
|
- V1.1.12(最新发行版)
|
||||||
|
- V1.1.11
|
||||||
- V1.1.10
|
- V1.1.10
|
||||||
- V1.1.9
|
|
||||||
- V1.1.8
|
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
10
README.md
10
README.md
@ -1,7 +1,7 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="src/main/resources/img/icon.svg" alt="JNotepad Icon">
|
<img src="src/main/resources/img/icon.svg" alt="JNotepad Icon">
|
||||||
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">JNotepad</h1>
|
<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">
|
<p align="center">
|
||||||
<a href='https://gitee.com/jcnc-org/JNotepad/stargazers'><img
|
<a href='https://gitee.com/jcnc-org/JNotepad/stargazers'><img
|
||||||
@ -36,6 +36,14 @@
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</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)
|
JNotepad(Java Notepad)
|
||||||
是一款简约而强大的跨平台文本编辑器,旨在提供用户友好的界面和丰富的功能以及插件化使用。无论你是在Linux、Windows还是macOS系统上使用,JNotepad都能满足你对文本编辑和查看的需求。
|
是一款简约而强大的跨平台文本编辑器,旨在提供用户友好的界面和丰富的功能以及插件化使用。无论你是在Linux、Windows还是macOS系统上使用,JNotepad都能满足你对文本编辑和查看的需求。
|
||||||
|
|||||||
@ -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));
|
||||||
|
setStyle("-fx-font-family: 'Courier New';");
|
||||||
// 设置 LineNumberTextArea 的样式,包括边框和背景颜色
|
// 设置 LineNumberTextArea 的样式,包括边框和背景颜色
|
||||||
getStyleClass().add("line-number-text-area");
|
getStyleClass().add("line-number-text-area");
|
||||||
this.setParagraphGraphicFactory(LineNumberFactory.get(this));
|
this.setParagraphGraphicFactory(LineNumberFactory.get(this));
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package org.jcnc.jnotepad.views.root.center.main.bottom.status;
|
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.Insets;
|
||||||
import javafx.geometry.Pos;
|
import javafx.geometry.Pos;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
@ -114,10 +116,31 @@ public class BottomStatusBox extends AbstractHorizontalBox {
|
|||||||
CenterTab centerTab = instance.getSelected();
|
CenterTab centerTab = instance.getSelected();
|
||||||
if (centerTab != null) {
|
if (centerTab != null) {
|
||||||
updateEncodingLabel(centerTab.getCharset().name());
|
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()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取光标所在行号。
|
* 获取光标所在行号。
|
||||||
*
|
*
|
||||||
|
|||||||
@ -30,12 +30,18 @@ public class SidebarToolBar extends javafx.scene.control.ToolBar {
|
|||||||
ImageView imageView = new ImageView(image);
|
ImageView imageView = new ImageView(image);
|
||||||
imageView.setFitWidth(10);
|
imageView.setFitWidth(10);
|
||||||
imageView.setFitHeight(10);
|
imageView.setFitHeight(10);
|
||||||
|
|
||||||
|
imageView.setPreserveRatio(true);
|
||||||
|
|
||||||
// 设置水平缩放比例
|
// 设置水平缩放比例
|
||||||
imageView.setScaleX(2.5);
|
imageView.setScaleX(2.5);
|
||||||
// 设置垂直缩放比例
|
// 设置垂直缩放比例
|
||||||
imageView.setScaleY(2.5);
|
imageView.setScaleY(2.5);
|
||||||
|
|
||||||
// 设置缩放比例
|
// 设置缩放比例
|
||||||
setButton.setGraphic(imageView);
|
setButton.setGraphic(imageView);
|
||||||
|
setButton.setPrefWidth(imageView.getFitWidth() + 20);
|
||||||
|
setButton.setPrefHeight(imageView.getFitHeight() + 20);
|
||||||
|
|
||||||
// 将按钮添加到工具栏
|
// 将按钮添加到工具栏
|
||||||
getItems().addAll(setButton);
|
getItems().addAll(setButton);
|
||||||
|
|||||||
@ -25,6 +25,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;*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user