diff options
author | Dan Gudmundsson <[email protected]> | 2019-06-19 15:23:04 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2019-06-19 15:23:04 +0200 |
commit | 528e55e44cf1ee32d90d8c4c4d5790d18cae79bc (patch) | |
tree | 1683d6381285ffcd7f4e5d2858068ebb9e39b483 /lib/observer/src/observer_port_wx.erl | |
parent | b4e80a810e9d7c86b9d69f0d8cdaf9303318f109 (diff) | |
download | otp-528e55e44cf1ee32d90d8c4c4d5790d18cae79bc.tar.gz otp-528e55e44cf1ee32d90d8c4c4d5790d18cae79bc.tar.bz2 otp-528e55e44cf1ee32d90d8c4c4d5790d18cae79bc.zip |
observer: Support darkmode gui
Diffstat (limited to 'lib/observer/src/observer_port_wx.erl')
-rw-r--r-- | lib/observer/src/observer_port_wx.erl | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/observer/src/observer_port_wx.erl b/lib/observer/src/observer_port_wx.erl index 00cf1b5fba..5cb6d9bc22 100644 --- a/lib/observer/src/observer_port_wx.erl +++ b/lib/observer/src/observer_port_wx.erl @@ -61,7 +61,8 @@ inet}). -record(opt, {sort_key=2, - sort_incr=true + sort_incr=true, + odd_bg }). -record(state, @@ -111,7 +112,10 @@ init([Notebook, Parent, Config]) -> wxListCtrl:connect(Grid, size, [{skip, true}]), wxWindow:setFocus(Grid), - {Panel, #state{grid=Grid, parent=Parent, panel=Panel, timer=Config}}. + Even = wxSystemSettings:getColour(?wxSYS_COLOUR_LISTBOX), + Odd = observer_lib:mix(Even, wxSystemSettings:getColour(?wxSYS_COLOUR_HIGHLIGHT), 0.8), + Opt = #opt{odd_bg=Odd}, + {Panel, #state{grid=Grid, parent=Parent, panel=Panel, timer=Config, opt=Opt}}. handle_event(#wx{id=?ID_REFRESH}, State = #state{node=Node, grid=Grid, opt=Opt}) -> @@ -553,7 +557,7 @@ filter_monitor_info() -> update_grid(Grid, Sel, Opt, Ports) -> wx:batch(fun() -> update_grid2(Grid, Sel, Opt, Ports) end). -update_grid2(Grid, Sel, #opt{sort_key=Sort,sort_incr=Dir}, Ports) -> +update_grid2(Grid, Sel, #opt{sort_key=Sort,sort_incr=Dir, odd_bg=BG}, Ports) -> wxListCtrl:deleteAllItems(Grid), Update = fun(#port{id = Id, @@ -563,8 +567,8 @@ update_grid2(Grid, Sel, #opt{sort_key=Sort,sort_incr=Dir}, Ports) -> controls = Ctrl}, Row) -> _Item = wxListCtrl:insertItem(Grid, Row, ""), - if (Row rem 2) =:= 0 -> - wxListCtrl:setItemBackgroundColour(Grid, Row, ?BG_EVEN); + if (Row rem 2) =:= 1 -> + wxListCtrl:setItemBackgroundColour(Grid, Row, BG); true -> ignore end, |