Viewport Header operator draw depress isn't redrawing on tool change

Adding an operator button next to Object Type Visibility and wanted to give it some visual feedback by having it draw depressed (aka light up in blue) based on 3 specific tools being active and their accompanying tool setting being true.

It’s functional, but the depressed state of the button doesn’t update fast enough to be useful. In fact, even if you are only switching between these 3 tools (box, circle, and lasso select) and their tool settings are different (select through true on one and false on the others) the visual feedback of this button will be the opposite of what is intended. This is because the button isn’t redrawing itself when tools are switched, it only works right if I manually update it by clicking in viewport, leave and re-enter viewport, or hover over the header area / button itself (at which point the user is probably clicking it to the opposite effect of what they are intending to do)

Is there some other way to implement this so that it updates on tool change, or is this just not something that works right now?

# Select Through

        if object_mode in {'EDIT'}:

            if bpy.context.tool_settings.select_through_button == True:

                row = layout.row(align=True)

                sub = row.row(align=True)

                tool_settings = context.tool_settings

                current_tool = bpy.context.workspace.tools.from_space_view3d_mode('EDIT_MESH', create=False).idname

                if current_tool == "builtin.select_box":

                    draw_depressed = tool_settings.select_through_box       

                elif current_tool == "builtin.select_circle":

                    draw_depressed = tool_settings.select_through_circle

                elif current_tool == "builtin.select_lasso":

                    draw_depressed = tool_settings.select_through_lasso

                else:

                    draw_depressed = False

                sub.operator(

                "view3d.select_through",

                text="",

                icon='OBJECT_HIDDEN',

                depress = draw_depressed,

                )

Right now I’m putting a checkbox in tool settings to turn this button on/off, I’ll probably move that to Viewport Overlays or something to be a little more sensible. But either way I tested it with just if it’s in box select to draw depressed, and it has the same slow redraw behaviour.

# Select Through

        if object_mode in {'EDIT'}:

            row = layout.row(align=True)

            sub = row.row(align=True)

            current_tool = bpy.context.workspace.tools.from_space_view3d_mode('EDIT_MESH', create=False).idname

            if current_tool == "builtin.select_box":

                draw_depressed = True    

            else:

                draw_depressed = False

            sub.operator(

            "view3d.select_through",

            text="",

            icon='OBJECT_HIDDEN',

            depress = draw_depressed,

            )