Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve selection behaviour on focus change #1283

Merged
merged 1 commit into from
Oct 19, 2020
Merged

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Oct 5, 2020

On windows, we persist the existing selection when focus
changes. On mac, the behaviour depends on whether or not there
was a click. If there was a click, we use the click to determine
the selection; otherwise we select the whole buffer.

In addition, on mac, we no longer draw the cursor if the selection
is not a caret.

@cmyr cmyr force-pushed the focus-changed-selection branch from d9b6511 to c8ef792 Compare October 5, 2020 18:36
@cmyr cmyr added the S-blocked waits for another PR or dependency label Oct 5, 2020
@cmyr cmyr force-pushed the text-editor branch 3 times, most recently from 61a2c62 to 8aa9f9a Compare October 7, 2020 18:36
Base automatically changed from text-editor to master October 7, 2020 19:05
@cmyr cmyr force-pushed the focus-changed-selection branch from c8ef792 to 27729cf Compare October 7, 2020 19:06
@cmyr cmyr added S-needs-review waits for review and removed S-blocked waits for another PR or dependency labels Oct 7, 2020
Copy link
Collaborator

@totsteps totsteps left a comment

Choose a reason for hiding this comment

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

Tested on macOS and Linux. LGTM.

@cmyr
Copy link
Member Author

cmyr commented Oct 15, 2020

oops! note to self: I need a changelog for this.

@luleyleo luleyleo added S-waiting-on-author waits for changes from the submitter and removed S-needs-review waits for review labels Oct 17, 2020
On windows, we persist the existing selection when focus
changes. On mac, the behaviour depends on whether or not there
was a click. If there was a click, we use the click to determine
the selection; otherwise we select the whole buffer.

In addition, on mac, we no longer draw the cursor if the selection
is not a caret.

- fixes #1225 (again)

Update druid/src/widget/textbox.rs

Co-authored-by: Leopold Luley <git@leopoldluley.de>
@cmyr cmyr force-pushed the focus-changed-selection branch from 91afd4b to ec048ab Compare October 19, 2020 17:23
@cmyr cmyr merged commit c5df2cb into master Oct 19, 2020
@cmyr cmyr deleted the focus-changed-selection branch October 19, 2020 18:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-author waits for changes from the submitter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants