Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change size to GtkWidget with CSS?

I'm trying to create a custom GTK Theme based on Adwaita, but I don't know how to set specific dimensions to some components only using CSS. Example: I want each selector ".titlebar .button" sized to 60x50 pixels. Thanks in advance

like image 519
Luis Daniel Avatar asked Apr 30 '15 02:04

Luis Daniel


1 Answers

You can't. Sizing and positioning are layout properties, and not under the remit of the theming machinery, which is exposed via CSS.

If you could change sizing and position via the theming infrastructure, you'd be able to change the way applications are presented; while this works fine for web pages and the CSS Zen Garden, it does not map to desktop applications.

At most, you can specify CSS margins and padding on top of the existing preferred size of a widget.

If you want to set the minimum size of a GtkWidget, use gtk_widget_set_size_request() from your application code instead.

like image 159
ebassi Avatar answered Sep 27 '22 21:09

ebassi