import be.nikiroo.jvcard.Contact;
import be.nikiroo.jvcard.Data;
import be.nikiroo.jvcard.TypeInfo;
-import be.nikiroo.jvcard.resources.StringUtils;
-import be.nikiroo.jvcard.resources.bundles.DisplayBundle;
-import be.nikiroo.jvcard.resources.enums.DisplayOption;
-import be.nikiroo.jvcard.resources.enums.ColorOption;
-import be.nikiroo.jvcard.resources.enums.StringId;
+import be.nikiroo.jvcard.resources.ColorOption;
+import be.nikiroo.jvcard.resources.DisplayBundle;
+import be.nikiroo.jvcard.resources.DisplayOption;
+import be.nikiroo.jvcard.resources.StringId;
import be.nikiroo.jvcard.tui.ImageTextControl;
import be.nikiroo.jvcard.tui.KeyAction;
import be.nikiroo.jvcard.tui.KeyAction.DataType;
import be.nikiroo.jvcard.tui.KeyAction.Mode;
import be.nikiroo.jvcard.tui.UiColors;
+import be.nikiroo.utils.ImageUtils;
+import be.nikiroo.utils.StringUtils;
import com.googlecode.lanterna.TerminalSize;
import com.googlecode.lanterna.gui2.BorderLayout;
import com.googlecode.lanterna.gui2.Borders;
import com.googlecode.lanterna.gui2.Direction;
-import com.googlecode.lanterna.gui2.Label;
import com.googlecode.lanterna.gui2.LinearLayout;
import com.googlecode.lanterna.gui2.Panel;
+import com.googlecode.lanterna.gui2.TextBox;
+import com.googlecode.lanterna.gui2.TextBox.Style;
import com.googlecode.lanterna.input.KeyType;
public class ContactDetails extends MainContent {
private Image image;
private boolean fullscreenImage;
private Panel infoPanel;
- private Label note;
+ private TextBox note;
// from .properties file:
private int labelSize = -1;
notePanel.addComponent(UiColors.createLabel(
ColorOption.VIEW_CONTACT_NOTES_TITLE, "Notes:"));
- note = UiColors.createLabel(ColorOption.VIEW_CONTACT_NORMAL, "");
+ // 10000x10000 is probably enough or "max"
+ note = new TextBox(new TerminalSize(10000, 10000), Style.MULTI_LINE);
+ note.setReadOnly(true);
notePanel.addComponent(note);
+ note.setVerticalFocusSwitching(false);
+ note.setHorizontalFocusSwitching(false);
setContact(contact);
&& encoding.getValue().equalsIgnoreCase("b")) {
try {
- image = StringUtils.toImage(photo.getValue());
+ image = ImageUtils.fromBase64(photo.getValue());
} catch (Exception e) {
System.err.println("Cannot parse image for contact: "
+ contact.getPreferredDataValue("UID"));