Skip to content

Commit

Permalink
Fixed Run Buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Unthrottled committed Apr 22, 2024
1 parent 7246c94 commit 69242e8
Showing 1 changed file with 40 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ object PlatformHacker : Logging {
),
)
val ctClass = cp.get("com.intellij.execution.ui.StopWithDropDownAction")
val doPaintText = ctClass.getDeclaredMethods("update")[0]
doPaintText.instrument(
object : ExprEditor() {
override fun edit(m: MethodCall?) {
if (m?.methodName == "toStrokeIcon") {
m.replace("{ \$_ = \$1; }")
ctClass.getDeclaredMethods("update").forEach { doPaintText ->
doPaintText.instrument(
object : ExprEditor() {
override fun edit(m: MethodCall?) {
if (m?.methodName == "toStrokeIcon") {
m.replace("{ \$_ = \$1; }")
}
}
}
},
)
},
)
}
ctClass.toClass()
}) {
logger().warn("Unable to hack 'fixEXPUIStopButton' for raisins", it)
Expand All @@ -59,16 +60,17 @@ object PlatformHacker : Logging {
),
)
val ctClass = cp.get("com.intellij.execution.ui.RunWidgetButtonLook")
val doPaintText = ctClass.getDeclaredMethods("paintIcon")[0]
doPaintText.instrument(
object : ExprEditor() {
override fun edit(m: MethodCall?) {
if (m?.methodName == "toStrokeIcon") {
m.replace("{ \$_ = \$1; }")
ctClass.getDeclaredMethods("paintIcon").forEach { doPaintText ->
doPaintText.instrument(
object : ExprEditor() {
override fun edit(m: MethodCall?) {
if (m?.methodName == "toStrokeIcon") {
m.replace("{ \$_ = \$1; }")
}
}
}
},
)
},
)
}
ctClass.toClass()
}) {
logger().warn("Unable to hack 'fixEXPUIRunWidget' for raisins", it)
Expand All @@ -82,16 +84,17 @@ object PlatformHacker : Logging {
),
)
val ctClass = cp.get("com.intellij.execution.ui.RedesignedRunConfigurationSelector")
val doPaintText = ctClass.getDeclaredMethods("update")[0]
doPaintText.instrument(
object : ExprEditor() {
override fun edit(m: MethodCall?) {
if (m?.methodName == "toStrokeIcon") {
m.replace("{ \$_ = \$1; }")
ctClass.getDeclaredMethods("update").forEach { doPaintText ->
doPaintText.instrument(
object : ExprEditor() {
override fun edit(m: MethodCall?) {
if (m?.methodName == "toStrokeIcon") {
m.replace("{ \$_ = \$1; }")
}
}
}
},
)
},
)
}
ctClass.toClass()
}) {
logger().warn("Unable to hack 'fixEXPUIRunWidget' try two for raisins", it)
Expand All @@ -107,16 +110,17 @@ object PlatformHacker : Logging {
),
)
val ctClass = cp.get("com.intellij.openapi.wm.impl.SquareStripeButtonLook")
val doPaintText = ctClass.getDeclaredMethods("paintIcon")[0]
doPaintText.instrument(
object : ExprEditor() {
override fun edit(m: MethodCall?) {
if (m?.methodName == "toStrokeIcon") {
m.replace("{ \$_ = \$1; }")
ctClass.getDeclaredMethods("paintIcon").forEach { doPaintText ->
doPaintText.instrument(
object : ExprEditor() {
override fun edit(m: MethodCall?) {
if (m?.methodName == "toStrokeIcon") {
m.replace("{ \$_ = \$1; }")
}
}
}
},
)
},
)
}
ctClass.toClass()
}) {
logger().warn("Unable to hack 'fixEXPUIButton' for raisins", it)
Expand Down

0 comments on commit 69242e8

Please sign in to comment.