Skip to content

Commit

Permalink
Rename Menu Items + Fix Help MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
sotasan committed Jun 3, 2022
1 parent 5087225 commit 08ce795
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "net.pryoscode"
version = "0.4.2"
version = "0.4.3"

kotlin {
jvmToolchain {
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/net/pryoscode/decompiler/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Main {
fun main(args: Array<String>) {
System.setProperty("apple.laf.useScreenMenuBar", "true")
System.setProperty("apple.awt.application.name", "Decompiler")
System.setProperty("apple.awt.application.appearance", "NSAppearanceNameAqua")
FlatLightLaf.setup()
Platform.startup {}
Window.run(args)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package net.pryoscode.decompiler.window.menu.file

import net.pryoscode.decompiler.window.menu.file.items.CloseFile
import net.pryoscode.decompiler.window.menu.file.items.CloseTab
import net.pryoscode.decompiler.window.menu.file.items.Exit
import net.pryoscode.decompiler.window.menu.file.items.NewWindow
import net.pryoscode.decompiler.window.menu.file.items.OpenArchive
import net.pryoscode.decompiler.window.menu.file.items.OpenFile
import java.awt.event.KeyEvent
import javax.swing.JMenu
import javax.swing.JSeparator
Expand All @@ -12,8 +12,8 @@ class File : JMenu("File") {

init {
mnemonic = KeyEvent.VK_F
add(OpenArchive())
add(CloseFile())
add(OpenFile())
add(CloseTab())
add(JSeparator())
add(NewWindow())
add(Exit())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import javax.swing.JMenuItem
import javax.swing.KeyStroke
import javax.swing.SwingUtilities

class CloseFile : JMenuItem("Close File", KeyEvent.VK_W), ActionListener {
class CloseTab : JMenuItem("Close Tab", KeyEvent.VK_W), ActionListener {

init {
isEnabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import javax.swing.JMenuItem
import javax.swing.KeyStroke
import javax.swing.filechooser.FileNameExtensionFilter

class OpenArchive : JMenuItem("Open Archive", KeyEvent.VK_O), ActionListener {
class OpenFile : JMenuItem("Open File", KeyEvent.VK_O), ActionListener {

init {
accelerator = KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().menuShortcutKeyMaskEx)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package net.pryoscode.decompiler.window.menu.help

import net.pryoscode.decompiler.window.menu.help.items.About
import java.awt.Desktop
import java.awt.event.KeyEvent
import javax.swing.JMenu

class Help : JMenu("Help") {

init {
mnemonic = KeyEvent.VK_H
isVisible = !Desktop.getDesktop().isSupported(Desktop.Action.APP_ABOUT)
add(About())
}

Expand Down

0 comments on commit 08ce795

Please sign in to comment.