mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-08-05 19:59:51 +00:00
Compare commits
5 Commits
e5993b8ba1
...
27e591d8a3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27e591d8a3 | ||
|
|
2af3a41bba | ||
|
|
720ac1136a | ||
|
|
8fcd35eb9b | ||
|
|
019bbfae14 |
35
.github/workflows/spotube-release-binary.yml
vendored
35
.github/workflows/spotube-release-binary.yml
vendored
@ -16,6 +16,11 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
debug_ssh:
|
||||
description: 'Enable SSH debug session on failure (tmate)'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@ -149,6 +154,12 @@ jobs:
|
||||
name: android-apk
|
||||
path: Spotube-android-all-arch.apk
|
||||
|
||||
- name: Setup tmate session on failure
|
||||
if: ${{ inputs.debug_ssh && failure() }}
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
with:
|
||||
limit-access-to-actor: true
|
||||
|
||||
build-linux:
|
||||
name: Linux Desktop
|
||||
needs: prepare-deps
|
||||
@ -183,16 +194,14 @@ jobs:
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Package Linux
|
||||
run: ./gradlew :composeApp:packageReleaseDeb :composeApp:packageReleaseRpm :composeApp:packageReleaseAppImage
|
||||
run: ./gradlew :composeApp:packageReleaseDeb :composeApp:packageReleaseRpm
|
||||
|
||||
- name: Rename Linux artifacts
|
||||
run: |
|
||||
DEB_FILE=$(find composeApp/build -name "*.deb" -type f | head -1)
|
||||
RPM_FILE=$(find composeApp/build -name "*.rpm" -type f | head -1)
|
||||
APPIMAGE_FILE=$(find composeApp/build -name "*.AppImage" -type f | head -1)
|
||||
cp "$DEB_FILE" Spotube-linux-x86_64.deb
|
||||
cp "$RPM_FILE" Spotube-linux-x86_64.rpm
|
||||
cp "$APPIMAGE_FILE" Spotube-linux-x86_64.AppImage
|
||||
|
||||
- name: Upload DEB
|
||||
uses: actions/upload-artifact@v4
|
||||
@ -206,11 +215,11 @@ jobs:
|
||||
name: linux-rpm
|
||||
path: Spotube-linux-x86_64.rpm
|
||||
|
||||
- name: Upload AppImage
|
||||
uses: actions/upload-artifact@v4
|
||||
- name: Setup tmate session on failure
|
||||
if: ${{ inputs.debug_ssh && failure() }}
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
with:
|
||||
name: linux-appimage
|
||||
path: Spotube-linux-x86_64.AppImage
|
||||
limit-access-to-actor: true
|
||||
|
||||
build-windows:
|
||||
name: Windows Desktop
|
||||
@ -252,6 +261,12 @@ jobs:
|
||||
name: windows-exe
|
||||
path: Spotube-windows-x86_64-setup.exe
|
||||
|
||||
- name: Setup tmate session on failure
|
||||
if: ${{ inputs.debug_ssh && failure() }}
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
with:
|
||||
limit-access-to-actor: true
|
||||
|
||||
build-macos:
|
||||
name: macOS Desktop
|
||||
needs: prepare-deps
|
||||
@ -294,6 +309,12 @@ jobs:
|
||||
name: macos-dmg
|
||||
path: Spotube-macos-universal.dmg
|
||||
|
||||
- name: Setup tmate session on failure
|
||||
if: ${{ inputs.debug_ssh && failure() }}
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
with:
|
||||
limit-access-to-actor: true
|
||||
|
||||
create-release:
|
||||
name: Create GitHub Release
|
||||
if: ${{ !inputs.dry_run }}
|
||||
|
||||
@ -217,6 +217,23 @@ class SystemTrayService(
|
||||
val loopNone = javax.swing.JRadioButtonMenuItem("Loop: OFF", state.loopState == LoopState.NONE)
|
||||
val loopOne = javax.swing.JRadioButtonMenuItem("Loop: ONE", state.loopState == LoopState.ONE)
|
||||
val loopAll = javax.swing.JRadioButtonMenuItem("Loop: ALL", state.loopState == LoopState.ALL)
|
||||
|
||||
val hoverBackground = UIManager.getColor("MenuItem.selectionBackground") ?: Color(75, 110, 175)
|
||||
|
||||
listOf(loopNone, loopOne, loopAll).forEach { item ->
|
||||
item.isOpaque = true
|
||||
val normalBackground = item.background
|
||||
item.addMouseListener(object : MouseAdapter() {
|
||||
override fun mouseEntered(e: MouseEvent) {
|
||||
item.background = hoverBackground
|
||||
}
|
||||
|
||||
override fun mouseExited(e: MouseEvent) {
|
||||
item.background = normalBackground
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
loopGroup.add(loopNone)
|
||||
loopGroup.add(loopOne)
|
||||
loopGroup.add(loopAll)
|
||||
@ -318,15 +335,47 @@ class SystemTrayService(
|
||||
private fun createMenuItem(label: String, enabled: Boolean = true, action: () -> Unit): JMenuItem {
|
||||
return JMenuItem(label).apply {
|
||||
isEnabled = enabled
|
||||
isOpaque = true
|
||||
maximumSize = Dimension(Int.MAX_VALUE, preferredSize.height)
|
||||
addActionListener { action() }
|
||||
|
||||
val normalBackground = background
|
||||
val hoverBackground = UIManager.getColor("MenuItem.selectionBackground") ?: Color(75, 110, 175)
|
||||
|
||||
addMouseListener(object : MouseAdapter() {
|
||||
override fun mouseEntered(e: MouseEvent) {
|
||||
if (isEnabled) {
|
||||
background = hoverBackground
|
||||
}
|
||||
}
|
||||
|
||||
override fun mouseExited(e: MouseEvent) {
|
||||
background = normalBackground
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private fun createCheckBoxMenuItem(label: String, selected: Boolean, action: () -> Unit): JCheckBoxMenuItem {
|
||||
return JCheckBoxMenuItem(label, selected).apply {
|
||||
isOpaque = true
|
||||
maximumSize = Dimension(Int.MAX_VALUE, preferredSize.height)
|
||||
addActionListener { action() }
|
||||
|
||||
val normalBackground = background
|
||||
val hoverBackground = UIManager.getColor("MenuItem.selectionBackground") ?: Color(75, 110, 175)
|
||||
|
||||
addMouseListener(object : MouseAdapter() {
|
||||
override fun mouseEntered(e: MouseEvent) {
|
||||
if (isEnabled) {
|
||||
background = hoverBackground
|
||||
}
|
||||
}
|
||||
|
||||
override fun mouseExited(e: MouseEvent) {
|
||||
background = normalBackground
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user