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

Slider upgrade #1979

Merged
merged 1 commit into from
Jan 5, 2022
Merged

Slider upgrade #1979

merged 1 commit into from
Jan 5, 2022

Conversation

xarvic
Copy link
Collaborator

@xarvic xarvic commented Sep 18, 2021

Adding RangeSlider and Annotated.
Adding options track_color, axis, knob_style and annotated on Slider and RangeSlider.
image

@xarvic xarvic requested a review from PoignardAzur September 18, 2021 21:34
@jneem
Copy link
Collaborator

jneem commented Oct 3, 2021

Is there something I can do here to help? I'm not particularly familiar with the slider, but if @PoignardAzur is otherwise busy, I can take a look.

Copy link
Collaborator

@PoignardAzur PoignardAzur left a comment

Choose a reason for hiding this comment

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

Sorry, I looked at the code, meant to write a review, but I forgot about it.

Overall, I think the code is pretty good. It's clean, it's mostly straightforward, no major flaw stands out.

Some additional notes:

  • The druid codebase tries to avoid merge commits. You should probably rebase your PR onto master, and batch the changes into fewer commits while you're at it.
  • You need to add a short description your example to druid/examples/readme.md.

Overall, I think this code is ready to merge. The big blockers are the problem of low step values with Annotated and the examples/ readme. All the other changes I suggest are nice-to-haves.

druid/src/widget/slider.rs Outdated Show resolved Hide resolved
druid/src/widget/slider.rs Show resolved Hide resolved
druid/src/widget/slider.rs Show resolved Hide resolved
druid/src/widget/slider.rs Show resolved Hide resolved
@PoignardAzur
Copy link
Collaborator

@jneem I'm not too occupied, I just procrastinated on it. But thanks for the offer. =)

@xarvic
Copy link
Collaborator Author

xarvic commented Nov 23, 2021

Thanks for your review and sorry that it took so long, i was quite busy lately.

I addressed all of your suggested changes except the merge commits. Can i get rid of them by squash-merging the branch? These commits were created by Github, after resolving the merge conflicts is there another way to resolve merge commits without creating merge-commits?

The other thing i dont understand is this error:

   Compiling druid-shell v0.7.0 (/Users/runner/work/druid/druid/druid-shell)
error: use of deprecated macro `test`: test-env-log has been renamed to test-log; use it instead
Error:    --> druid-shell/src/backend/mac/menu.rs:185:7
    |
185 |     #[test]
    |       ^^^^
    |
    = note: `-D deprecated` implied by `-D warnings`

error: use of deprecated macro `test`: test-env-log has been renamed to test-log; use it instead
Error:   --> druid-shell/src/backend/mac/screen.rs:87:7
   |
87 |     #[test]
   |       ^^^^

error: use of deprecated macro `test`: test-env-log has been renamed to test-log; use it instead
Error:   --> druid-shell/src/backend/mac/screen.rs:94:7
   |
94 |     #[test]
   |       ^^^^

error: use of deprecated macro `test`: test-env-log has been renamed to test-log; use it instead
Error:    --> druid-shell/src/backend/mac/screen.rs:113:7
    |
113 |     #[test]
    |       ^^^^

error: could not compile `druid-shell` due to 4 previous errors
Error: warning: build failed, waiting for other jobs to finish...
error: build failed
Error: The process '/Users/runner/.cargo/bin/cargo' failed with exit code 101

I didn't changed anything in druid_shell. Has is something to do with merging?

I am not a Git expert any advice with these two things is appreciated :)

@CryZe
Copy link
Contributor

CryZe commented Nov 23, 2021

Feel free to cherry-pick this commit that fixes the CI issue: db7faff

@jneem
Copy link
Collaborator

jneem commented Dec 30, 2021

What's the status of this? I'm happy to do the squash/rebase if it's all that's needed.

@jneem
Copy link
Collaborator

jneem commented Jan 4, 2022

@PoignardAzur ?

@PoignardAzur
Copy link
Collaborator

Oh, sorry.

I'm currently busy catching up on other work, so if you want to take responsibility for this PR, feel free =)

Just ping me once you need it merged.

@xarvic
Copy link
Collaborator Author

xarvic commented Jan 5, 2022

What's the status of this? I'm happy to do the squash/rebase if it's all that's needed.

Yes, thank you. The problem is i used merge commits to update my fork and i don't know how to remove them from this PR and i need to cherry-pick db7faff but i don't know how that works.

@jneem
Copy link
Collaborator

jneem commented Jan 5, 2022

No problem, I can probably handle it today. Any objections if I just modify this PR directly?

@xarvic
Copy link
Collaborator Author

xarvic commented Jan 5, 2022

No, that's fine, thanks :)

@jneem jneem force-pushed the slider-upgrade-2 branch from d7247ed to 6430bf8 Compare January 5, 2022 17:22
@jneem jneem dismissed PoignardAzur’s stale review January 5, 2022 17:25

I think these changes have been made already

Makes color, axis, and knob style configuration, and adds annotations.
@jneem jneem force-pushed the slider-upgrade-2 branch from 6430bf8 to f205c31 Compare January 5, 2022 17:26
Copy link
Collaborator

@jneem jneem left a comment

Choose a reason for hiding this comment

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

Ok, I think the git/CI issues are resolved now.

@jneem
Copy link
Collaborator

jneem commented Jan 5, 2022

For future reference, it's best not to merge changes from the main branch into a PR: it creates duplicate commits, because when git merges it creates new commits that "look like" the original commits but have different ids. And then when you try to merge back there are multiple commits all trying to do the same thing.

The fix was:

$ git rebase -i 8fc3e5f105d0
(then select only the commits that were relevant to this PR. This creates a clean history, but based on the (old) commit 8fc3e5f105d0)
$ git rebase master
(this rebases the clean history so that it's on the current, up-to-date master)

(Edit: sorry, I just realized from scrolling up that you already know about the issue with merge commits. Didn't mean to pile on 😄)

@jneem jneem merged commit 9bfdaf8 into linebender:master Jan 5, 2022
@xarvic
Copy link
Collaborator Author

xarvic commented Jan 6, 2022

Thanks a lot. I am going to try to understand what you did there :)

@PoignardAzur
Copy link
Collaborator

git rebase -i is very user-friendly. It pops up a file with a list of commands that explains to you what it does =)

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.

5 participants