auto-switch to new tabs on creation (no auto-scan)
- SHA
13f475ddf81de04921cbb51b23f70d3d95d46225- Parents
-
0a91afe - Tree
7936372
13f475d
13f475ddf81de04921cbb51b23f70d3d95d462250a91afe
7936372| Status | File | + | - |
|---|---|---|---|
| M |
src/gui/tab_widget.f90
|
12 | 3 |
src/gui/tab_widget.f90modified@@ -194,12 +194,21 @@ contains | ||
| 194 | 194 | |
| 195 | 195 | print *, "Created new tab ", new_tab_index |
| 196 | 196 | |
| 197 | + ! Switch to the new tab | |
| 198 | + call switch_to_tab(new_tab_index) | |
| 199 | + | |
| 197 | 200 | ! Rebuild tab bar to show the new tab |
| 198 | - ! TODO: Implement proper clear_tab_bar to avoid duplicates | |
| 199 | - ! For now, just refresh which will add the new tab | |
| 200 | 201 | call refresh_tab_bar() |
| 201 | 202 | |
| 202 | - print *, "Tab bar refreshed with new tab" | |
| 203 | + ! Update visual states (yellow border on new active tab) | |
| 204 | + call update_tab_visual_states() | |
| 205 | + | |
| 206 | + ! Update UI for the new tab (but don't auto-scan empty tabs) | |
| 207 | + if (associated(tab_switch_cb)) then | |
| 208 | + call tab_switch_cb() | |
| 209 | + end if | |
| 210 | + | |
| 211 | + print *, "Tab bar refreshed and switched to new tab ", new_tab_index | |
| 203 | 212 | end subroutine on_plus_clicked |
| 204 | 213 | |
| 205 | 214 | ! Callback when a tab button is clicked |