Luis Daniel
Luis Daniel

Reputation: 717

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

Upvotes: 8

Views: 3599

Answers (1)

ebassi
ebassi

Reputation: 8815

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.

Upvotes: 9

Related Questions