Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User can now add custom icons, path ignore regex now works on relative path to project base dir #21

Merged
merged 15 commits into from
Feb 19, 2020

Conversation

Sheigutn
Copy link
Contributor

@Sheigutn Sheigutn commented Feb 18, 2020

It's now possible to add custom icons in the settings (#7), the dialogs I added can also be used to modify plugin models in the future. (#9)

I also changed the regex textfield in the settings to an EditorTextField, so it now also highlights the regex. The regex also matches the relative path to the project base directory now, not just parent/filename.

The settings now look as follows, there's a new JTabbedPane that divides plugin and user icons:

java_JMMAwXtmXR
java_aFHc3a7TpM

Upon clicking the add button in the user icons tab, a new dialog opens:

image

It's possible to set a description, a type, and add an icon (.svg, .png) via the Choose icon button that opens a new file chooser.

When the + button in the conditions tab is clicked, this dialog opens:

image

It allows the user to create a new model condition, the regex textfield is a syntax highlighted field as well, and the regex is being checked in doValidate() of the DialogWrapper class.

After adding a description, selecting a type, adding an icon and adding at least one condition, the model will be added to the custom model list. The icon is serialized to Base64 (for SVG, the original file will be encoded, for PNG a 16px or 32px big image will be encoded). The resulting models don't have an ID because they can be disabled / enabled by setting the re-introduced enabled variable in the Model class.

I also added a new checkbox in the Project settings that allows to either append the user icons on the project level to the user icons on the IDE level, and it is selected by default. If it's deselected, the user icons on the IDE level will be ignored and just the ones on the project level will be used:

image

isModified in SettingsForm is now calculated on the fly instead of utilizing a modified field.

Lastly I added a new field to model that allows to use IntelliJ icon objects in the Model and I used it for the angular.json file. (It now uses IntelliJ's AngularJSIcons.Angular2 icon)

The only bug that I found was that the enabled state for user icons gets reset if you don't press apply after clicking checkboxes but not clicking apply before adding or editing models.

@jonathanlermitage
Copy link
Owner

Great work, thx!!

@jonathanlermitage jonathanlermitage merged commit 624ea25 into jonathanlermitage:master Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants