forked from KolibriOS/kolibrios
@menu: fix bug with colors when using other skins
git-svn-id: svn://kolibrios.org@9527 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
2a142bd532
commit
ef4c371a97
@ -155,6 +155,23 @@ align 4
|
|||||||
|
|
||||||
; DEBUGF DBG_INFO, "sc.work = %x\n", [sc.work]
|
; DEBUGF DBG_INFO, "sc.work = %x\n", [sc.work]
|
||||||
|
|
||||||
|
mov esi, [sc.work]
|
||||||
|
add esi, 0x1a1a1a
|
||||||
|
mov ebx, esi
|
||||||
|
and ebx, 0xFF000000
|
||||||
|
test ebx, ebx
|
||||||
|
jz @f
|
||||||
|
mov esi, 0x00FFFFFF
|
||||||
|
@@:
|
||||||
|
mov [active_color], esi
|
||||||
|
|
||||||
|
mov esi, [sc.work]
|
||||||
|
cmp esi, 0xdfdfdf
|
||||||
|
jb @f
|
||||||
|
sub esi, 0x1b1b1b
|
||||||
|
@@:
|
||||||
|
mov [work_color], esi
|
||||||
|
|
||||||
mov eax, 68
|
mov eax, 68
|
||||||
mov ebx, 22
|
mov ebx, 22
|
||||||
mov ecx, icons_resname
|
mov ecx, icons_resname
|
||||||
@ -166,19 +183,30 @@ align 4
|
|||||||
DEBUGF DBG_ERR, "Failed to get ICONS18W from @RESHARE.\nTry rerun @RESHARE.\n"
|
DEBUGF DBG_ERR, "Failed to get ICONS18W from @RESHARE.\nTry rerun @RESHARE.\n"
|
||||||
jmp .no_res
|
jmp .no_res
|
||||||
@@:
|
@@:
|
||||||
mov [shared_icons_ptr], eax
|
|
||||||
mov [shared_icons_size], edx
|
mov [shared_icons_size], edx
|
||||||
; copy shared icons to active icons
|
; copy shared icons
|
||||||
mov esi, eax
|
mov esi, eax
|
||||||
mov ecx, edx
|
mov ecx, edx
|
||||||
mcall 68, 12, edx
|
mcall 68, 12, edx
|
||||||
mov edi, eax
|
mov edi, eax
|
||||||
|
mov [shared_icons_ptr], eax
|
||||||
|
shr ecx, 2 ; /= 4; ecx = how many dwords in shared icons
|
||||||
|
cld
|
||||||
|
rep movsd
|
||||||
|
|
||||||
|
; copy shared icons to active icons
|
||||||
|
mov esi, [shared_icons_ptr]
|
||||||
|
mov ecx, edx
|
||||||
|
mcall 68, 12, edx
|
||||||
|
mov edi, eax
|
||||||
mov [shared_icons_active_ptr], eax
|
mov [shared_icons_active_ptr], eax
|
||||||
shr ecx, 2 ; /= 4; ecx = how many dwords in shared icons
|
shr ecx, 2 ; /= 4; ecx = how many dwords in shared icons
|
||||||
cld
|
cld
|
||||||
rep movsd
|
rep movsd
|
||||||
; change work color to work_light color
|
|
||||||
|
; fix colors:
|
||||||
mov esi, [shared_icons_active_ptr]
|
mov esi, [shared_icons_active_ptr]
|
||||||
|
mov edi, [shared_icons_ptr]
|
||||||
xor ecx, ecx
|
xor ecx, ecx
|
||||||
.for1:
|
.for1:
|
||||||
cmp ecx, [shared_icons_size]
|
cmp ecx, [shared_icons_size]
|
||||||
@ -190,10 +218,19 @@ align 4
|
|||||||
cmp edx, [sc.work]
|
cmp edx, [sc.work]
|
||||||
; DEBUGF DBG_INFO, "eax = %x, sc.work = %x\n", eax, [sc.work]
|
; DEBUGF DBG_INFO, "eax = %x, sc.work = %x\n", eax, [sc.work]
|
||||||
jne @f
|
jne @f
|
||||||
mov ebx, [sc.work] ;[sc.work_light]
|
mov ebx, [active_color]
|
||||||
add ebx, 0x1a1a1a ;;
|
|
||||||
mov [eax], ebx
|
mov [eax], ebx
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
|
mov eax, edi
|
||||||
|
add eax, ecx
|
||||||
|
mov edx, [eax]
|
||||||
|
cmp edx, [sc.work]
|
||||||
|
jne @f
|
||||||
|
mov ebx, [work_color]
|
||||||
|
mov [eax], ebx
|
||||||
|
@@:
|
||||||
|
|
||||||
add ecx, 4
|
add ecx, 4
|
||||||
jmp .for1
|
jmp .for1
|
||||||
.end_for1:
|
.end_for1:
|
||||||
@ -896,24 +933,15 @@ draw_one_button:
|
|||||||
shl ecx,16
|
shl ecx,16
|
||||||
add ecx,BTN_HEIGHT
|
add ecx,BTN_HEIGHT
|
||||||
; edx = button identifier
|
; edx = button identifier
|
||||||
mov esi,[sc.work]
|
mov esi, [work_color]
|
||||||
cmp esi,0xdfdfdf
|
|
||||||
jb nocorrect
|
|
||||||
sub esi,0x1b1b1b
|
|
||||||
|
|
||||||
;--------------------------------------
|
|
||||||
align 4
|
|
||||||
nocorrect:
|
|
||||||
mov [is_icon_active], 0
|
mov [is_icon_active], 0
|
||||||
inc dl
|
inc dl
|
||||||
cmp [edi + cur_sel],dl
|
cmp [edi + cur_sel],dl
|
||||||
jne .nohighlight
|
jne .nohighlight
|
||||||
mov [is_icon_active], 1
|
mov [is_icon_active], 1
|
||||||
cmp esi,0
|
|
||||||
jne @f
|
mov esi, [active_color]
|
||||||
mov esi,0x2a2a2a
|
|
||||||
@@:
|
|
||||||
add esi,0x1a1a1a
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
.nohighlight:
|
.nohighlight:
|
||||||
@ -1148,6 +1176,8 @@ icon_number dd ?
|
|||||||
is_icon_active dd ?
|
is_icon_active dd ?
|
||||||
no_shared_resources dd 0
|
no_shared_resources dd 0
|
||||||
tmp dd ?
|
tmp dd ?
|
||||||
|
active_color dd ?
|
||||||
|
work_color dd ?
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
align 4
|
align 4
|
||||||
bootparam:
|
bootparam:
|
||||||
|
Loading…
Reference in New Issue
Block a user