ui_header.ts 969 B

1234567891011121314151617181920212223242526272829303132333435
  1. let ui_header_default_h: i32 = 28;
  2. let ui_header_h: i32 = ui_header_default_h;
  3. let ui_header_handle: ui_handle_t = ui_handle_create();
  4. let ui_header_worktab: ui_handle_t = ui_handle_create();
  5. function ui_header_init() {
  6. ui_header_handle.layout = ui_layout_t.HORIZONTAL;
  7. }
  8. function ui_header_render_ui() {
  9. if (config_raw.touch_ui) {
  10. ui_header_h = ui_header_default_h + 6;
  11. }
  12. else {
  13. ui_header_h = ui_header_default_h;
  14. }
  15. ui_header_h = math_floor(ui_header_h * UI_SCALE());
  16. if (config_raw.layout[layout_size_t.HEADER] == 0) {
  17. return;
  18. }
  19. let nodesw: i32 = (ui_nodes_show || ui_view2d_show) ? config_raw.layout[layout_size_t.NODES_W] : 0;
  20. ///if is_lab
  21. let ww: i32 = iron_window_width() - nodesw;
  22. ///else
  23. let ww: i32 = iron_window_width() - ui_toolbar_w(true) - config_raw.layout[layout_size_t.SIDEBAR_W] - nodesw;
  24. ///end
  25. if (ui_window(ui_header_handle, sys_x(), ui_header_h, ww, ui_header_h)) {
  26. ui._y += 2;
  27. ui_header_draw_tool_properties();
  28. }
  29. }