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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSD improvements #893

Merged
merged 3 commits into from
Jun 29, 2023
Merged

OSD improvements #893

merged 3 commits into from
Jun 29, 2023

Conversation

johanmalm
Copy link
Collaborator

@johanmalm johanmalm commented Apr 24, 2023

--EDIT-- This list is now managed at #968

Based on @1qh list in issue #879

  • item height
  • item width
  • item vertical padding
  • focused item border width
  • focused item background and text color
  • possible to hide each of 3 columns
  • position of desktop name (top/bottom)
  • different font size for desktop switcher and window switcher
  • size of the squares in desktop switcher

TODO:

  • Consider s/osd.window-switcher.item.width/osd-window-switcher.width/
  • Consider allowing window-switcher width to be specified as a percentage of output width
  • Calculate window-switcher width based on item-width + padding
  • Take into account output->scale
  • osd.c: simplify the get_title() helper and associated is_title_different()
  • Cope with many nr_items * item_height > output_height
  • Show always on-top windows
  • Consider showing multiple work-spaces in window-switcher (although config might get pretty hard
  • Consider showing window thumbnails 馃槃

Notes:

Have used osd.window-switcher.foo: bar because the window-switcher is only one type of OSD and we might want to set different value for the workspace-switcher for example. If anyone wants to set them to the same, they can simply do osd.*.foo: bar.

@1qh
Copy link

1qh commented Apr 25, 2023

awesome !!

@Consolatis
Copy link
Member

Consolatis commented Apr 25, 2023

Have used osd.window-switcher.foo: bar because the window-switcher is only one type of OSD and we might want to set different value for the workspace-switcher for example. If anyone wants to set them to the same, they can simply do osd.*.foo: bar.

Is this common for the openbox theme format?
For the buttons it is

  • window.active.button.unpressed.image.color: #000000 to set all of them and
  • window.active.button.iconify.unpressed.image.color: #333333 to set individual ones for example.

Thus I think osd.item.width to set all the OSD ones and osd.window-switcher.item.width to set the individual ones would be more consistent.

Edit:
On a related note, is osd.item.width actually the best option here? I'd argue osd.width / osd.window-switcher.width would be better, that would then also work for the workspace OSD.

Edit 2:
For osd.height / osd.window-switcher.height we could use something like for the menu width: osd.height.min and osd.height.max and then calculate the actual size based on the number of items like what we are doing now. And if the result is larger than osd.height.max, remove items until we are under it. That would require some kind of paging but we'd need that anyway to fix

  • Cope with many nr_items * item_height > output_height

Edit 3:

  • Take into account output->scale

That should be done already, we only operate in the unscaled coordinate space and supply the scale to cairo when creating the buffer: output->osd_buffer = buffer_create_cairo(w, h, scale, /* free_on_destroy */ true). That should take care of everything for us, including pango.

@johanmalm
Copy link
Collaborator Author

Thanks for review @Consolatis

Have used osd.window-switcher.foo: bar because the window-switcher is only one type of OSD and we might want to set different value for the workspace-switcher for example. If anyone wants to set them to the same, they can simply do osd.*.foo: bar.

Is this common for the openbox theme format? For the buttons it is

* `window.active.button.unpressed.image.color: #000000` to set all of them and

* `window.active.button.iconify.unpressed.image.color: #333333` to set individual ones for example. 

Thus I think osd.item.width to set all the OSD ones and osd.window-switcher.item.width to set the individual ones would be more consistent.

Well 馃槃 The example you have given is the only think I know of in Openbox 3.6 that is not documented. Only the first version (without iconify) is documented. I suspect that the iconify (and others) version is a later addition and in hindsight would have been better dealt with * - but of course in order to be backward compatible they probably kept the original version and just left the iconify version as some sort of override.

So, I other words, I think the example you have give in an oddity and that now that we have a chance to design the osd hierarchy we ought to go with a clean + consistent approach.

Edit: On a related note, is osd.item.width actually the best option here? I'd argue osd.width / osd.window-switcher.width would be better, that would then also work for the workspace OSD.

100% agree. That is indeed my first TODO bullet, so we're thinking alike. It was just getting to late to re-do last night.

Edit 2: For osd.height / osd.window-switcher.height we could use something like for the menu width: osd.height.min and osd.height.max and then calculate the actual size based on the number of items like what we are doing now. And if the result is larger than osd.height.max, remove items until we are under it. That would require some kind of paging but we'd need that anyway to fix

  • Cope with many nr_items * item_height > output_height

Yep, good idea.

Edit 3:

  • Take into account output->scale

That should be done already, we only operate in the unscaled coordinate space and supply the scale to cairo when creating the buffer: output->osd_buffer = buffer_create_cairo(w, h, scale, /* free_on_destroy */ true). That should take care of everything for us, including pango.

Oh, I forgot. Thanks for reminding me. 馃槉

...and calculate item-height based on font-height

Add theme options
  - osd.window-switcher.width
  - osd.window-switcher.item.padding.x
  - osd.window-switcher.item.padding.y

Issue labwc#879
@johanmalm johanmalm mentioned this pull request Jun 29, 2023
17 tasks
@johanmalm johanmalm marked this pull request as ready for review June 29, 2023 17:03
@johanmalm
Copy link
Collaborator Author

Ready to go from my perspective. Would appreciate review.

@Consolatis
Copy link
Member

Consolatis commented Jun 29, 2023

I didn't verify all the calculations but assuming you tested it while developing this LGTM apart from the comment above regarding the added side effect of draw_cairo_border().

@johanmalm
Copy link
Collaborator Author

johanmalm commented Jun 29, 2023

I didn't verify all the calculations but assuming you tested it while developing this LGTM apart from the comment above regarding the added side effect of draw_cairo_border().

Thanks. Yes, I've tested pretty thoroughly as I've gone.

@johanmalm johanmalm merged commit b200dd2 into labwc:master Jun 29, 2023
5 checks passed
@johanmalm johanmalm deleted the osd-theme branch June 29, 2023 18:14
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.

None yet

3 participants