Skip to content
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

DockTitleBar should be highlighted when it has focus #17

Open
jasons2000 opened this issue Apr 1, 2016 · 4 comments
Open

DockTitleBar should be highlighted when it has focus #17

jasons2000 opened this issue Apr 1, 2016 · 4 comments

Comments

@jasons2000
Copy link

DockTitleBar should be highlighted when it has focus, or when one of its subcomponents has focus. Similar to has Tabs have focus in a TabPane.

@jasons2000
Copy link
Author

just to add, it should probably use the same highlighting effect as used with the TabPane when selecting Tabs

@RobertBColton
Copy link
Owner

RobertBColton commented May 14, 2016

The reason why I did not initially add focus indication is because I was following the Qt Framework docking examples which do not indicate when the title bars have focus. I do see that Unity3D and Visual Studio do indicate the focused dock whether it is a tab or single dock node. Further, both of them use the same focus indication for a single dock node as they do for a tab. In the case of the Unity3D editor though, the dock title area is always drawn as a tab, even when it is by itself.

As a temporary work around you can add the following line to DockTitleBar.java:

this.setFocusTraversable(true);

And add the following in the mouse event handler for the left button of that class:

this.requestFocus();

And style it like this in your stylesheet:

.dock-title-bar:focused {
  -fx-background-color: red;
}

@jasons2000
Copy link
Author

The JIDE framework used to do this. Personally I think this looks
better and draws the eye to the focused window.

Also, with JIDE you could optionally have a single tab dock node appear
as a tab or regular window. I personally don’t like the single tab
look, the ClearControl fork has got this working I think, although its
not optional.

------ Original Message ------
From: "Robert B Colton" notifications@github.com
To: "RobertBColton/DockFX" DockFX@noreply.github.com
Cc: "jasons2000" jshattu@gmail.com; "Author"
author@noreply.github.com
Sent: 14/05/2016 11:14:02
Subject: Re: [RobertBColton/DockFX] DockTitleBar should be highlighted
when it has focus (#17)

The reason why I did not initially add focus indication is because I
following the Qt Framework docking examples which do not indicate when
the title bars have focus. I do see that Unity3D and Visual Studio do
indicate the focused dock whether it is a tab or single dock node.
Further, both of them use the same focus indication for a single dock
node as they do for a tab. In the case of the Unity3D editor though,
the dock title area is always drawn as a tab, even when it is by
itself.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@RobertBColton
Copy link
Owner

Yes I kind of like having the indication myself too, it feels awkward without it and originally I did want to add it. This will take me some time to go read more about the best way to handle the focus. For example, when you actually hit the literal tab key in Visual Studio it only cycles the components on the currently selected dock, so the above will not behave the same as VS. JIDE also seems to be similar to Unity3D in that regard, and I also am not a fan. Visual Studio is my favorite program with docking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants