-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide caret on focus loss #204
Comments
Hi, isn't it the case already? In your example, the CodeArea does have focus upon startup, so the caret is visible. If you request, e.g., the import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import org.fxmisc.richtext.CodeArea;
public class CodeAreaCaretVisibilityTest extends Application {
public static void main(String[] args) {launch(args);}
@Override
public void start(Stage pStage) {
pStage.setTitle("Test");
CodeArea ca = new CodeArea();
TextArea ta = new TextArea();
TextField tf = new TextField();
final Pane root = new VBox(ca, ta, tf);
pStage.setScene(new Scene(root, 300, 250));
pStage.show();
tf.requestFocus();
}
} |
Oops, you're right. I can't reproduce problem when running with official jars. Only see it with HEAD of richtextfx/reactfx/undofx/flowless/wellbehaved. Apologies; will close this bug. |
Hmm, that is weird, though. It shouldn't happen even when working with the latest sources. |
Just refreshed all from GitHub and am no longer seeing problem. A couple snippets of reactfx/richtextfx code won't compile in Eclipse -- I probably patched locally and broke something in the process. I have this problem all the time when I get too aggressive with lambdas, method references, ternary operators and/or generics. IDEs tend to get confused with type inference and I'll need to add some casts or convert to anonymous class or something. Although your code is technically valid, you might catalyze outside contribution by tweaking tiny number of problematic expressions: StyledTextAreaView.java:
Lists.java
|
I'm using Eclipse and RichTextFX compiles fine in it. My Eclipse JDT version is
|
Strange. When I check for updates, it doesn't even offer me a newer version of JDT. Maybe because I have Eclipse 4.4 and yours is 4.5? |
Well, I am using v4.5.0 (Build ID: 20150621-1200). I'm thoroughly ignorant of how Eclipse decides to update individual components. Probably not worth it to invest a bunch of time into this issue. |
I'm trying out the new version of Eclipse, JDT version
and I do get the first error you report (not the second one, though). To help the type inference, it suffices to change the line : valuesOf(Val.constant(false))) to : EventStreams.valuesOf(Val.constant(false))) (yes, just adding OR to change the line .flatMap(blink -> blink to .<Boolean>flatMap(blink -> blink Does either of those changes make your Eclipse compiler happy? I would prefer one of these instead of type casting proposed above. |
I tested each of your proposed solutions and they both work. |
Thanks, I will go with the first one. |
CodeArea's caret should be hidden when control lacks focus.
The text was updated successfully, but these errors were encountered: