1) Now shows the full value for the year
2) Fix sort buttons
3) For ".." dir is not shown unnecessary data

git-svn-id: svn://kolibrios.org@9726 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov 2022-02-22 23:36:17 +00:00
parent a89837dd81
commit 4debc9fd1b
3 changed files with 52 additions and 76 deletions

View File

@ -165,9 +165,9 @@ left_sort_date:
je still
mov [left_sort_flag],3
.1:
call draw_left_select_disk_button
call draw_left_sort_button
call left_sort_files
; mov [left_panel_clear_all],1
call draw_left_panel
jmp still
;---------------------------------------------------------------------
@ -195,6 +195,7 @@ right_sort_date:
je still
mov [right_sort_flag],3
.1:
call draw_right_select_disk_button
call draw_right_sort_button
call right_sort_files
call draw_right_panel

View File

@ -39,7 +39,7 @@ _new_but:
draw_left_sort_button:
mov bx,[left_panel_x.start_x]
add bx,[left_panel_x.size_x]
sub ebx,50+15
sub ebx,50+15+12
mov cx,[left_panel_y.start_y]
call calclulate_sort_button_1
mov edx,145
@ -80,7 +80,7 @@ calclulate_sort_button_2:
cmp ebp,4
jne @f
mov bx,15
mov bx,15+12
jmp .continue
;--------------------------------------
@@:
@ -129,7 +129,7 @@ calclulate_sort_button_2:
draw_right_sort_button:
mov bx,[right_panel_x.start_x]
add bx,[right_panel_x.size_x]
sub ebx,50+15
sub ebx,50+15+12
mov cx,[right_panel_y.start_y]
call calclulate_sort_button_1
mov edx,149
@ -283,37 +283,20 @@ decimal_string_2:
pop edx ecx ebx eax
ret
;------------------------------------------------------------------------------
decimal_string_4:
push eax ecx edx
xor ecx,ecx
mov [ebx],byte '0'
inc ebx
decimal_string:
push eax ebx ecx edx
mov ecx,10
;--------------------------------------
.p3:
xor edx,edx
push ebx
mov ebx,10
div ebx
pop ebx
div ecx
add edx,48
push edx
inc ecx
cmp eax,0
jne .p3
cmp ecx,3
jbe .p4
mov ecx,4
dec ebx
;--------------------------------------
.p4:
pop edx
mov [ebx],dl
inc ebx
loop .p4
dec ebx
test eax,eax
jnz .p3
pop edx ecx eax
pop edx ecx ebx eax
ret
;------------------------------------------------------------------------------
draw_type_size_date:
@ -430,9 +413,9 @@ draw_type_size_date:
pop ecx
jz @f
mov ebx,size_table
call decimal_string_4
mov [ebx],byte 'E' ; Exa Byte
mov ebx,size_table+3
call decimal_string
mov [ebx+1],byte 'E' ; Exa Byte
jmp .size_convert_end
;--------------------------------------
@@:
@ -442,9 +425,9 @@ draw_type_size_date:
pop ecx
jz @f
mov ebx,size_table
call decimal_string_4
mov [ebx],byte 'P' ; Peta Byte
mov ebx,size_table+3
call decimal_string
mov [ebx+1],byte 'P' ; Peta Byte
jmp .size_convert_end
;--------------------------------------
@@:
@ -454,9 +437,9 @@ draw_type_size_date:
pop ecx
jz @f
mov ebx,size_table
call decimal_string_4
mov [ebx],byte 'T' ; Tera Byte
mov ebx,size_table+3
call decimal_string
mov [ebx+1],byte 'T' ; Tera Byte
jmp .size_convert_end
;--------------------------------------
@@:
@ -466,9 +449,9 @@ draw_type_size_date:
pop ecx
jz @f
mov ebx,size_table
call decimal_string_4
mov [ebx],byte 'G' ; Giga Byte
mov ebx,size_table+3
call decimal_string
mov [ebx+1],byte 'G' ; Giga Byte
jmp .size_convert_end
;--------------------------------------
@@:
@ -478,9 +461,9 @@ draw_type_size_date:
test eax,eax
jz @f
mov ebx,size_table
call decimal_string_4
mov [ebx],byte 'M' ; Mega Byte
mov ebx,size_table+3
call decimal_string
mov [ebx+1],byte 'M' ; Mega Byte
jmp .size_convert_end
;--------------------------------------
@@:
@ -489,39 +472,27 @@ draw_type_size_date:
test eax,eax
jz @f
mov ebx,size_table
call decimal_string_4
mov [ebx],byte 'K' ; Kilo Byte
mov ebx,size_table+3
call decimal_string
mov [ebx+1],byte 'K' ; Kilo Byte
jmp .size_convert_end
;--------------------------------------
@@:
mov eax,ebx
;.size_convert:
mov ebx,size_table
call decimal_string_4
mov ebx,size_table+4
call decimal_string
;--------------------------------------
.size_convert_end:
cmp [size_table],byte '0'
jne @f
mov [size_table],byte ' '
;--------------------------------------
@@:
cmp [size_table+4],byte ' '
jne @f
mov esi,size_table+3
mov edi,esi
inc edi
mov ecx,5
std
rep movsb
jmp @r
;--------------------------------------
@@:
pop edx ebx
;--------------------------------------
.date:
cmp [edx],word '..'
jne @f
cmp [edx+2],byte 0
je .not_show_date
@@:
xor eax,eax
mov al,[edx-40+28]
push ebx
@ -531,14 +502,16 @@ draw_type_size_date:
mov ebx,date_table+3
call decimal_string_2
mov ax,[edx-40+30]
mov ebx,year_table
call decimal_string_4
mov ax,[year_table+2]
mov [date_table+6],ax
lea ebx,[year_table+4]
mov [ebx-4], dword '0000'
mov [ebx], byte '0'
call decimal_string
mov eax,[year_table+1]
mov [date_table+6],eax
pop ebx
ror ebx,16
add bx,[left_panel_x.size_x]
sub ebx,122+12+15
sub ebx,161 ;122+12+15
rol ebx,16
mov ecx,0
cmp [marked_file],byte 0
@ -547,7 +520,9 @@ draw_type_size_date:
mov ecx,0xff0000
;--------------------------------------
@@:
mcall 4,,,type_table,20
mcall 4,,,type_table,22
;--------------------------------------
.not_show_date:
popa
ret
;------------------------------------------------------------------------------
@ -660,7 +635,7 @@ draw_folder_data:
xor edx,edx
div ebx
pop edx ebx
sub eax,23+2+2
sub eax,23+2+2+2
mov esi,[file_name_length]
mov [temp_counter_1],0
cmp esi,eax

View File

@ -74,10 +74,10 @@ size_table:
db '1023b '
;---------------------------------------------------------------------
date_table:
db ' . . 22:00 '
db ' . . 22:00 '
;---------------------------------------------------------------------
year_table:
db ' '
db ' '
;---------------------------------------------------------------------
ini_file_name:
db 'kfm.ini',0