Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
strangelookingnerd committed Jun 10, 2024
1 parent ede78de commit 600f021
Show file tree
Hide file tree
Showing 25 changed files with 433 additions and 160 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Keep a Changelog guide -> https://keepachangelog.com -->

# pedro-progress-bar-plugin Changelog
# pedro-progress-bar Changelog

## [Unreleased]
### Added
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
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.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# pedro-progress-bar-plugin

![Build](https://github.com/strangelookingnerd/pedro-progress-bar-plugin/workflows/Build/badge.svg)
[![Version](https://img.shields.io/jetbrains/plugin/v/PLUGIN_ID.svg)](https://plugins.jetbrains.com/plugin/PLUGIN_ID)
[![Downloads](https://img.shields.io/jetbrains/plugin/d/PLUGIN_ID.svg)](https://plugins.jetbrains.com/plugin/PLUGIN_ID)
[![Version](https://img.shields.io/jetbrains/plugin/v/com.github.strangelookingnerd:pedro-progress-bar.svg)](https://plugins.jetbrains.com/plugin/com.github.strangelookingnerd:pedro-progress-bar)
[![Downloads](https://img.shields.io/jetbrains/plugin/d/com.github.strangelookingnerd:pedro-progress-bar.svg)](https://plugins.jetbrains.com/plugin/com.github.strangelookingnerd:pedro-progress-bar)

## Template ToDo list
- [x] Create a new [IntelliJ Platform Plugin Template][template] project.
- [ ] Get familiar with the [template documentation][template].
- [ ] Adjust the [pluginGroup](./gradle.properties), [plugin ID](./src/main/resources/META-INF/plugin.xml) and [sources package](./src/main/kotlin).
- [x] Adjust the [pluginGroup](./gradle.properties), [plugin ID](./src/main/resources/META-INF/plugin.xml) and [sources package](./src/main/kotlin).
- [ ] Adjust the plugin description in `README` (see [Tips][docs:plugin-description])
- [ ] Review the [Legal Agreements](https://plugins.jetbrains.com/docs/marketplace/legal-agreements.html?from=IJPluginTemplate).
- [ ] [Publish a plugin manually](https://plugins.jetbrains.com/docs/intellij/publishing-plugin.html?from=IJPluginTemplate) for the first time.
- [ ] Set the `PLUGIN_ID` in the above README badges.
- [x] Set the `PLUGIN_ID` in the above README badges.
- [ ] Set the [Plugin Signing](https://plugins.jetbrains.com/docs/intellij/plugin-signing.html?from=IJPluginTemplate) related [secrets](https://github.com/JetBrains/intellij-platform-plugin-template#environment-variables).
- [ ] Set the [Deployment Token](https://plugins.jetbrains.com/docs/marketplace/plugin-upload.html?from=IJPluginTemplate).
- [ ] Click the <kbd>Watch</kbd> button on the top of the [IntelliJ Platform Plugin Template][template] to be notified about releases containing new features and fixes.
Expand Down
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ tasks {
gradleVersion = properties("gradleVersion").get()
}

buildSearchableOptions {
enabled = false
}

patchPluginXml {
version = properties("pluginVersion")
sinceBuild = properties("pluginSinceBuild")
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html

pluginGroup = com.github.strangelookingnerd.pedroprogressbarplugin
pluginName = pedro-progress-bar-plugin
pluginGroup = com.github.strangelookingnerd
pluginName = pedro-progress-bar
pluginRepositoryUrl = https://github.com/strangelookingnerd/pedro-progress-bar-plugin
# SemVer format -> https://semver.org
pluginVersion = 0.0.1
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

rootProject.name = "pedro-progress-bar-plugin"
rootProject.name = "pedro-progress-bar"
58 changes: 58 additions & 0 deletions src/main/java/com/github/strangelookingnerd/PedroIcons.java
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;
};
}

}

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);
}
}

Loading

0 comments on commit 600f021

Please sign in to comment.