188 |
188 |
189 if(!simple) { |
189 if(!simple) { |
190 ui_fill_headerbar(obj, headerbar); |
190 ui_fill_headerbar(obj, headerbar); |
191 } |
191 } |
192 #elif GTK_MAJOR_VERSION >= 4 |
192 #elif GTK_MAJOR_VERSION >= 4 |
|
193 GtkWidget *content_box = ui_gtk_vbox_new(0); |
193 WINDOW_SET_CONTENT(obj->widget, vbox); |
194 WINDOW_SET_CONTENT(obj->widget, vbox); |
194 #else |
195 if(sidebar) { |
195 gtk_container_add(GTK_CONTAINER(obj->widget), vbox); |
196 GtkWidget *paned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL); |
196 |
197 GtkWidget *sidebar_vbox = ui_gtk_vbox_new(0); |
|
198 gtk_paned_set_start_child(GTK_PANED(paned), sidebar_vbox); |
|
199 gtk_paned_set_end_child(GTK_PANED(paned), content_box); |
|
200 BOX_ADD_EXPAND(GTK_BOX(vbox), paned); |
|
201 g_object_set_data(G_OBJECT(obj->widget), "ui_sidebar", sidebar_vbox); |
|
202 } else { |
|
203 BOX_ADD_EXPAND(GTK_BOX(vbox), content_box); |
|
204 } |
|
205 #else |
197 if(!simple) { |
206 if(!simple) { |
198 // menu |
207 // menu |
199 if(uic_get_menu_list()) { |
208 if(uic_get_menu_list()) { |
200 GtkWidget *mb = ui_create_menubar(obj); |
209 GtkWidget *mb = ui_create_menubar(obj); |
201 if(mb) { |
210 if(mb) { |
212 } |
221 } |
213 |
222 |
214 //GtkWidget *hb = ui_create_headerbar(obj); |
223 //GtkWidget *hb = ui_create_headerbar(obj); |
215 //gtk_window_set_titlebar(GTK_WINDOW(obj->widget), hb); |
224 //gtk_window_set_titlebar(GTK_WINDOW(obj->widget), hb); |
216 } |
225 } |
|
226 |
|
227 GtkWidget *content_box = ui_gtk_vbox_new(0); |
|
228 WINDOW_SET_CONTENT(obj->widget, vbox); |
|
229 if(sidebar) { |
|
230 GtkWidget *paned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL); |
|
231 GtkWidget *sidebar_vbox = ui_gtk_vbox_new(0); |
|
232 gtk_paned_add1(GTK_PANED(paned), sidebar_vbox); |
|
233 gtk_paned_add2(GTK_PANED(paned), content_box); |
|
234 BOX_ADD_EXPAND(GTK_BOX(vbox), paned); |
|
235 g_object_set_data(G_OBJECT(obj->widget), "ui_sidebar", sidebar_vbox); |
|
236 } else { |
|
237 BOX_ADD_EXPAND(GTK_BOX(vbox), content_box); |
|
238 } |
|
239 |
217 #endif |
240 #endif |
218 |
241 |
219 // window content |
242 // window content |
220 // the content has a (TODO: not yet) configurable frame |
243 // the content has a (TODO: not yet) configurable frame |
221 // TODO: really? why |
244 // TODO: really? why |
227 // content vbox |
250 // content vbox |
228 GtkWidget *content_box = ui_gtk_vbox_new(0); |
251 GtkWidget *content_box = ui_gtk_vbox_new(0); |
229 gtk_container_add(GTK_CONTAINER(frame), content_box); |
252 gtk_container_add(GTK_CONTAINER(frame), content_box); |
230 obj->container = ui_box_container(obj, content_box); |
253 obj->container = ui_box_container(obj, content_box); |
231 */ |
254 */ |
232 GtkWidget *content_box = ui_gtk_vbox_new(0); |
|
233 BOX_ADD_EXPAND(GTK_BOX(vbox), content_box); |
|
234 obj->container = ui_box_container(obj, content_box, UI_CONTAINER_VBOX); |
255 obj->container = ui_box_container(obj, content_box, UI_CONTAINER_VBOX); |
235 |
256 |
236 nwindows++; |
257 nwindows++; |
237 return obj; |
258 return obj; |
238 } |
259 } |