diff options
author | Siri Hansen <[email protected]> | 2016-12-20 09:39:38 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2016-12-20 09:39:38 +0100 |
commit | f0152387b96dc0c2ce5ecf7805fc435cb400356e (patch) | |
tree | 2a55cfcc65f36e010771a1391536124572138fe0 /lib/observer/src/observer_lib.erl | |
parent | 5ec809d53049d956869f9c17e1eef207c4cc1ed4 (diff) | |
parent | f4a441331b5be0235d6b96bc25e3f904c2c9ea6d (diff) | |
download | otp-f0152387b96dc0c2ce5ecf7805fc435cb400356e.tar.gz otp-f0152387b96dc0c2ce5ecf7805fc435cb400356e.tar.bz2 otp-f0152387b96dc0c2ce5ecf7805fc435cb400356e.zip |
Merge branch 'siri/cdv/multi-line-slogan/ERL-318/OTP-14093' into maint
* siri/cdv/multi-line-slogan/ERL-318/OTP-14093:
[crashdump_viewer] Allow multiple lines in Slogan
Diffstat (limited to 'lib/observer/src/observer_lib.erl')
-rw-r--r-- | lib/observer/src/observer_lib.erl | 14 |
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 |