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

"right-of-center" alignment #28

Closed
kinten108101 opened this issue Apr 11, 2023 · 0 comments
Closed

"right-of-center" alignment #28

kinten108101 opened this issue Apr 11, 2023 · 0 comments
Assignees
Labels
bug Something isn't working feature New addition

Comments

@kinten108101
Copy link
Owner

kinten108101 commented Apr 11, 2023

Currently, the omni bar and the run button are grouped into one GtkBox. This, however, means that the omni bar will not be centered to the window's axis.

In GNOME Builder, a custom child type was implemented to solve this issue. This child type, right-of-center, is defined in a template header bar class. We should do the same.

Other solutions are welcomed.

Acceptance criteria

  • Get the omnibar to be centered and other components stick to its sides

Progress

I found out that we can use GtkCenterBox. However, I can't use the center-widget, end-widget, and start-widget props in Blueprint. The doc doesn't mention anything deprecated. I don't know if this is Blueprint's fault or if I'm using the props wrong.

After some digging, I found a workaround. The doc mentioned two way of setting widgets to these positions.

a. Use the method Gtk.CenterBox.set_center_widget etc
b. Assign widget to the center-widget property
c. Set child with type center-wigdet etc, via GtkBuildable

I want the creation of static UI components to be decoupled from app logic so I avoided a. I chose method b but did not work. I forgot method c, and so far it worked.

This is weird. I've always assumed that you can assign things to a property both in UI template and in code.

@kinten108101 kinten108101 added the bug Something isn't working label Apr 11, 2023
@kinten108101 kinten108101 self-assigned this Apr 11, 2023
@kinten108101 kinten108101 added the feature New addition label Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature New addition
Projects
None yet
Development

No branches or pull requests

1 participant