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

Add ContextMenu to Notification Status Bar item #1211

Merged
merged 15 commits into from
Jan 22, 2020

Conversation

glennsl
Copy link
Member

@glennsl glennsl commented Jan 16, 2020

Although perhaps more importantly, this adds a ContextMenu component for general use.

@glennsl glennsl requested a review from bryphe January 16, 2020 07:20
[@deriving show({with_path: false})]
type item('data) = {
label: string,
// icon: option(IconTheme.IconDefinition.t),
Copy link
Member Author

Choose a reason for hiding this comment

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

IconTheme currently lives in Model. I'm not sure if Core is the right place for it, so for now we'll have to do without.

src/Components/ContextMenu.re Outdated Show resolved Hide resolved
src/Components/ContextMenu.re Outdated Show resolved Hide resolved
src/Components/ContextMenu.re Outdated Show resolved Hide resolved
src/UI/Root.re Show resolved Hide resolved
src/UI/StatusBar.re Outdated Show resolved Hide resolved
src/Model/Notifications.re Show resolved Hide resolved
src/Model/Actions.re Outdated Show resolved Hide resolved
@bryphe
Copy link
Member

bryphe commented Jan 17, 2020

Looks awesome @glennsl !

image

Sorry about the shadow bug (that would help it 'pop' for sure) - i'll look at adding the 'box shadow' style back in Revery as a temporary workaround. Change looks great!

@glennsl
Copy link
Member Author

glennsl commented Jan 18, 2020

/azp run

1 similar comment
@glennsl
Copy link
Member Author

glennsl commented Jan 18, 2020

/azp run

@glennsl glennsl changed the title Add ContextMenu to Notification Status Bar item [WIP] Add ContextMenu to Notification Status Bar item Jan 20, 2020
@glennsl glennsl changed the title [WIP] Add ContextMenu to Notification Status Bar item Add ContextMenu to Notification Status Bar item Jan 21, 2020
Comment on lines +144 to +150
boxShadow(
~xOffset=-5.,
~yOffset=-5.,
~blurRadius=25.,
~spreadRadius=-10.,
~color=Color.rgba(0., 0., 0., 0.0001),
),
Copy link
Member Author

Choose a reason for hiding this comment

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

It works! But it's also kind of broken. The alpha value of the color doesn't seem to be respected, and there seems to be some built-in offset that has to be countered by specifying negative offsets.

I managed to tone it down a bit by adding a negative spread, but it still looks a bit off.

Copy link
Member

Choose a reason for hiding this comment

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

It works!

Hooray! 🎉

But it's also kind of broken. The alpha value of the color doesn't seem to be respected, and there seems to be some built-in offset that has to be countered by specifying negative offsets.

Ya, unfortunately there are bugs and quirks with the current implementation.

Skia will give us a more robust set of primitives for stuff like this!

Copy link
Member Author

@glennsl glennsl Jan 22, 2020

Choose a reason for hiding this comment

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

Thanks for the pointer! Looks like fixing it so the alpha value is taken into account shouldn't be too hard, just pass in a vec4 instead of a vec3 and multiply the alpha value with the blur value. But the offset bug seems trickier. I can't se where that comes from. That's also less of an issue I think though, so it can definitely wait for Skia.

@glennsl
Copy link
Member Author

glennsl commented Jan 21, 2020

@glennsl glennsl requested a review from bryphe January 21, 2020 09:57
@glennsl
Copy link
Member Author

glennsl commented Jan 21, 2020

/azp run

@bryphe
Copy link
Member

bryphe commented Jan 21, 2020

Just tried the latest - looks so much nicer with the drop shadow!

@glennsl glennsl merged commit 39fc1b5 into onivim:master Jan 22, 2020
@glennsl glennsl deleted the feature/ux/context-menu branch January 22, 2020 01:10
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