Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • libhandy libhandy
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 131
    • Issues 131
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Librem5
  • libhandylibhandy
  • Issues
  • #196

Closed
Open
Created Jan 25, 2020 by Adrien Plazas@adrien.plazasOwner

Improve how we load styles

To style widgets, we have many tiny CSS files scattered in the source code, they are loaded and added widget instance by widget instance, and are limited to that widget's node: they won't cascade. That implies that encapsulated widgets wihtin a widget's implementation must load the style too. That's cumbersome and limit what we can do without making the code look insane.

There is another option though: having a single style file and loading it on initialization for the whole screen. We would then just have to track changes of the default screen to automatically reload the style. It has to be done after initializing GTK, or it won't work. We could init GTK in the library constructor and then load the CSS, but there is a problem: there are cases when you need to do things before initializing GTK, e.g. for tests (gtk_test_init() does a few things like calling g_test_init() and then initializes GTK). Also, g_test_init() and hence by extension gtk_test_init() require we pass the command line arguments (NULL isn't valid) so we need to init that in main() somehow.

I see two options:

  • either we keep the status quo and load styles widget per widget,
  • or we add hdy_init() back and hdy_test_init() and load a single style sheet from there.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking