1
0
mirror of https://gittea.dev/nova/th.git synced 2025-10-21 18:30:15 -04:00

improvenments to the renderer

This commit is contained in:
nova
2025-08-17 15:35:00 +02:00
parent 017bf407d9
commit f0a2f14966
5 changed files with 85 additions and 77 deletions

View File

@@ -6,6 +6,7 @@
#include "backend.h"
#include "defines.h"
#include "config.h"
#include "dir.h"
extern volatile unsigned long selected_file_current;
@@ -191,9 +192,11 @@ void move_down(int passes){
if (passes == 0) {
passes++;
}
/*capping the maximum file is done inside thread_mid */
selected_file_current += passes;
status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_MASK);
update_selected_file();
status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_0);
pthread_mutex_unlock(&mutex_selection);
}
void move_up(int passes){
@@ -201,12 +204,14 @@ void move_up(int passes){
if (passes == 0) {
passes++;
}
int i;
for (i = 0; i < passes; i++) {
if (selected_file_current != 0) {
selected_file_current--;
}
unsigned long tmp = selected_file_current;
selected_file_current -= passes;
if (tmp < selected_file_current) {
selected_file_current = 0;
}
update_selected_file();
status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_MASK);
pthread_mutex_unlock(&mutex_selection);
}
@@ -273,6 +278,7 @@ void move_right(){
}
free(mime);
}
update_selected_file();
status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_MASK | STATUS_RELOAD_DIRECTORY);
}
void toggle_hidden_files(){
@@ -282,12 +288,14 @@ void toggle_hidden_files(){
void jump_bottom(){
pthread_mutex_lock(&mutex_selection);
selected_file_current = 0 - 1;
status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_MASK);
update_selected_file();
status |= (STATUS_UPDATE_SCREEN_MASK);
pthread_mutex_unlock(&mutex_selection);
}
void jump_top(){
pthread_mutex_lock(&mutex_selection);
selected_file_current = 0;
update_selected_file();
status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_MASK);
pthread_mutex_unlock(&mutex_selection);
}