Skip to content

Commit 11598ac

Browse files
committed
feat: update Git operation icons to use new SVG files and adjust references in the UI
1 parent 06c8b5d commit 11598ac

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.laker.tools</groupId>
88
<artifactId>easy-postman</artifactId>
9-
<version>4.2.8</version> <!--保证 win-upgrade-uuid 不变,app-version 每次升级时递增(就是引用的这里啦)。要不然在win无法升级-->
9+
<version>4.2.9</version> <!--保证 win-upgrade-uuid 不变,app-version 每次升级时递增(就是引用的这里啦)。要不然在win无法升级-->
1010

1111
<properties>
1212
<!-- 编译配置 -->

src/main/java/com/laker/postman/model/GitOperation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
@Getter
1010
public enum GitOperation {
11-
COMMIT(I18nUtil.getMessage(MessageKeys.GIT_OPERATION_COMMIT), "save.svg", new Color(34, 139, 34)),
12-
PUSH(I18nUtil.getMessage(MessageKeys.GIT_OPERATION_PUSH), "upload.svg", new Color(30, 144, 255)),
13-
PULL(I18nUtil.getMessage(MessageKeys.GIT_OPERATION_PULL), "download.svg", new Color(216, 209, 160));
11+
COMMIT(I18nUtil.getMessage(MessageKeys.GIT_OPERATION_COMMIT), "icons/git-commit.svg", new Color(34, 139, 34)),
12+
PUSH(I18nUtil.getMessage(MessageKeys.GIT_OPERATION_PUSH), "icons/git-push.svg", new Color(30, 144, 255)),
13+
PULL(I18nUtil.getMessage(MessageKeys.GIT_OPERATION_PULL), "icons/git-pull.svg", new Color(216, 209, 160));
1414

1515
private final String displayName;
1616
private final String iconName;

src/main/java/com/laker/postman/panel/topmenu/TopMenuBar.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ private JPanel createGitToolbar(Workspace workspace) {
426426
// Commit 按钮(本地提交,始终显示)
427427
JButton commitButton = createGitButton(
428428
I18nUtil.getMessage(MessageKeys.WORKSPACE_GIT_COMMIT),
429-
"icons/git-commit.svg",
429+
GitOperation.COMMIT.getIconName(),
430430
e -> performGitOperation(workspace, GitOperation.COMMIT)
431431
);
432432
toolbar.add(commitButton);
@@ -436,7 +436,7 @@ private JPanel createGitToolbar(Workspace workspace) {
436436
// Pull 按钮(拉取远程更新)
437437
JButton pullButton = createGitButton(
438438
I18nUtil.getMessage(MessageKeys.WORKSPACE_GIT_PULL),
439-
"icons/git-pull.svg",
439+
GitOperation.PULL.getIconName(),
440440
e -> performGitOperation(workspace, GitOperation.PULL)
441441
);
442442
toolbar.add(pullButton);
@@ -445,7 +445,7 @@ private JPanel createGitToolbar(Workspace workspace) {
445445
if (remoteStatus.hasUpstream) {
446446
JButton pushButton = createGitButton(
447447
I18nUtil.getMessage(MessageKeys.WORKSPACE_GIT_PUSH),
448-
"icons/git-push.svg",
448+
GitOperation.PUSH.getIconName(),
449449
e -> performGitOperation(workspace, GitOperation.PUSH)
450450
);
451451
toolbar.add(pushButton);

src/main/java/com/laker/postman/panel/workspace/WorkspacePanel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,21 +278,21 @@ private void addStandardGitMenuItems(JPopupMenu menu, Workspace workspace) {
278278

279279
// 1.提交操作 始终显示
280280
JMenuItem commitItem = new JMenuItem(I18nUtil.getMessage(MessageKeys.WORKSPACE_GIT_COMMIT));
281-
commitItem.setIcon(new FlatSVGIcon("icons/save.svg", 16, 16));
281+
commitItem.setIcon(new FlatSVGIcon(GitOperation.COMMIT.getIconName(), 16, 16));
282282
commitItem.addActionListener(e -> performGitCommit(workspace));
283283
menu.add(commitItem);
284284

285285
try {
286286
RemoteStatus remoteStatus = workspaceService.getRemoteStatus(workspace.getId());
287287
if (remoteStatus.hasRemote) { // 2.只有已配置远程仓库的工作区才显示拉取操作
288288
JMenuItem pullItem = new JMenuItem(I18nUtil.getMessage(MessageKeys.WORKSPACE_GIT_PULL));
289-
pullItem.setIcon(new FlatSVGIcon("icons/download.svg", 16, 16));
289+
pullItem.setIcon(new FlatSVGIcon(GitOperation.PULL.getIconName(), 16, 16));
290290
pullItem.addActionListener(e -> performGitPull(workspace));
291291
menu.add(pullItem);
292292

293293
if (remoteStatus.hasUpstream) { // 3.只有有上游分支的工作区才显示推送操作
294294
JMenuItem pushItem = new JMenuItem(I18nUtil.getMessage(MessageKeys.WORKSPACE_GIT_PUSH));
295-
pushItem.setIcon(new FlatSVGIcon("icons/upload.svg", 16, 16));
295+
pushItem.setIcon(new FlatSVGIcon(GitOperation.PUSH.getIconName(), 16, 16));
296296
pushItem.addActionListener(e -> performGitPush(workspace));
297297
menu.add(pushItem);
298298
}

src/main/java/com/laker/postman/panel/workspace/components/GitOperationDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private JPanel createHeaderPanel() {
138138
JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
139139
leftPanel.setOpaque(false);
140140

141-
JLabel operationIcon = new JLabel(new FlatSVGIcon("icons/" + operation.getIconName(), 32, 32));
141+
JLabel operationIcon = new JLabel(new FlatSVGIcon(operation.getIconName(), 32, 32));
142142
operationIcon.setBorder(new EmptyBorder(0, 0, 0, 15));
143143

144144
JPanel textPanel = new JPanel(new GridLayout(2, 1, 0, 5));

src/main/resources/icons/upload.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)