Skip to content

Conversation

@bogas04
Copy link
Contributor

@bogas04 bogas04 commented Sep 14, 2015

Fix for #159

@bogas04
Copy link
Contributor Author

bogas04 commented Sep 14, 2015

The combo box expands as soon as it gets the focus, this temporarily selects the text and then opens the popup!

@hrj
Copy link
Member

hrj commented Sep 14, 2015

Wow, that was fast!

I see that you are addressing OSX as well, and that is welcome. But can you try to push the OSX detection to a global level? You can do the detection in PlatformInit class, and then store the result in a flag / enum. This can help with other OSX issues such as #156.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can factor out the common code like this:

  KeyStroke keystroke = 
    isOsX 
    ? KeyStroke.getKeyStroke(KeyEvent.VK_L, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())
    : KeyStroke.getKeyStroke("ctrl L");

  getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(keystroke, "edit URL");

@bogas04
Copy link
Contributor Author

bogas04 commented Sep 14, 2015

@hrj Thanks a lot for the suggestions! I was wondering where exactly I should put the enum.

BTW there's an issue, can you suggest what can be done about it? #161 (comment)

@bogas04
Copy link
Contributor Author

bogas04 commented Sep 14, 2015

@hrj I kind of screwed up, forgot I was in master branch all this while.

So the latest commit has :

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this mask is used in multiple places, you could define it in PlatformInit and call it CMD_CTRL_KS_MASK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but I felt that it belongs to UX and PlatformInit might not be right place to have it there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good thought. Can you use ComponentSource to host the field then? That seems good enough for current set of changes.

If the mask gets used more widely, we can hoist it up to a larger class like PlatformInit later.

@hrj
Copy link
Member

hrj commented Sep 15, 2015

This is looking great, except for the hack for #157. Let's keep that separate.

About the branch, don't worry. We will use this PR for review and at the end of it, you can create a fresh branch, which is squashed and rebased on master.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename this to CMD_CTRL_KEY_MASK and update the comment to say "mask for keystroke"?

@hrj
Copy link
Member

hrj commented Sep 15, 2015

There is only one minor comment left to address. Rest all looks good.

When you are done, I can help you with rebasing and squashing the commits. Hit me up on Gitter or IRC.

@hrj
Copy link
Member

hrj commented Sep 15, 2015

Superseded by #163

@hrj hrj closed this Sep 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants