Skip to content

Commit

Permalink
Fix #24: DecorativeIconPanel's icon size should be changeable
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbylight committed Dec 30, 2022
1 parent a827edc commit 8c74a1e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RSTAUI/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ assert JavaVersion.current().isJava8Compatible()
archivesBaseName = 'rstaui'

dependencies {
api 'com.fifesoft:rsyntaxtextarea:3.3.0'
api 'com.fifesoft:autocomplete:3.3.0'
api 'com.fifesoft:rsyntaxtextarea:3.3.1'
api 'com.fifesoft:autocomplete:3.3.1-SNAPSHOT'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
}
Expand Down
15 changes: 15 additions & 0 deletions RSTAUI/src/main/java/org/fife/rsta/ui/DecorativeIconPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,21 @@ public void setIcon(Icon icon) {
}


/**
* Sets the size of the icon to display. This only needs to be
* called if the icon set being used changes at runtime.
*
* @param iconWidth The new icon size.
*/
public void setIconWidth(int iconWidth) {
if (iconWidth != emptyIcon.getIconWidth()) {
emptyIcon.setSize(iconWidth);
revalidate();
repaint();
}
}


/**
* Toggles whether the icon should be shown.
*
Expand Down

0 comments on commit 8c74a1e

Please sign in to comment.