Sliders in note panel
authorNiki Roo <niki@nikiroo.be>
Sat, 7 May 2016 13:24:35 +0000 (15:24 +0200)
committerNiki Roo <niki@nikiroo.be>
Sat, 7 May 2016 13:24:35 +0000 (15:24 +0200)
src/be/nikiroo/jvcard/tui/panes/ContactDetails.java
src/be/nikiroo/jvcard/tui/panes/ContactDetailsRaw.java

index 2ea8a9724b80cf6ac777cb37fc75ea08ae7f328c..a221f6b885f5a79a4449d8a584a7a12817e238a7 100644 (file)
@@ -9,8 +9,8 @@ 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.DisplayOption;
 import be.nikiroo.jvcard.resources.enums.StringId;
 import be.nikiroo.jvcard.tui.ImageTextControl;
 import be.nikiroo.jvcard.tui.KeyAction;
@@ -22,9 +22,10 @@ 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 {
@@ -34,7 +35,7 @@ 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;
@@ -66,8 +67,12 @@ public class ContactDetails extends MainContent {
 
                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);
 
index 08c0e4aa503ed2eea4c5de195715a9b5cef38857..c29ba00ec36a099d5a3f118bd88e41c39aba4fca 100644 (file)
@@ -357,7 +357,7 @@ public class ContactDetailsRaw extends MainContentList {
                                valueBuilder.append(data.getValue().replaceAll("\n", "\\\\n"));
                        }
                        if (data.getGroup() != null && data.getGroup().length() > 0) {
-                               valueBuilder.append("(");
+                               valueBuilder.append(" (");
                                valueBuilder.append(data.getGroup());
                                valueBuilder.append(")");
                        }