| 121 gtk_grid_attach(grid, child, left, top, width, height); |
121 gtk_grid_attach(grid, child, left, top, width, height); |
| 122 gtk_widget_set_hexpand(child, TRUE); |
122 gtk_widget_set_hexpand(child, TRUE); |
| 123 gtk_widget_set_vexpand(child, TRUE); |
123 gtk_widget_set_vexpand(child, TRUE); |
| 124 } |
124 } |
| 125 |
125 |
| |
126 static inline void |
| |
127 gtk_grid_attach_full(GtkGrid *grid, GtkWidget *child, guint left, guint top, |
| |
128 guint width, guint height, GtkAttachOptions xoptions, |
| |
129 GtkAttachOptions yoptions, guint xpadding, guint ypadding) |
| |
130 { |
| |
131 gtk_grid_attach(grid, child, left, top, width, height); |
| |
132 |
| |
133 if (xoptions & GTK_EXPAND) |
| |
134 gtk_widget_set_hexpand(child, TRUE); |
| |
135 if (!(xoptions & GTK_FILL)) |
| |
136 gtk_widget_set_halign(child, GTK_ALIGN_CENTER); |
| |
137 gtk_widget_set_margin_left(child, xpadding); |
| |
138 gtk_widget_set_margin_right(child, xpadding); |
| |
139 |
| |
140 if (yoptions & GTK_EXPAND) |
| |
141 gtk_widget_set_vexpand(child, TRUE); |
| |
142 if (!(yoptions & GTK_FILL)) |
| |
143 gtk_widget_set_valign(child, GTK_ALIGN_CENTER); |
| |
144 gtk_widget_set_margin_top(child, ypadding); |
| |
145 gtk_widget_set_margin_bottom(child, ypadding); |
| |
146 } |
| |
147 |
| 126 #else /* 3.0.0 and gtk_grid_ */ |
148 #else /* 3.0.0 and gtk_grid_ */ |
| 127 |
149 |
| 128 #define GTK_GRID GTK_TABLE |
150 #define GTK_GRID GTK_TABLE |
| 129 #define GtkGrid GtkTable |
151 #define GtkGrid GtkTable |
| 130 |
152 |
| 150 gtk_grid_attach_defaults(GtkGrid *grid, GtkWidget *child, gint left, gint top, |
172 gtk_grid_attach_defaults(GtkGrid *grid, GtkWidget *child, gint left, gint top, |
| 151 gint width, gint height) |
173 gint width, gint height) |
| 152 { |
174 { |
| 153 gtk_table_attach_defaults(grid, child, left, left + width, |
175 gtk_table_attach_defaults(grid, child, left, left + width, |
| 154 top, top + height); |
176 top, top + height); |
| |
177 } |
| |
178 |
| |
179 static inline void |
| |
180 gtk_grid_attach_full(GtkGrid *grid, GtkWidget *child, guint left, guint top, |
| |
181 guint width, guint height, GtkAttachOptions xoptions, |
| |
182 GtkAttachOptions yoptions, guint xpadding, guint ypadding) |
| |
183 { |
| |
184 gtk_table_attach(grid, child, left, left + width, top, top + height, |
| |
185 xoptions, yoptions, xpadding, ypadding); |
| 155 } |
186 } |
| 156 |
187 |
| 157 #endif /* 3.0.0 and gtk_grid_ */ |
188 #endif /* 3.0.0 and gtk_grid_ */ |
| 158 |
189 |
| 159 |
190 |