Kahenraz
(Matt D.)
August 12, 2019, 2:11pm
1
I’m working on a theme which adds padding to the notebook widget to allow room for rounded corners. This is due to the fact that frames do not clip their children:
https://gitlab.gnome.org/GNOME/gtk/issues/2075
Therefore I need to add padding. However, I only want padding if tabs are visible. Otherwise it’s just a frame within a frame which looks silly:
Is there a way to set padding for notebook widgets based on whether its tabs are visible?
For example:
notebook (with tabs) {
padding:10px;
}
notebook (without tabs) {
padding:0px;
}
This is how notebooks worked in GTK2. Can this be done in GTK3?
Hi
This is due to the fact that frames do not clip their children:
You could use a GtkViewport.
Therefore I need to add padding.
Why not GtkAlignment?
Is there a way to set padding for notebook widgets based on whether its tabs are visible?
I think it has a minimum size and you should use a viewport, especially using GtkPaned.
Bests,
Joël
Kahenraz
(Matt D.)
August 14, 2019, 8:48am
3
Hello. This question is regarding the modification of a global theme for GTK3 and not about writing an application. The image in my post is of MATE Pluma.
jkraehemann
(Joël Krähemann)
August 14, 2019, 11:35am
4
Here you are:
https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-theme-name
Anyhow, you should respect the widget’s allocation, use a GtkViewport.
ebassi
(Emmanuele Bassi)
August 14, 2019, 1:20pm
5
GObject properties are not style properties, so they cannot be accessed in CSS.
The CSS elements for GtkNotebook are documented, so you can check if the tabs
selector is available and style things accordingly.
Kahenraz
(Matt D.)
August 14, 2019, 2:22pm
6
How can I style notebook {}
by testing for the presence of notebook > header > tabs {}
?
system
(system)
Closed
August 28, 2019, 2:25pm
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.