Skip to content

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Oct 13, 2020

  • Center contents in a large window
  • Instead of specifying which key names have a newline, automatically line wrap based on size
  • Use gtk::Stack and gtk::StackSwitcher instead of gtk::Notebook
  • Fix a couple issues related to the main loop and properly exiting

The mockup seems to show a gtk::StackSwitcher in the headerbar. #7 is for using gtk::HeaderBar, but that may require a couple additional changes and testing for Windows and macOS.

Slightly more efficient, allows exhaustive matching, etc.
I think it previously looked pretty bad full screen on a large display.
This is an improvement, anyway.
This makes it possible to remove a `@strong` reference, preventing a
reference cycle.

Previously there was a reference cycle because the GTK widget needed a
reference to `KeyboardColorButtonInner` for callbacks, and likewise that
struct contained a reference to `KeyboardColorButtonInner`. The
reference in the callback couldn't be weak, because in some uses it is
expected that `KeyboardColorButton` may be dropped by code using the
type, to just use the GTK widget.

This adds a bit of boilerplate, but it's probably the cleanest way to
avoid reference cycles.

The cycle here prevented the `DaemonClient`'s drop from being called.
This avoids the ugly main loop code, and prevents some error messages
that was causing.
It will no longer allow the label text to press right against the
border. Usually, this means word-wrapping is applied.
There's some ugly use of `get_data()` here...

If we had a GTK widget inheriting `gtk::Fixed` to use in it's place...

GTK is a pain.
This way we can place the `gtk::StackSwitcher` anywhere. For instance,
in the headerbar as the mockup shows.
@ids1024 ids1024 requested a review from jackpot51 October 13, 2020 21:28
@jackpot51
Copy link
Member

With this change, the Access Layer X keys are now taking up 3 rows, and the keys are not sized right because of it.

@ids1024
Copy link
Member Author

ids1024 commented Oct 16, 2020

With this change, the Access Layer X keys are now taking up 3 rows, and the keys are not sized right because of it.

Hm. There is a .set_lines() method to limit the number of lines, but that doesn't seem to work without also using set_ellipsize(). And we don't want it to add an ellipsis.

I also wonder if we'll run into issues on some systems with different font and font size settings.

This seems to be the easiest way to prevent these keys from taking three
lines.

I don't necessarily like dealing with issues using unicode magic like
this, but I guess it makes sense that the space in something like "layer 1"
would be non-breaking.
@ids1024
Copy link
Member Author

ids1024 commented Oct 16, 2020

I've pushed a commit using non-breaking spaces better the word "layer" and the number. Which seems to work.

@jackpot51 jackpot51 merged commit 90cc73a into pop-keyboard_focal Oct 19, 2020
@jackpot51 jackpot51 deleted the design_focal branch October 19, 2020 19:35
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.

2 participants