[erlang-questions] color customization
Dan Gudmundsson
dangud@REDACTED
Fri Jan 29 15:09:06 CET 2016
The debugger uses wxStyledTextCtrl which seems to override window manager
settings for background, it is easy to override the hard coded values but
different from other windows which is why it probably does not work by
default.
Not as trivial to fix so that it works for all (themes/OSes), tough.
Example:
diff --git a/lib/debugger/src/dbg_wx_code.erl
b/lib/debugger/src/dbg_wx_code.erl
index a0e6c94..cd85fe7 100644
--- a/lib/debugger/src/dbg_wx_code.erl
+++ b/lib/debugger/src/dbg_wx_code.erl
@@ -88,10 +88,12 @@ code_area(Parent) ->
{?wxSTC_ERLANG_MODULES, {64,102,244}},
{?wxSTC_ERLANG_MODULES_ATT, {64,102,244}}
],
+ ?stc:styleSetBackground(Ed, ?wxSTC_STYLE_DEFAULT, {127,127,127}),
SetStyle = fun({Style, Color}) ->
?stc:styleSetFont(Ed, Style, FixedFont),
- ?stc:styleSetForeground(Ed, Style, Color)
+ ?stc:styleSetForeground(Ed, Style, Color),
+ ?stc:styleSetBackground(Ed, Style, {127,127,127})
end,
[SetStyle(Style) || Style <- Styles],
?stc:setKeyWords(Ed, 0, keyWords()),
I guess most of the other windows work OK then, since tables in observer
are hardcoded in observer_defs.hrl, see BG_EVEN/ODD defines.
Regards
/Dan
On Fri, Jan 29, 2016 at 1:49 PM Serge Aleynikov <serge@REDACTED> wrote:
> How do I get the Window of that code view window?
>
> I tried:
> 2> f(P1),f(P2), {links,[P1,P2]} =
> erlang:process_info(whereis(dbg_wx_winman), links).
> {links,[<0.273.0>,<0.1974.0>]}
> (mta@REDACTED)10> wxWindow:setBackgroundColour(P2, {128,128,128}).
> ** exception error: no function clause matching
> wxWindow:setBackgroundColour(<0.1974.0>,
>
> Apparently the Window is not a Pid but some tuple created by wxWindow.
>
> If you could implement color customization/saving along with having a
> default light/dark themes that would be great.
>
> This is currently what debugger looks like by default:
>
> [image: image.png]
>
> This is what observer looks like:
>
> [image: image.png]
>
> On Fri, Jan 29, 2016 at 4:16 AM, Dan Gudmundsson <dangud@REDACTED> wrote:
>
>>
>> Does wxWindow:setBackgroundColour(Window, Color) work?
>>
>> Anyway that is the simple part, storing configurations, for colors/fonts
>> and so on is the large part of the patch.
>>
>>
>> On Thu, Jan 28, 2016 at 7:20 PM Serge Aleynikov <serge@REDACTED>
>> wrote:
>>
>>> Is it possible to customize background color in the "View Module" window
>>> of the debugger? I have a dark theme in KDE, and the current white
>>> background in that window is very irritating.
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160129/1740c604/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 92936 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160129/1740c604/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 23223 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160129/1740c604/attachment-0001.png>
More information about the erlang-questions
mailing list