ui/gtk/toolkit.c

changeset 110
c00e968d018b
parent 109
c3dfcb8f0be7
child 112
c3f2f16fa4b8
equal deleted inserted replaced
109:c3dfcb8f0be7 110:c00e968d018b
77 #else 77 #else
78 gtk_init(&argc, &argv); 78 gtk_init(&argc, &argv);
79 #endif 79 #endif
80 80
81 ui_css_init(); 81 ui_css_init();
82 uic_docmgr_init();
83 uic_menu_init(); 82 uic_menu_init();
84 uic_toolbar_init(); 83 uic_toolbar_init();
85 ui_image_init(); 84 ui_image_init();
86 uic_load_app_properties(); 85 uic_load_app_properties();
87 86
321 320
322 void ui_destroy_widget_var(GtkWidget *object, UiVar *var) { 321 void ui_destroy_widget_var(GtkWidget *object, UiVar *var) {
323 ui_destroy_boundvar(NULL, var); 322 ui_destroy_boundvar(NULL, var);
324 } 323 }
325 324
325 // TODO: move to common
326 void ui_destroy_boundvar(UiContext *ctx, UiVar *var) { 326 void ui_destroy_boundvar(UiContext *ctx, UiVar *var) {
327 uic_save_var(var);
327 uic_unbind_var(var); 328 uic_unbind_var(var);
328 329
330 // UI_VAR_SPECIAL: anonymous value variable, that is not registered
331 // in ctx->vars
329 if(var->type == UI_VAR_SPECIAL) { 332 if(var->type == UI_VAR_SPECIAL) {
330 ui_free(var->from_ctx, var); 333 ui_free(var->from_ctx, var);
331 } else {
332 ui_free(var->from_ctx, var);
333 // TODO: free or unbound
334 //uic_remove_bound_var(ctx, var);
335 } 334 }
336 } 335 }
337 336
338 void ui_set_active_window(UiObject *obj) { 337 void ui_set_active_window(UiObject *obj) {
339 active_window = obj; 338 active_window = obj;
402 " padding: 0px 10px 0px 10px;\n" 401 " padding: 0px 10px 0px 10px;\n"
403 " font-weight: bold;\n" 402 " font-weight: bold;\n"
404 " margin-left: 4px;" 403 " margin-left: 4px;"
405 " margin-right: 4px;" 404 " margin-right: 4px;"
406 "}\n" 405 "}\n"
406 ".ui-nopadding {"
407 " padding: 0;"
408 "}\n"
409 ".ui-table-entry {"
410 " border: none;"
411 " box-shadow: none;"
412 " background: transparent;"
413 "}\n"
407 ; 414 ;
408 415
409 #elif GTK_MAJOR_VERSION == 3 416 #elif GTK_MAJOR_VERSION == 3
410 static const char *ui_gtk_css = 417 static const char *ui_gtk_css =
411 "#path-textfield-box {\n" 418 "#path-textfield-box {\n"
443 " border-radius: 9999px;\n" 450 " border-radius: 9999px;\n"
444 " padding: 0px 10px 0px 10px;\n" 451 " padding: 0px 10px 0px 10px;\n"
445 " font-weight: bold;\n" 452 " font-weight: bold;\n"
446 " margin-left: 4px;" 453 " margin-left: 4px;"
447 " margin-right: 4px;" 454 " margin-right: 4px;"
455 "}\n"
456 ".ui-nopadding {"
457 " padding: 0;"
448 "}\n" 458 "}\n"
449 ; 459 ;
450 #endif 460 #endif
451 461
452 void ui_css_init(void) { 462 void ui_css_init(void) {

mercurial