Skip to content

Commit

Permalink
Merge pull request #541 from FWDekker/computed-before-call
Browse files Browse the repository at this point in the history
Update icon instantiation
  • Loading branch information
FWDekker authored Sep 28, 2024
2 parents 2647582 + 079b277 commit 73557f1
Show file tree
Hide file tree
Showing 24 changed files with 66 additions and 52 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
### Added
* Added even more debug info for future reports relating to issue [#R1](https://github.com/FWDekkerBot/intellij-randomness-issues/issues/1).

### Changed
* Changed icon instantiation to be more in line with guidelines, hopefully fixing [#R13](https://github.com/FWDekkerBot/intellij-randomness-issues/issues/13).


## 3.3.1 -- 2024-05-06
### Added
Expand All @@ -24,7 +27,7 @@
* Disabled dynamic reloading of the plugin until a stable fix can be deployed. ([#522](https://github.com/FWDekker/intellij-randomness/pull/522))

### Fixed
* Various incorrect uses of the platform API. ([#526](https://github.com/FWDekker/intellij-randomness/issues/526))
* Fixed various incorrect uses of the platform API. ([#526](https://github.com/FWDekker/intellij-randomness/issues/526))


## 3.2.0 -- 2024-01-10
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/fwdekker/randomness/Bundle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ object Bundle {
fun String.matchesFormat(format: String, vararg args: String) =
Regex("%[0-9]+\\\$[Ssd]").findAll(format)
.toList()
.reversed()
.asReversed()
.fold(format) { acc, match ->
if (match.value.drop(1).dropLast(2).toInt() > args.size)
acc.replaceRange(match.range, ".*")
Expand Down
33 changes: 22 additions & 11 deletions src/main/kotlin/com/fwdekker/randomness/Icons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,57 +18,68 @@ object Icons {
/**
* The main icon of Randomness.
*/
val RANDOMNESS get() = IconLoader.getIcon("/icons/randomness.svg", this.javaClass.classLoader)
@JvmField
val RANDOMNESS = IconLoader.getIcon("/icons/randomness.svg", javaClass)

/**
* The template icon for template icons.
*/
val TEMPLATE get() = IconLoader.getIcon("/icons/template.svg", this.javaClass.classLoader)
@JvmField
val TEMPLATE = IconLoader.getIcon("/icons/template.svg", javaClass)

/**
* The template icon for scheme icons.
*/
val SCHEME get() = IconLoader.getIcon("/icons/scheme.svg", this.javaClass.classLoader)
@JvmField
val SCHEME = IconLoader.getIcon("/icons/scheme.svg", javaClass)

/**
* An icon for settings.
*/
val SETTINGS get() = IconLoader.getIcon("/icons/settings.svg", this.javaClass.classLoader)
@JvmField
val SETTINGS = IconLoader.getIcon("/icons/settings.svg", javaClass)

/**
* A filled-in version of [SETTINGS].
*/
val SETTINGS_FILLED get() = IconLoader.getIcon("/icons/settings-filled.svg", this.javaClass.classLoader)
@JvmField
val SETTINGS_FILLED = IconLoader.getIcon("/icons/settings-filled.svg", javaClass)

/**
* An icon for arrays.
*/
val ARRAY get() = IconLoader.getIcon("/icons/array.svg", this.javaClass.classLoader)
@JvmField
val ARRAY = IconLoader.getIcon("/icons/array.svg", javaClass)

/**
* A filled-in version of [ARRAY].
*/
val ARRAY_FILLED get() = IconLoader.getIcon("/icons/array-filled.svg", this.javaClass.classLoader)
@JvmField
val ARRAY_FILLED = IconLoader.getIcon("/icons/array-filled.svg", javaClass)

/**
* An icon for references.
*/
val REFERENCE get() = IconLoader.getIcon("/icons/reference.svg", this.javaClass.classLoader)
@JvmField
val REFERENCE = IconLoader.getIcon("/icons/reference.svg", javaClass)

/**
* A filled-in version of [REFERENCE].
*/
val REFERENCE_FILLED get() = IconLoader.getIcon("/icons/reference-filled.svg", this.javaClass.classLoader)
@JvmField
val REFERENCE_FILLED = IconLoader.getIcon("/icons/reference-filled.svg", javaClass)

/**
* An icon for repeated insertions.
*/
val REPEAT get() = IconLoader.getIcon("/icons/repeat.svg", this.javaClass.classLoader)
@JvmField
val REPEAT = IconLoader.getIcon("/icons/repeat.svg", javaClass)

/**
* A filled-in version of [REPEAT].
*/
val REPEAT_FILLED get() = IconLoader.getIcon("/icons/repeat-filled.svg", this.javaClass.classLoader)
@JvmField
val REPEAT_FILLED = IconLoader.getIcon("/icons/repeat-filled.svg", javaClass)
}


Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<!-- Non-dynamic actions -->
<actions resource-bundle="randomness">
<action id="com.fwdekker.randomness.PopupAction" class="com.fwdekker.randomness.PopupAction"
icon="/icons/randomness.svg">
icon="com.fwdekker.randomness.Icons.RANDOMNESS">
<keyboard-shortcut first-keystroke="alt R" keymap="$default" />
<add-to-group group-id="GenerateGroup" anchor="last" />
<add-to-group group-id="ToolsMenu" anchor="last" />
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/icons/array-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/array.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/array_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/popup-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/popup.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/popup_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/randomness.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/reference-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/reference.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/reference_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/repeat-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/repeat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/resources/icons/repeat_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 73557f1

Please sign in to comment.