mirror of
https://github.com/chylex/IntelliJ-Pin-Undocked-Tool-Windows.git
synced 2024-11-25 04:42:46 +01:00
Compare commits
No commits in common. "8805ad545d1f77ad53c73067efb0def4aa6d4495" and "8c4d47fab8654d528d48ba58f4e040ca1c6440bd" have entirely different histories.
8805ad545d
...
8c4d47fab8
@ -8,14 +8,14 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.chylex.intellij.pinundockedtoolwindows"
|
||||
version = "1.1.0"
|
||||
version = "1.0.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
intellij {
|
||||
version.set("2024.2")
|
||||
version.set("2023.1")
|
||||
updateSinceUntilBuild.set(false)
|
||||
}
|
||||
|
||||
|
@ -1,20 +1,15 @@
|
||||
package com.chylex.intellij.pinundockedtoolwindows.patch
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnActionHolder
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import java.awt.AWTEvent
|
||||
import java.awt.event.AWTEventListener
|
||||
import java.awt.event.MouseEvent
|
||||
import java.util.Timer
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import javax.swing.AbstractButton
|
||||
import kotlin.concurrent.schedule
|
||||
|
||||
object AwtClickListener : AWTEventListener {
|
||||
private val timer = Timer("Pin Undocked Tool Windows Click Timer", true)
|
||||
private val pressingButtonCounter = AtomicInteger(0)
|
||||
|
||||
val wasPressingButton
|
||||
get() = pressingButtonCounter.get() > 0
|
||||
var wasPressingButton = false
|
||||
private set
|
||||
|
||||
override fun eventDispatched(event: AWTEvent?) {
|
||||
if (event !is MouseEvent || event.id != MouseEvent.MOUSE_RELEASED) {
|
||||
@ -23,8 +18,8 @@ object AwtClickListener : AWTEventListener {
|
||||
|
||||
val source = event.source
|
||||
if (source is AbstractButton || source is AnActionHolder) {
|
||||
pressingButtonCounter.incrementAndGet()
|
||||
timer.schedule(200L) { pressingButtonCounter.decrementAndGet() }
|
||||
wasPressingButton = true
|
||||
ApplicationManager.getApplication().invokeLater { wasPressingButton = false }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,10 +8,6 @@
|
||||
]]></description>
|
||||
|
||||
<change-notes><![CDATA[
|
||||
<b>Version 1.1.0</b>
|
||||
<ul>
|
||||
<li>Allow hiding "Undock" tool windows for longer time after clicking a button.</li>
|
||||
</ul>
|
||||
<b>Version 1.0.0</b>
|
||||
<ul>
|
||||
<li>Prevents "Undock" tool windows from hiding when focus changes.</li>
|
||||
|
Loading…
Reference in New Issue
Block a user