Dropped tab layout, floating info window and clean
No longer using tabs, all info in one bottom panel. Added a floating info window, can open from control bar. Cleanup vertical widths for scroll bars in some panes.
This commit is contained in:
@@ -2,40 +2,30 @@ package simulator
|
||||
|
||||
import rl "vendor:raylib"
|
||||
|
||||
gui_bottom_tabs :: proc(rect: rl.Rectangle, sim: ^Simulator) {
|
||||
gui_bottom_panel :: proc(rect: rl.Rectangle, sim: ^Simulator) {
|
||||
rl.DrawRectangleLinesEx(rect, 1, rl.GRAY)
|
||||
|
||||
// Setup tab bar
|
||||
tabs := [?]cstring{ "Memory", "Log" }
|
||||
|
||||
tab_bar_rect := rl.Rectangle{
|
||||
rect.x,
|
||||
rect.y,
|
||||
rect.width,
|
||||
BUTTON_HEIGHT + PADDING_Y
|
||||
}
|
||||
|
||||
// inside draw loop:
|
||||
rl.GuiTabBar(tab_bar_rect, &tabs[0], i32(len(tabs)), &sim.active_tab)
|
||||
|
||||
memory_view_bounds := rl.Rectangle {
|
||||
x = rect.x + PADDING_X,
|
||||
y = rect.y + PADDING_Y + tab_bar_rect.height,
|
||||
y = rect.y + PADDING_Y,
|
||||
width = (rect.width - (PADDING_X * 2)) / 2,
|
||||
height = rect.height - (PADDING_Y * 2) - tab_bar_rect.height,
|
||||
height = rect.height - (PADDING_Y * 2),
|
||||
}
|
||||
gui_tab_memory(memory_view_bounds, sim)
|
||||
|
||||
disasm_view_bounds := rl.Rectangle {
|
||||
x = rect.x + memory_view_bounds.width + PADDING_X,
|
||||
y = rect.y + PADDING_Y + tab_bar_rect.height,
|
||||
width = (rect.width - (PADDING_X * 2)) / 2,
|
||||
height = rect.height - (PADDING_Y * 2) - tab_bar_rect.height,
|
||||
y = rect.y + PADDING_Y,
|
||||
width = ((rect.width - (PADDING_X * 2)) / 2) / 2,
|
||||
height = rect.height - (PADDING_Y * 2),
|
||||
}
|
||||
gui_tab_disasm(disasm_view_bounds, sim)
|
||||
|
||||
switch sim.active_tab {
|
||||
case 0: // draw registers panel
|
||||
gui_tab_memory(memory_view_bounds, sim)
|
||||
gui_tab_disasm(disasm_view_bounds, sim)
|
||||
case 1: // draw memory panel
|
||||
case 2: // draw display panel
|
||||
stack_view_bounds := rl.Rectangle {
|
||||
x = disasm_view_bounds.x + disasm_view_bounds.width,
|
||||
y = rect.y + PADDING_Y,
|
||||
width = ((rect.width - (PADDING_X * 2)) / 2) / 2,
|
||||
height = rect.height - (PADDING_Y * 2),
|
||||
}
|
||||
gui_tab_stack(stack_view_bounds, sim)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user