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

Simple shadows for FlatTheme #239

Merged
merged 16 commits into from
Aug 17, 2021
Merged

Simple shadows for FlatTheme #239

merged 16 commits into from
Aug 17, 2021

Conversation

dhardy
Copy link
Collaborator

@dhardy dhardy commented Aug 16, 2021

Implements basic shadows. CC #238, @hummingly.

Contrary to the discussion in #238, these are implemented using simple shaders, without even a mask (just relying on the draw order). Implications:

  • Using custom size, offset and colours (glow effects) is easy
  • Lower GPU load & memory usage, though this is probably irrelevant
  • Shadows may look incorrect with too small margins (e.g. if a button is directly inside a frame, the frame will be drawn over the button's shadow)
  • Sub-menus appear over parents instead of alongside with merged shadows
  • To get outer curvature correct, shadows start inside the shape; with circles they start further inside than frames, hence the strongest visible part of the shadow is fainter on circles
  • Outer curvature is currently squashed/stretched instead of simply offset; I could change this but not sure which is better.

I may leave shadows like this for now, and later implement post-processing only for pop-up menus — though those pop-ups are supposed to be rendered by the system compositor anyway (winit doesn't support this yet).

gallery-shadows

Forgot to show it in the video, but the under-bar on the edit box now has a small shadow too, but only on hover and focus.
edit_bar_shadow

@dhardy
Copy link
Collaborator Author

dhardy commented Aug 17, 2021

I reduced the shadows a bit over the above:
shadows

@dhardy dhardy merged commit 18610a5 into master Aug 17, 2021
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.

1 participant