aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_lib.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2013-10-22 13:37:03 +0200
committerDan Gudmundsson <[email protected]>2014-01-27 16:13:57 +0100
commitbfae535d4ac51d2c3bef146e0f058e105bb5e956 (patch)
treeeaafe6c61f5fca58ca05b232f280e911f04dcdb7 /lib/observer/src/observer_lib.erl
parent41380c0ff6c4fb56aad5702b9d9554ae36580063 (diff)
downloadotp-bfae535d4ac51d2c3bef146e0f058e105bb5e956.tar.gz
otp-bfae535d4ac51d2c3bef146e0f058e105bb5e956.tar.bz2
otp-bfae535d4ac51d2c3bef146e0f058e105bb5e956.zip
observer: Optimize row lookups
Use arrays instead of lists to cache data, gives faster lookups for large contents. Also update colors used in table viewer, indication new and changed rows. Other minor bugfixes in tables viewer.
Diffstat (limited to 'lib/observer/src/observer_lib.erl')
-rw-r--r--lib/observer/src/observer_lib.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/observer/src/observer_lib.erl b/lib/observer/src/observer_lib.erl
index 463c42308d..f11ccfb752 100644
--- a/lib/observer/src/observer_lib.erl
+++ b/lib/observer/src/observer_lib.erl
@@ -339,10 +339,18 @@ create_attrs() ->
#attrs{even = wxListItemAttr:new(Text, ?BG_EVEN, Font),
odd = wxListItemAttr:new(Text, ?BG_ODD, Font),
deleted = wxListItemAttr:new(?FG_DELETED, ?BG_DELETED, Font),
- changed = wxListItemAttr:new(Text, ?BG_CHANGED, Font),
+ changed_even = wxListItemAttr:new(Text, mix(?BG_CHANGED,?BG_EVEN), Font),
+ changed_odd = wxListItemAttr:new(Text, mix(?BG_CHANGED,?BG_ODD), Font),
+ new_even = wxListItemAttr:new(Text, mix(?BG_NEW,?BG_EVEN), Font),
+ new_odd = wxListItemAttr:new(Text, mix(?BG_NEW, ?BG_ODD), Font),
searched = wxListItemAttr:new(Text, ?BG_SEARCHED, Font)
}.
+mix(RGB,_) -> RGB.
+
+%% mix({R,G,B},{MR,MG,MB}) ->
+%% {trunc(R*MR/255), trunc(G*MG/255), trunc(B*MB/255)}.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
get_box_info({Title, List}) when is_list(List) -> {Title, ?wxALIGN_LEFT, List};