aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_lib.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-12-14 17:09:25 +0100
committerSiri Hansen <[email protected]>2016-12-14 17:09:25 +0100
commitf4a441331b5be0235d6b96bc25e3f904c2c9ea6d (patch)
tree50194c83d0bbd29c127d64f663cfbd8c60bdf0f6 /lib/observer/src/observer_lib.erl
parent3473ecd83a7bbe7e0bebb865f25dddb93e3bf10f (diff)
downloadotp-f4a441331b5be0235d6b96bc25e3f904c2c9ea6d.tar.gz
otp-f4a441331b5be0235d6b96bc25e3f904c2c9ea6d.tar.bz2
otp-f4a441331b5be0235d6b96bc25e3f904c2c9ea6d.zip
[crashdump_viewer] Allow multiple lines in Slogan
Diffstat (limited to 'lib/observer/src/observer_lib.erl')
-rw-r--r--lib/observer/src/observer_lib.erl14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/observer/src/observer_lib.erl b/lib/observer/src/observer_lib.erl
index 59a2f9f205..1eaba31a3a 100644
--- a/lib/observer/src/observer_lib.erl
+++ b/lib/observer/src/observer_lib.erl
@@ -461,14 +461,16 @@ create_box(Parent, Data) ->
link_entry(Panel,Value);
_ ->
Value = to_str(Value0),
- case length(Value) > 100 of
- true ->
- Shown = lists:sublist(Value, 80),
+ case string:sub_word(lists:sublist(Value, 80),1,$\n) of
+ Value ->
+ %% Short string, no newlines - show all
+ wxStaticText:new(Panel, ?wxID_ANY, Value);
+ Shown ->
+ %% Long or with newlines,
+ %% use tooltip to show all
TCtrl = wxStaticText:new(Panel, ?wxID_ANY, [Shown,"..."]),
wxWindow:setToolTip(TCtrl,wxToolTip:new(Value)),
- TCtrl;
- false ->
- wxStaticText:new(Panel, ?wxID_ANY, Value)
+ TCtrl
end
end,
wxSizer:add(Line, 10, 0), % space of size 10 horisontally