mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-30 00:52:16 +08:00
Introduce tui_win_info::update_tab_width
This introduces a new tui_win_info::update_tab_width method, and changes the TUI to call it. This fixes another spot that was checking the window type. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-win.c (tui_source_window_base::update_tab_width): New method. (update_tab_width): Call update_tab_width method. * tui/tui-data.h (struct tui_win_info) (struct tui_source_window_base) <update_tab_width>: New methods.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2019-06-25 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* tui/tui-win.c (tui_source_window_base::update_tab_width): New
|
||||||
|
method.
|
||||||
|
(update_tab_width): Call update_tab_width method.
|
||||||
|
* tui/tui-data.h (struct tui_win_info)
|
||||||
|
(struct tui_source_window_base) <update_tab_width>: New methods.
|
||||||
|
|
||||||
2019-06-25 Tom Tromey <tom@tromey.com>
|
2019-06-25 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* tui/tui-wingeneral.h (tui_make_window): Change type of "box_it"
|
* tui/tui-wingeneral.h (tui_make_window): Change type of "box_it"
|
||||||
|
@ -306,6 +306,11 @@ public:
|
|||||||
/* Compute the maximum height of this window. */
|
/* Compute the maximum height of this window. */
|
||||||
virtual int max_height () const;
|
virtual int max_height () const;
|
||||||
|
|
||||||
|
/* Called after the tab width has been changed. */
|
||||||
|
virtual void update_tab_width ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/* Set whether this window is highglighted. */
|
/* Set whether this window is highglighted. */
|
||||||
void set_highlight (bool highlight)
|
void set_highlight (bool highlight)
|
||||||
{
|
{
|
||||||
@ -362,6 +367,8 @@ public:
|
|||||||
|
|
||||||
void set_new_height (int height) override;
|
void set_new_height (int height) override;
|
||||||
|
|
||||||
|
void update_tab_width () override;
|
||||||
|
|
||||||
/* Does the locator belong to this window? */
|
/* Does the locator belong to this window? */
|
||||||
bool m_has_locator = false;
|
bool m_has_locator = false;
|
||||||
/* Execution information window. */
|
/* Execution information window. */
|
||||||
|
@ -923,29 +923,30 @@ unsigned int tui_tab_width = DEFAULT_TAB_LEN;
|
|||||||
|
|
||||||
static unsigned int internal_tab_width = DEFAULT_TAB_LEN;
|
static unsigned int internal_tab_width = DEFAULT_TAB_LEN;
|
||||||
|
|
||||||
|
/* See tui-data.h. */
|
||||||
|
|
||||||
|
void
|
||||||
|
tui_source_window_base::update_tab_width ()
|
||||||
|
{
|
||||||
|
/* We don't really change the height of any windows, but
|
||||||
|
calling these 2 functions causes a complete regeneration
|
||||||
|
and redisplay of the window's contents, which will take
|
||||||
|
the new tab width into account. */
|
||||||
|
make_invisible_and_set_new_height (this, height);
|
||||||
|
make_visible_with_new_height (this);
|
||||||
|
}
|
||||||
|
|
||||||
/* After the tab width is set, call this to update the relevant
|
/* After the tab width is set, call this to update the relevant
|
||||||
windows. */
|
windows. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_tab_width ()
|
update_tab_width ()
|
||||||
{
|
{
|
||||||
/* We don't really change the height of any windows, but
|
for (int win_type = SRC_WIN; win_type < MAX_MAJOR_WINDOWS; win_type++)
|
||||||
calling these 2 functions causes a complete regeneration
|
|
||||||
and redisplay of the window's contents, which will take
|
|
||||||
the new tab width into account. */
|
|
||||||
if (tui_win_list[SRC_WIN]
|
|
||||||
&& tui_win_list[SRC_WIN]->is_visible)
|
|
||||||
{
|
{
|
||||||
make_invisible_and_set_new_height (TUI_SRC_WIN,
|
if (tui_win_list[win_type] != NULL
|
||||||
TUI_SRC_WIN->height);
|
&& tui_win_list[win_type]->is_visible)
|
||||||
make_visible_with_new_height (TUI_SRC_WIN);
|
tui_win_list[win_type]->update_tab_width ();
|
||||||
}
|
|
||||||
if (tui_win_list[DISASSEM_WIN]
|
|
||||||
&& tui_win_list[DISASSEM_WIN]->is_visible)
|
|
||||||
{
|
|
||||||
make_invisible_and_set_new_height (TUI_DISASM_WIN,
|
|
||||||
TUI_DISASM_WIN->height);
|
|
||||||
make_visible_with_new_height (TUI_DISASM_WIN);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user