feat: add help message for removing shortcuts in keymap settings

This commit is contained in:
hstyi
2025-10-30 16:09:47 +08:00
committed by hstyi
parent 4c928ac826
commit 7a8ecb06bf
5 changed files with 13 additions and 4 deletions

View File

@@ -29,8 +29,10 @@ class KeymapPanel : JPanel(BorderLayout()) {
private val copyBtn = JButton(Icons.copy)
private val renameBtn = JButton(Icons.edit)
private val deleteBtn = JButton(Icons.delete)
private val infoBtn = JButton(Icons.questionMark)
private val database get() = DatabaseManager.getInstance()
private val allowKeyCodes = mutableSetOf<Int>()
private val owner get() = SwingUtilities.getWindowAncestor(this)
init {
initView()
@@ -89,8 +91,8 @@ class KeymapPanel : JPanel(BorderLayout()) {
box.add(copyBtn)
box.add(renameBtn)
box.add(deleteBtn)
box.add(infoBtn)
box.add(Box.createHorizontalGlue())
box.border = BorderFactory.createEmptyBorder(0, 0, 6, 0)
add(box, BorderLayout.NORTH)
add(scrollPane, BorderLayout.CENTER)
@@ -105,6 +107,12 @@ class KeymapPanel : JPanel(BorderLayout()) {
}
})
infoBtn.addActionListener {
val color = UIManager.getColor("TextField.placeholderForeground")
val msg = I18n.getString("termora.settings.keymap.question", color.red, color.green, color.blue)
OptionPane.showMessageDialog(owner, msg)
}
copyBtn.addActionListener {
val keymap = getCurrentKeymap()
if (keymap != null) {

View File

@@ -114,7 +114,7 @@ termora.settings.keymap=Keymap
termora.settings.keymap.shortcut=Shortcut
termora.settings.keymap.action=Action
termora.settings.keymap.already-exists=The shortcut [{0}] is already in use by [{1}]
termora.settings.keymap.question=Select a line, press the <font color=rgb({0},{1},{2})> ⌫ (Backspace)</font> key to remove the shortcut
termora.settings.sftp.edit-command=Edit Command
termora.settings.sftp.db-click-behavior=Double-click

View File

@@ -99,7 +99,7 @@ termora.settings.keymap=Горяиче клавиши
termora.settings.keymap.shortcut=Комбинация
termora.settings.keymap.action=Команда
termora.settings.keymap.already-exists=Комбинация [{0}] уже используется [{1}]
termora.settings.keymap.question=Выберите строку и нажмите <font color=rgb({0},{1},{2})> ⌫ (клавишу Backspace)</font>, чтобы удалить сочетание клавиш
termora.settings.sftp.edit-command=Редактировать команду
termora.settings.sftp.db-click-behavior=двойной щелчок

View File

@@ -125,7 +125,7 @@ termora.settings.keymap=键盘
termora.settings.keymap.shortcut=快捷键
termora.settings.keymap.action=操作
termora.settings.keymap.already-exists=快捷键 [{0}] 已经被 [{1}] 占用
termora.settings.keymap.question=选中一行,按下 <font color=rgb({0},{1},{2})> ⌫ (退格键)</font> 移除快捷键
termora.settings.sftp.edit-command=编辑命令
termora.settings.sftp.db-click-behavior=双击行为

View File

@@ -55,6 +55,7 @@ termora.settings.keymap=鍵盤
termora.settings.keymap.shortcut=快捷鍵
termora.settings.keymap.action=操作
termora.settings.keymap.already-exists=快捷鍵 [{0}] 已經被 [{1}] 占用
termora.settings.keymap.question=選取一行,按下 <font color=rgb({0},{1},{2})> ⌫ (退格鍵)</font> 移除快速鍵
termora.settings.sftp.edit-command=編輯命令
termora.settings.sftp.db-click-behavior=按兩下行為