-
Notifications
You must be signed in to change notification settings - Fork 835
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
Refactor main bar inputs #528
Conversation
width: PropTypes.number, | ||
height: PropTypes.number, | ||
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a bit dirty that width
can be both a number and a string...
@sindresorhus updated 👍 |
I still see some weird behavior even with this PR. I'm gonna include my feedback here, but I would be happy to move some of the points over to a new issue if you feel they're out of scope for this PR:
|
These are good points. We've talked about most of them in the past and I've worked on some but last time I did was when I first started the re-write. I'll work on it a bit more, see how it goes, and if it seems like it's going to be a lot of extra work, I'll see about splitting into two PRs |
This also fixes #539 now |
@@ -85,6 +97,18 @@ MainControls.Left = connect( | |||
)(Left); | |||
|
|||
class Right extends React.Component { | |||
icon = React.createRef(); | |||
|
|||
openMenu = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should really make a reusable component for this as a Electron dropdown menu like this is used in many places.
@karaggeorge In #528 (comment), can you check the things you've fixed? |
@sindresorhus it's all of them (hopefully) 😄 I went ahead and checked them though Also, for the ratio menu I used the |
Not cursor, but yes it's common practise to show it under the element that triggered the menu. It needs to be better aligned though. When the menu is open, the active menu item should be vertically centered to our white dropdown widget. Example: Notice how the active menu item is vertically centered with the dropdown button. |
Doesn't look like this is done. If I select an item in the aspect ratio dropdown, the lock button is not highlighted. |
I can't recreate the issue @sindresorhus is having when clicking the menubar icon, I can however confirm that selecting an spect ratio does not lock the dimensions, which I think it should. Overall this is such a massive improvement, after testing the branch for a few days I haven't had a single issue with it and it feels great to use. The only thing I might add is for the inputs to only allow number input, however that's not really common practice. In a future update a nice to have would be the ability to do simple math in the inputs, e.g. 64+64 would change the input to 128 on enter/blur. |
@karaggeorge Can you fix the merge conflict? |
I'm no longer getting the |
The only thing left is #528 (comment) |
@sindresorhus I'll fix the merge conflicts when I get some down-time. About the other comment, I tried to get it as close to centered as I could. Bringing it one more pixel makes it even worse. Any idea of a consistent way to do it? |
Hmm, actually it looks enough for me now. Must have been something weird when I tried earlier as I could swear it was not aligned then. |
Should be all good. Also, I found a bug where the validation was pulling the |
Looks great! |
Aims to fix the weird behaviors experienced with the main bar width/height/ratio inputs
Fixes #539