Skip to content

Commit

Permalink
fix: row height seems to be broken in 3.0 #368
Browse files Browse the repository at this point in the history
  • Loading branch information
SeeSharpSoft committed Nov 14, 2022
1 parent 43a9157 commit 33e3810
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ sourceSets {
apply plugin: 'idea'
idea {
project {
jdkName = JavaVersion.VERSION_11
languageLevel = JavaVersion.VERSION_11
jdkName = JavaVersion.VERSION_17
languageLevel = JavaVersion.VERSION_17
vcs = 'Git'
}
module {
Expand All @@ -79,7 +79,7 @@ apply plugin: 'org.jetbrains.intellij'
intellij {
version = idea_version
type = System.getenv().getOrDefault('IDEA_TYPE', 'IC')
pluginName = 'CSVEditor'
pluginName = 'CSV Editor'
updateSinceUntilBuild = true
sameSinceUntilBuild = true
downloadSources = Boolean.parseBoolean(System.getenv().getOrDefault('IDEA_SOURCES', "true"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@SuppressWarnings("all")
public class CsvEditorSettings implements PersistentStateComponent<CsvEditorSettings.OptionSet> {

public static final int TABLE_EDITOR_ROW_HEIGHT_MIN = 10;
public static final int TABLE_EDITOR_ROW_HEIGHT_MIN = 20;
public static final int TABLE_EDITOR_ROW_HEIGHT_MAX = 100;
public static final int TABLE_EDITOR_ROW_HEIGHT_DEFAULT = 48;
public static final int TABLE_AUTO_MAX_COLUMN_WIDTH_DEFAULT = 300;
Expand Down Expand Up @@ -188,14 +188,13 @@ public void showTableEditorInfoPanel(boolean showInfoPanel) {
}

public int getTableEditorRowHeight() {
// ensure the current state of row height fits the boundaries (which is checked in the setTableEditorRowHeight method
setTableEditorRowHeight(getState().TABLE_EDITOR_ROW_HEIGHT);
return getState().TABLE_EDITOR_ROW_HEIGHT;
}

public void setTableEditorRowHeight(int rowHeight) {
int finalRowHeight = rowHeight;
if (finalRowHeight > TABLE_EDITOR_ROW_HEIGHT_MAX) finalRowHeight = TABLE_EDITOR_ROW_HEIGHT_MAX;
if (finalRowHeight < TABLE_EDITOR_ROW_HEIGHT_MIN) finalRowHeight = TABLE_EDITOR_ROW_HEIGHT_MIN;
getState().TABLE_EDITOR_ROW_HEIGHT = finalRowHeight;
getState().TABLE_EDITOR_ROW_HEIGHT = rowHeight > TABLE_EDITOR_ROW_HEIGHT_MAX || rowHeight < TABLE_EDITOR_ROW_HEIGHT_MIN ? TABLE_EDITOR_ROW_HEIGHT_DEFAULT : rowHeight;
}

public boolean isQuotingEnforced() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Default row height (10-100):"/>
<text value="Default row height in px (20-100):"/>
</properties>
</component>
<hspacer id="48a70">
Expand Down Expand Up @@ -162,7 +162,7 @@
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Default column width (10 - 10000):"/>
<text value="Default column width in px (10 - 10000):"/>
</properties>
</component>
<component id="15921" class="javax.swing.JFormattedTextField" binding="tfDefaultColumnWidth" custom-create="true">
Expand Down Expand Up @@ -193,7 +193,7 @@
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Maximum column width (0 = no maximum):"/>
<text value="Maximum column width in px (0 = no maximum):"/>
</properties>
</component>
<component id="8554c" class="javax.swing.JFormattedTextField" binding="tfMaxColumnWidth" custom-create="true">
Expand Down

0 comments on commit 33e3810

Please sign in to comment.