mirror of
https://github.com/xiaozhou233/OrangeX-Client.git
synced 2026-12-05 13:05:52 +08:00
Fix: StringComponent show trailing chars, remove backspace held-delete
- Show trailing characters with '...' prefix when value exceeds display width - Remove long-press backspace rapid deletion feature - Clean up unused fields and imports
This commit is contained in:
1 parent
4c8e1ae378
commit
c231bba67c
1 file changed
+7
-4
+7
-4
@@ -4,6 +4,7 @@ import cn.xiaozhou233.orangex.OrangeX;
|
||||
import cn.xiaozhou233.orangex.module.option.impl.StringOption;
|
||||
import cn.xiaozhou233.orangex.ui.clickgui.Panel;
|
||||
|
||||
|
||||
public class StringComponent extends OptionComponent {
|
||||
|
||||
private final StringOption option;
|
||||
@@ -49,11 +50,11 @@ public class StringComponent extends OptionComponent {
|
||||
while ((int) OrangeX.getInstance()
|
||||
.getStbFontManager()
|
||||
.getProxima(18)
|
||||
.getStringWidth(value + "...") > maxValueWidth
|
||||
.getStringWidth("..." + value) > maxValueWidth
|
||||
&& value.length() > 0) {
|
||||
value = value.substring(0, value.length() - 1);
|
||||
value = value.substring(1);
|
||||
}
|
||||
value += "...";
|
||||
value = "..." + value;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +66,9 @@ public class StringComponent extends OptionComponent {
|
||||
? 0xff55ffff
|
||||
: 0xffaaaaaa
|
||||
);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +115,6 @@ public class StringComponent extends OptionComponent {
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user