-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add button for new ui, implement force default while holding shift, v…
…ersion 2.2
- Loading branch information
1 parent
d9a5c7a
commit cff36dc
Showing
9 changed files
with
63 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package icons; | ||
|
||
import com.intellij.ui.IconManager; | ||
|
||
import javax.swing.Icon; | ||
import java.awt.Component; | ||
import java.awt.Graphics; | ||
|
||
public class ResourceIcon implements Icon { | ||
|
||
private final Icon baseIcon; | ||
|
||
public ResourceIcon(String path) { | ||
this.baseIcon = IconManager.getInstance().getIcon(path, ResourceIcon.class); | ||
} | ||
|
||
@Override | ||
public void paintIcon(Component c, Graphics g, int x, int y) { | ||
this.baseIcon.paintIcon(c, g, x, y); | ||
} | ||
|
||
@Override | ||
public int getIconWidth() { | ||
return this.baseIcon.getIconWidth(); | ||
} | ||
|
||
@Override | ||
public int getIconHeight() { | ||
return this.baseIcon.getIconHeight(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,15 @@ | ||
package icons; | ||
|
||
import com.intellij.icons.AllIcons; | ||
import com.intellij.ui.IconManager; | ||
import com.intellij.ui.JBColor; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import javax.swing.Icon; | ||
import java.awt.Color; | ||
import java.awt.Component; | ||
import java.awt.Graphics; | ||
import java.awt.Graphics2D; | ||
|
||
public class SingleHotSwapIcons { | ||
|
||
public static final @NotNull | ||
Icon SINGLE_HOTSWAP = new Icon() { | ||
private final Icon baseIcon = AllIcons.Actions.Compile; | ||
@NotNull | ||
public static final Icon SINGLE_HOTSWAP = new ResourceIcon("/icons/singlehotswap.svg"); | ||
|
||
@Override | ||
public void paintIcon(Component c, Graphics g, int x, int y) { | ||
IconManager.getInstance() | ||
.colorize( | ||
(Graphics2D) g, | ||
this.baseIcon, | ||
new JBColor( | ||
new Color(0x3388FF), | ||
new Color(0x3388FF) | ||
) | ||
).paintIcon(c, g, x, y); | ||
} | ||
@NotNull | ||
public static final Icon SINGLE_HOTSWAP_REDESIGN = new ResourceIcon("/icons/singlehotswap_redesign.svg"); | ||
|
||
@Override | ||
public int getIconWidth() { | ||
return this.baseIcon.getIconWidth(); | ||
} | ||
|
||
@Override | ||
public int getIconHeight() { | ||
return this.baseIcon.getIconHeight(); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<idea-plugin> | ||
<id>net.labymod.intellij.singlehotswap</id> | ||
<name>Single Hotswap</name> | ||
<version>2.1</version> | ||
<version>2.2</version> | ||
<vendor email="[email protected]" url="https://www.labymod.net">LabyMedia</vendor> | ||
|
||
<idea-version since-build="203.000"/> | ||
|
@@ -35,17 +35,29 @@ | |
</extensions> | ||
|
||
<actions> | ||
<action id="org.intellij.sdk.action.PopupDialogAction" | ||
<action id="SingleHotswap" | ||
class="net.labymod.intellij.singlehotswap.actions.SingleHotswapAction" | ||
text="Single Hotswap" description="Hotswap just the opened file" | ||
icon="SingleHotSwapIcons.SINGLE_HOTSWAP"> | ||
<add-to-group anchor="before" group-id="ToolbarRunGroup" | ||
relative-to-action="RunConfiguration"/> | ||
</action> | ||
<action id="SingleHotswapRedesign" | ||
class="net.labymod.intellij.singlehotswap.actions.SingleHotswapAction" | ||
text="Single Hotswap" description="Hotswap just the opened file" | ||
icon="SingleHotSwapIcons.SINGLE_HOTSWAP_REDESIGN"> | ||
<add-to-group anchor="before" group-id="RunToolbarMainActionGroup" | ||
relative-to-action="MoreRunToolbarActions"/> | ||
</action> | ||
</actions> | ||
|
||
<change-notes> | ||
<![CDATA[ | ||
v2.2 (15.12.2022): | ||
<ul> | ||
<li>Added hotswap button to new UI</li> | ||
<li>Added option to force the default compiler when holding shift while clicking on the hotswap button</li> | ||
</ul> | ||
v2.1 (17.07.2022): | ||
<ul> | ||
<li>Fixed support for kotlin & inner classes</li> | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.