The render_workspace_button and render_binding_mode_indicator functions are almost the same. This commit extracts the common rendering code into a new render_box function.