friedow / centerpiece

Your trusty omnibox search.
MIT License
174 stars 6 forks source link

Add font configuration settings #143

Open pinpox opened 1 month ago

pinpox commented 1 month ago

Work in progress. I added the requered fields, but it still fails to build with:

   Compiling centerpiece v1.0.0 (/home/pinpox/code/github.com/pinpox/centerpiece/client)
error[E0597]: `settings.font.default` does not live long enough
   --> client/src/main.rs:279:46
    |
276 |         let settings = crate::settings::Settings::new();
    |             -------- binding `settings` declared here
...
279 |             family: iced::font::Family::Name(&settings.font.default),
    |                                              ^^^^^^^^^^^^^^^^^^^^^^
    |                                              |
    |                                              borrowed value does not live long enough
    |                                              this usage requires that `settings.font.default` is borrowed for `'static`
...
309 |     }
    |     - `settings.font.default` dropped here while still borrowed

For more information about this error, try `rustc --explain E0597`.
error: could not compile `centerpiece` (bin "centerpiece") due to previous error

I've tested just setting a different hardcoded string for the font name and it works nicely if the font is present on the system. I added a setting that default to the current font (Fira).

friedow commented 1 week ago

@pinpox you need any help on this?

pinpox commented 9 hours ago

Sorry, I've been quite busy the last weeks. I'll get back to it when I find the time.