Skip to content

Commit

Permalink
Use more reasonably sized input fields
Browse files Browse the repository at this point in the history
Fixes #374. Also fixes #371 for real by actually removing the limit from validation.
  • Loading branch information
FWDekker committed May 24, 2021
1 parent 30f9cd3 commit e7dc307
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
</component>
<component id="38ced" class="com.fwdekker.randomness.ui.JIntSpinner" binding="countSpinner" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="65" height="-1"/>
</grid>
</constraints>
<properties>
<name value="count" noi18n="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="9" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="48" y="54" width="602" height="385"/>
<xy x="48" y="54" width="602" height="425"/>
</constraints>
<properties/>
<border type="none"/>
Expand Down Expand Up @@ -33,7 +33,9 @@
</component>
<component id="6a447" class="com.fwdekker.randomness.ui.JDoubleSpinner" binding="minValue" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="260" height="-1"/>
</grid>
</constraints>
<properties>
<name value="minValue" noi18n="true"/>
Expand All @@ -50,7 +52,9 @@
</component>
<component id="7daea" class="com.fwdekker.randomness.ui.JDoubleSpinner" binding="maxValue" custom-create="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="260" height="-1"/>
</grid>
</constraints>
<properties>
<name value="maxValue" noi18n="true"/>
Expand All @@ -67,7 +71,9 @@
</component>
<component id="b93dd" class="com.fwdekker.randomness.ui.JIntSpinner" binding="decimalCount" custom-create="true">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="65" height="-1"/>
</grid>
</constraints>
<properties>
<name value="decimalCount" noi18n="true"/>
Expand Down Expand Up @@ -229,7 +235,7 @@
<component id="a1298" class="javax.swing.JTextField" binding="prefixInput">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
<maximum-size width="65" height="-1"/>
</grid>
</constraints>
<properties>
Expand All @@ -248,7 +254,7 @@
<component id="b8688" class="javax.swing.JTextField" binding="suffixInput">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
<maximum-size width="65" height="-1"/>
</grid>
</constraints>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="9" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="48" y="54" width="455" height="392"/>
<xy x="48" y="54" width="455" height="396"/>
</constraints>
<properties/>
<border type="none"/>
Expand Down Expand Up @@ -33,7 +33,9 @@
</component>
<component id="44ac7" class="com.fwdekker.randomness.ui.JLongSpinner" binding="minValue" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="195" height="-1"/>
</grid>
</constraints>
<properties>
<name value="minValue" noi18n="true"/>
Expand All @@ -50,7 +52,9 @@
</component>
<component id="b9000" class="com.fwdekker.randomness.ui.JLongSpinner" binding="maxValue" custom-create="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="195" height="-1"/>
</grid>
</constraints>
<properties>
<name value="maxValue" noi18n="true"/>
Expand Down Expand Up @@ -84,7 +88,9 @@
</component>
<component id="ad1d8" class="com.fwdekker.randomness.ui.JIntSpinner" binding="base" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="65" height="-1"/>
</grid>
</constraints>
<properties>
<name value="base" noi18n="true"/>
Expand Down Expand Up @@ -222,7 +228,7 @@
<component id="e97b1" class="javax.swing.JTextField" binding="prefixInput">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
<maximum-size width="65" height="-1"/>
</grid>
</constraints>
<properties>
Expand All @@ -241,7 +247,7 @@
<component id="542dc" class="javax.swing.JTextField" binding="suffixInput">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
<maximum-size width="65" height="-1"/>
</grid>
</constraints>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class IntegerSettingsComponent(settings: IntegerSettings = default) :
IntegerScheme.MIN_BASE, IntegerScheme.MAX_BASE,
description = "base"
)
valueRange = JSpinnerRange(minValue, maxValue, Long.MAX_VALUE.toDouble(), "value")
valueRange = JSpinnerRange(minValue, maxValue, maxRange = null, "value")
}

override fun loadScheme(scheme: IntegerScheme) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@
<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>
<labelFor value="1885f"/>
<labelFor value="1885f"/>
<text resource-bundle="randomness" key="settings.minimum_length"/>
</properties>
</component>
<component id="1885f" class="com.fwdekker.randomness.ui.JIntSpinner" binding="minLength" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="65" height="-1"/>
</grid>
</constraints>
<properties>
<name value="minLength" noi18n="true"/>
Expand All @@ -50,7 +52,9 @@
</component>
<component id="ae252" class="com.fwdekker.randomness.ui.JIntSpinner" binding="maxLength" custom-create="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="65" height="-1"/>
</grid>
</constraints>
<properties>
<name value="maxLength" noi18n="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="9" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="726" height="409"/>
<xy x="20" y="20" width="726" height="3401"/>
</constraints>
<properties/>
<border type="none"/>
Expand Down Expand Up @@ -33,7 +33,9 @@
</component>
<component id="8a66f" class="com.fwdekker.randomness.ui.JIntSpinner" binding="minLength" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="65" height="-1"/>
</grid>
</constraints>
<properties>
<name value="minLength" noi18n="true"/>
Expand All @@ -50,7 +52,9 @@
</component>
<component id="2e2f" class="com.fwdekker.randomness.ui.JIntSpinner" binding="maxLength" custom-create="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="65" height="-1"/>
</grid>
</constraints>
<properties>
<name value="maxLength" noi18n="true"/>
Expand Down

0 comments on commit e7dc307

Please sign in to comment.