Opraven příliš rychlý marquee scroll
This commit is contained in:
+18
-32
@@ -1735,12 +1735,9 @@ static void run_file_manager(void) {
|
||||
int last_selected = -1;
|
||||
int top = 0;
|
||||
unsigned long last_anim = timer_ticks();
|
||||
unsigned long idle_spin = 0;
|
||||
unsigned long step_ticks = g_timer_hz / 5UL;
|
||||
|
||||
if (step_ticks == 0) {
|
||||
step_ticks = 1;
|
||||
}
|
||||
unsigned long tick_counter = 0;
|
||||
unsigned long step_ticks = 1;
|
||||
unsigned long shift_interval = 10;
|
||||
|
||||
aster_memset(fm_cwd, 0, sizeof(fm_cwd));
|
||||
aster_memcpy(fm_cwd, g_cwd, aster_strlen(g_cwd));
|
||||
@@ -1784,29 +1781,24 @@ static void run_file_manager(void) {
|
||||
|
||||
for (;;) {
|
||||
unsigned long delta;
|
||||
unsigned long steps;
|
||||
key = keyboard_try_read_key();
|
||||
now = timer_ticks();
|
||||
|
||||
// Timer-based posun - každých N tiků
|
||||
if (now > last_anim) {
|
||||
delta = now - last_anim;
|
||||
if (delta >= step_ticks) {
|
||||
steps = delta / step_ticks;
|
||||
g_status_marquee_offset += (usize)steps;
|
||||
last_anim += steps * step_ticks;
|
||||
tick_counter += delta;
|
||||
if (tick_counter >= shift_interval) {
|
||||
g_status_marquee_offset++;
|
||||
tick_counter = 0;
|
||||
render_shell_statusbar();
|
||||
}
|
||||
last_anim = now;
|
||||
}
|
||||
|
||||
++idle_spin;
|
||||
if (idle_spin >= 230000UL) {
|
||||
idle_spin = 0;
|
||||
++g_status_marquee_offset;
|
||||
render_shell_statusbar();
|
||||
}
|
||||
|
||||
if (key != -1) {
|
||||
idle_spin = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2191,11 +2183,12 @@ static void shell_edit_file(const char *path) {
|
||||
usize len;
|
||||
usize pos;
|
||||
unsigned long last_anim = timer_ticks();
|
||||
unsigned long idle_spin = 0;
|
||||
unsigned long step_ticks = g_timer_hz / 5UL;
|
||||
unsigned long tick_counter = 0;
|
||||
unsigned long step_ticks = 1;
|
||||
unsigned long shift_interval = 10;
|
||||
char title[120];
|
||||
usize tp = 0;
|
||||
const char *prefix = "Upravovani souboru ";
|
||||
const char *prefix = "* Upravovani souboru:";
|
||||
const char *base = path_basename(path);
|
||||
usize bi = 0;
|
||||
|
||||
@@ -2232,24 +2225,19 @@ static void shell_edit_file(const char *path) {
|
||||
int key;
|
||||
unsigned long now = timer_ticks();
|
||||
unsigned long delta;
|
||||
unsigned long steps;
|
||||
key = keyboard_try_read_key();
|
||||
|
||||
if (now > last_anim) {
|
||||
delta = now - last_anim;
|
||||
if (delta >= step_ticks) {
|
||||
steps = delta / step_ticks;
|
||||
g_status_marquee_offset += (usize)steps;
|
||||
last_anim += steps * step_ticks;
|
||||
tick_counter += delta;
|
||||
if (tick_counter >= shift_interval) {
|
||||
g_status_marquee_offset++;
|
||||
tick_counter = 0;
|
||||
render_shell_statusbar();
|
||||
}
|
||||
last_anim = now;
|
||||
}
|
||||
|
||||
++idle_spin;
|
||||
if (idle_spin >= 230000UL) {
|
||||
idle_spin = 0;
|
||||
++g_status_marquee_offset;
|
||||
render_shell_statusbar();
|
||||
}
|
||||
|
||||
if (key == -1) {
|
||||
@@ -2257,8 +2245,6 @@ static void shell_edit_file(const char *path) {
|
||||
continue;
|
||||
}
|
||||
|
||||
idle_spin = 0;
|
||||
|
||||
if (key == 27) {
|
||||
g_status_marquee_only = 0;
|
||||
status_clear_left_hint();
|
||||
|
||||
Reference in New Issue
Block a user