Stack Exchange network consists of 177 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
elementary OS Stack Exchange is a question and answer site for developers and users of elementary OS and applications. It only takes a minute to sign up.
I'm trying to create a Window with a HeaderBar, and in the HeaderBar there will be a Switch. But, the switch gets sized vertically, and gets distorted (non proportional), is there some fix?
You need to set its valign property to center:
Gtk.Switch toggle = new Gtk.Switch();
toggle.valign = Gtk.Align.CENTER;
Also, it's worth having a look at Granite.ModeSwitch
EDIT: I strongly recommend Alessandro Castellani's Vala Tutorials. It covers everithing you need to know to get you started.
Required, but never shown