2
0

ui_header.ts 1001 B

123456789101112131415161718192021222324252627282930313233343536
  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. let ui: ui_t = ui_base_ui;
  10. if (config_raw.touch_ui) {
  11. ui_header_h = ui_header_default_h + 6;
  12. }
  13. else {
  14. ui_header_h = ui_header_default_h;
  15. }
  16. ui_header_h = math_floor(ui_header_h * ui_SCALE(ui));
  17. if (config_raw.layout[layout_size_t.HEADER] == 0) {
  18. return;
  19. }
  20. let nodesw: i32 = (ui_nodes_show || ui_view2d_show) ? config_raw.layout[layout_size_t.NODES_W] : 0;
  21. ///if is_lab
  22. let ww: i32 = iron_window_width() - nodesw;
  23. ///else
  24. let ww: i32 = iron_window_width() - ui_toolbar_w(true) - config_raw.layout[layout_size_t.SIDEBAR_W] - nodesw;
  25. ///end
  26. if (ui_window(ui_header_handle, sys_x(), ui_header_h, ww, ui_header_h)) {
  27. ui._y += 2;
  28. ui_header_draw_tool_properties(ui);
  29. }
  30. }