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

Issue 272 - removing the dependency on pango and cairo #274

Merged
merged 10 commits into from
Jul 16, 2023
Merged

Conversation

sminez
Copy link
Owner

@sminez sminez commented Jul 15, 2023

See #272 for the details for this one. This work was initially done as an MVP in sminez/x11-draw but there are a number of modifications that are required from the code that is there in order to wire it into the statusbar widget behaviour and layout.

Breaking changes

This will be a breaking change for the current API around the status bar as a number of things are tidied up where elements of the cairo and pango APIs had bled through to the public API of penrose_ui (in particular, using floats for offsets and colour representation...).

  • A Draw only supports a single primary font (fontconfig is used to find a suitable fallback for missing glyphs)
  • Method APIs on the Draw and Context structs have been modified to no longer bleed through implementation details from pango and cairo (unless you implemented your own fully custom Widget this should not affect end users)
  • Context is now a reference type with a lifetime, providing a view on the surface assigned to a given window.
  • TextStyle no longer contains font and point size fields: these are set on the Draw
  • TextStyle and individual Widget padding, height and offset fields are now u32 not f64
  • TextStyle is now a Copy type and is passed by value not by reference for all widgets and the status bar
  • Constructing a status bar now requires the font and point size as arguments (given that they have been removed from TextStyle.

One additional breaking change is that the status bar (and a Draw in general) will only support a single font. The examples provided previously only ever used a single font and behaviour when trying to use multiple fonts has never worked correctly so while this is a breaking API change it's not really a loss in (usable) functionality.

Version bump and alignment

There are some changes to the main penrose crate as well so I'm taking this as an opportunity to align the version numbers of penrose and the additional crates going forward. The APIs between penrose_ui / penrose_keysyms and penrose will only be supported for matching version numbers going forward.

@sminez sminez merged commit 020231f into develop Jul 16, 2023
@sminez sminez deleted the issue-272 branch July 16, 2023 07:51
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