1
0

Button style

git-svn-id: svn://kolibrios.org@6032 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2016-01-05 03:18:00 +00:00
parent a060f178c9
commit e1e2d4278e

View File

@ -93,11 +93,14 @@ syscall_button: ;////////////// system function 8 //////////////
test edx, 0x40000000 test edx, 0x40000000
jnz .exit jnz .exit
and esi, 0xFFFFFF
xor edi, edi xor edi, edi
push ebx ecx esi push ebx ecx esi
dec cx
dec cx
cmp [buttontype], 1 cmp [buttontype], 1
jnz .draw jnz .draw
cmp cx, 129 cmp cx, 65
jnc .draw jnc .draw
; calculate gradient data ; calculate gradient data
@ -110,10 +113,11 @@ syscall_button: ;////////////// system function 8 //////////////
jnc @f jnc @f
neg al neg al
jnz @f jnz @f
mov al, 128 mov al, 64
@@: @@:
jns @f cmp al, 65
mov al, 128 jc @f
mov al, 64
@@: @@:
div cl div cl
shl ax, 8 shl ax, 8
@ -143,41 +147,61 @@ syscall_button: ;////////////// system function 8 //////////////
mov ebx, ecx mov ebx, ecx
mov ecx, esi mov ecx, esi
shr ecx, 1 shr ecx, 1
btr ecx, 7 and cx, 7F7Fh
btr ecx, 15
push esi push esi
mov esi, edi mov esi, edi
xor edi, edi xor edi, edi
call hline ; top border call hline ; top border
inc ebx inc ebx
or ecx, 808080h
call hline ; top light line
pop ecx pop ecx
inc ebx
.next_line: .next_line:
call hline ; button body call hline ; button body
inc ebx inc ebx
sub ecx, esi sub ecx, esi
dec ebp dec ebp
jnz .next_line jnz .next_line
shr ecx, 1 shr ecx, 2
btr ecx, 7 and cx, 3F3Fh
btr ecx, 15 mov ebp, ecx
shl ecx, 1
add ecx, ebp
call hline ; bottom dark line
inc ebx
sub ecx, ebp
call hline ; bottom border call hline ; bottom border
pop ecx pop ecx
shr ecx, 1 shr ecx, 1
btr ecx, 7
btr ecx, 15
inc edx inc edx
push edx push edx
mov edx, ebx mov edx, ebx
sub bx, [esp+4] sub bx, [esp+4]
dec eax
cmp [buttontype], 1
jnz @f
dec edx dec edx
inc ebx inc ebx
cmp [buttontype], 0
jnz @f
dec edx
or ecx, 808080h
call vline ; left light line
inc edx
@@: @@:
and ecx, 7F7F7Fh
dec eax
call vline ; left border call vline ; left border
pop eax pop eax
call vline ; right border call vline ; right border
cmp [buttontype], 0
jnz @f
mov ebp, ecx
shr ecx, 1
and cx, 7F7Fh
add ecx, ebp
dec eax
inc ebx
call vline ; right dark line
@@:
pop ecx ebx pop ecx ebx
.exit: .exit:
ret ret
@ -302,11 +326,8 @@ sys_button_deactivate_handler:
mov edx, ebx mov edx, ebx
sub bx, [esp+4] sub bx, [esp+4]
dec eax dec eax
cmp [buttontype], 1
jnz @f
dec edx dec edx
inc ebx inc ebx
@@:
call vline call vline
pop eax pop eax
call vline call vline