generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ede78de
commit 600f021
Showing
25 changed files
with
433 additions
and
160 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License | ||
|
||
Copyright (c) 2024 strangelookingnerd | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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
58 changes: 58 additions & 0 deletions
58
src/main/java/com/github/strangelookingnerd/PedroIcons.java
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,58 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2024 strangelookingnerd | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package com.github.strangelookingnerd; | ||
|
||
import com.intellij.ui.scale.JBUIScale; | ||
|
||
import javax.swing.*; | ||
|
||
public final class PedroIcons { | ||
|
||
private static final ImageIcon EMPTY = new ImageIcon(/* used if we can't scale the image */); | ||
private static final ImageIcon PIXEL_ART_PEDRO_16 = new ImageIcon(PedroIcons.class.getResource("/pedro_16.gif"), "Pedro 16x16"); | ||
private static final ImageIcon PIXEL_ART_PEDRO_17 = new ImageIcon(PedroIcons.class.getResource("/pedro_17.gif"), "Pedro 17x17"); | ||
private static final ImageIcon PIXEL_ART_PEDRO_20 = new ImageIcon(PedroIcons.class.getResource("/pedro_20.gif"), "Pedro 20x20"); | ||
private static final ImageIcon PIXEL_ART_PEDRO_24 = new ImageIcon(PedroIcons.class.getResource("/pedro_24.gif"), "Pedro 24x24"); | ||
private static final ImageIcon PIXEL_ART_PEDRO_28 = new ImageIcon(PedroIcons.class.getResource("/pedro_28.gif"), "Pedro 28x28"); | ||
private static final ImageIcon PIXEL_ART_PEDRO_32 = new ImageIcon(PedroIcons.class.getResource("/pedro_32.gif"), "Pedro 32x32"); | ||
|
||
private PedroIcons() { | ||
// hidden | ||
} | ||
|
||
public static ImageIcon getScaledIcon() { | ||
return switch (JBUIScale.scale(100)) { | ||
case 100 -> PIXEL_ART_PEDRO_16; | ||
case 110 -> PIXEL_ART_PEDRO_17; | ||
case 125 -> PIXEL_ART_PEDRO_20; | ||
case 150 -> PIXEL_ART_PEDRO_24; | ||
case 175 -> PIXEL_ART_PEDRO_28; | ||
case 200 -> PIXEL_ART_PEDRO_32; | ||
default -> EMPTY; | ||
}; | ||
} | ||
|
||
} | ||
|
56 changes: 56 additions & 0 deletions
56
src/main/java/com/github/strangelookingnerd/PedroProgressBarListener.java
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,56 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2024 strangelookingnerd | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package com.github.strangelookingnerd; | ||
|
||
import com.intellij.ide.ui.LafManager; | ||
import com.intellij.ide.ui.LafManagerListener; | ||
import com.intellij.openapi.application.ApplicationActivationListener; | ||
import com.intellij.openapi.wm.IdeFrame; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import javax.swing.*; | ||
|
||
public class PedroProgressBarListener implements LafManagerListener, ApplicationActivationListener { | ||
|
||
public PedroProgressBarListener() { | ||
updateProgressBar(); | ||
} | ||
|
||
@Override | ||
public void lookAndFeelChanged(@NotNull LafManager lafManager) { | ||
updateProgressBar(); | ||
} | ||
|
||
@Override | ||
public void applicationActivated(@NotNull IdeFrame ideFrame) { | ||
updateProgressBar(); | ||
} | ||
|
||
private void updateProgressBar() { | ||
UIManager.put("ProgressBarUI", PedroProgressBarUI.class.getName()); | ||
UIManager.getDefaults().put(PedroProgressBarUI.class.getName(), PedroProgressBarUI.class); | ||
} | ||
} | ||
|
Oops, something went wrong.