mirror of
https://github.com/MidnightCommander/mc
synced 2025-02-03 17:07:00 +03:00
* screen.c (update_dirty_panels): New function - update panels
with the dirty flag. (panel_update_contents): Make static, don't call directly. * main.c: Don't call panel_update_contents(), use dirty flag. (midnight_callback): Call update_dirty_panels().
This commit is contained in:
parent
649f1c538e
commit
bab1cfdc49
@ -1,3 +1,11 @@
|
||||
2003-09-10 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* screen.c (update_dirty_panels): New function - update panels
|
||||
with the dirty flag.
|
||||
(panel_update_contents): Make static, don't call directly.
|
||||
* main.c: Don't call panel_update_contents(), use dirty flag.
|
||||
(midnight_callback): Call update_dirty_panels().
|
||||
|
||||
2003-09-09 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* find.c (find_parameters): Make "filename" entry focused on
|
||||
|
@ -630,7 +630,7 @@ _do_panel_cd (WPanel *panel, char *new_dir, enum cd_enum cd_type)
|
||||
panel->reverse, panel->case_sensitive, panel->filter);
|
||||
try_to_select (panel, get_parent_dir_name (panel->cwd, olddir));
|
||||
load_hint (0);
|
||||
panel_update_contents (panel);
|
||||
panel->dirty = 1;
|
||||
update_xterm_title_path ();
|
||||
|
||||
g_free (olddir);
|
||||
@ -1570,7 +1570,7 @@ midnight_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
|
||||
case DLG_HOTKEY_HANDLED:
|
||||
if ((get_current_type () == view_listing) && cpanel->searching) {
|
||||
cpanel->searching = 0;
|
||||
panel_update_contents (cpanel);
|
||||
cpanel->dirty = 1;
|
||||
}
|
||||
return MSG_HANDLED;
|
||||
|
||||
@ -1607,6 +1607,10 @@ midnight_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
|
||||
1, LINES - keybar_visible - 1);
|
||||
return MSG_HANDLED;
|
||||
|
||||
case DLG_POST_KEY:
|
||||
update_dirty_panels ();
|
||||
return MSG_HANDLED;
|
||||
|
||||
default:
|
||||
return default_dlg_callback (h, msg, parm);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ void panel_reload (WPanel *panel);
|
||||
void panel_set_sort_order (WPanel *panel, sortfn *sort_order);
|
||||
void panel_re_sort (WPanel *panel);
|
||||
|
||||
void panel_update_contents (WPanel *panel);
|
||||
void update_dirty_panels (void);
|
||||
void panel_update_cols (Widget *widget, int frame_size);
|
||||
int set_panel_formats (WPanel *p);
|
||||
|
||||
|
27
src/screen.c
27
src/screen.c
@ -775,8 +775,12 @@ adjust_top_file (WPanel *panel)
|
||||
panel->top_file = panel->count - llines (panel);
|
||||
}
|
||||
|
||||
/* Repaints the information that changes after a command */
|
||||
void
|
||||
/*
|
||||
* Repaint everything that can change on the panel - title, entries and
|
||||
* mini status. The rest of the frame and the mini status separator are
|
||||
* not repainted.
|
||||
*/
|
||||
static void
|
||||
panel_update_contents (WPanel *panel)
|
||||
{
|
||||
show_dir (panel);
|
||||
@ -784,6 +788,7 @@ panel_update_contents (WPanel *panel)
|
||||
display_mini_info (panel);
|
||||
}
|
||||
|
||||
/* Repaint everything, including frame and separator */
|
||||
void
|
||||
paint_panel (WPanel *panel)
|
||||
{
|
||||
@ -792,6 +797,22 @@ paint_panel (WPanel *panel)
|
||||
mini_info_separator (panel);
|
||||
}
|
||||
|
||||
/*
|
||||
* Repaint the contents of the panels without frames. To schedule panel
|
||||
* for repainting, set panel->dirty to 1. There are many reasons why
|
||||
* the panels need to be repainted, and this is a costly operation, so
|
||||
* it's done once per event.
|
||||
*/
|
||||
void
|
||||
update_dirty_panels (void)
|
||||
{
|
||||
if (cpanel->dirty)
|
||||
panel_update_contents (cpanel);
|
||||
|
||||
if ((get_other_type () == view_listing) && opanel->dirty)
|
||||
panel_update_contents (opanel);
|
||||
}
|
||||
|
||||
static void
|
||||
do_select (WPanel *panel, int i)
|
||||
{
|
||||
@ -2364,7 +2385,7 @@ panel_re_sort (WPanel *panel)
|
||||
if (panel->top_file < 0)
|
||||
panel->top_file = 0;
|
||||
select_item (panel);
|
||||
panel_update_contents (panel);
|
||||
panel->dirty = 1;
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user