[Gambas-user] HTML Tags in TextEditor is always foreground black

Martin Belmonte mbelmonte at belmotek.net
Thu Feb 10 00:37:43 CET 2022


The html tags forward color appear in black and are not visible in dark 
themes.
I have tried to apply, in the form editing mode, the properties of the 
control (texteditor) highlight and mode but there is no case, always the 
same result.
I don't know if it's a bug or if there's something I'm missing.
Note: component: gb.gui   desktop: gtk3

This using .theme
https://imgur.com/mqyHH1J

This using zen.theme
https://imgur.com/v5Ywkpa

Attachments, themes and the method for convert the info in theme file to 
collection.

Regards.
Martín.
-------------- next part --------------
'' Carga el tema de visualizacion para el TextEditor

Public Sub AplyTheme(Optional strPath As String)

  Dim tgg As String
  Dim tmp As String
  Dim vrt As Variant
  Dim cnx As New Collection

  Dim r As String

  cnx.Clear
  'strPath = "./editor-themes/gaucho.theme"
  'If Application.DarkTheme Then
  'strPath = "./editor-themes/oblivion.theme"
  'strPath = "./editor-themes/dark.theme"
  'Else
  strPath = "./editor-themes/zen.theme"
  'Endif

  For Each r In Split(File.Load(strPath), "\n")
    If InStr(r, "=") > 0 Then
      tgg = Split(r, "=")[0]
      tmp = Replace(Split(r, "=")[1], "\"", "")
      tmp = Replace(tmp, "#", "&H")
      If InStr(tmp, ",") > 0 Then
        'vrt = [Val(Split(tmp, ",")[0]), Split(tmp, ",")[1]]
        vrt = Val(Split(tmp, ",")[0])
      Else
        vrt = Val(tmp)
      Endif
      cnx.Add(vrt, tgg)
    Endif
  Next
  TextEditor1.Highlight = "HTML"
  ' With TextEditor1
  '    .Mode = "HTML"
  '   .Styles[Highlight.Background].Color = cnx["Background"] 'Val(strVal)
  '   .Styles[Highlight.Normal].Color = cnx["Normal"]
  '   .Styles[Highlight.Keyword].Color = cnx["Keyword"]
  '   .Styles[Highlight.DataType].Color = cnx["Datatype"]
  '   .Styles[Highlight.Function].Color = cnx["Function"]
  '   .Styles[Highlight.Operator].Color = cnx["Operator"]
  '   .Styles[Highlight.Symbol].Color = cnx["Symbol"]
  '   .Styles[Highlight.Number].Color = cnx["Number"]
  '   .Styles[Highlight.String].Color = cnx["String"]
  '   .Styles[Highlight.Comment].Color = cnx["Comment"]
  '
  '   .Styles[Highlight.Preprocessor].Color = cnx["Preprocessor"]
  '   .Styles[Highlight.Breakpoint].Color = cnx["Breakpoint"]
  '   .Styles[Highlight.Current].Color = cnx["Current"]
  '   .Styles[Highlight.Selection].Color = cnx["Selection"]
  '   .Styles[Highlight.Highlight].Color = cnx["Highlight"]
  '   .Styles[Highlight.CurrentLine].Color = cnx["CurrentLine"]
  '   .Styles[Highlight.Error].Color = cnx["Error"]
  '
  '   '.Styles[Highlight.Escape].Color = cnx["Escape"]
  '
  '   '.Styles[Highlight.Constant].Color = cnx["Constant"]
  '   '.Styles[Highlight.Alternate].Color = cnx["Alternate"]
  '   '.Styles[Highlight.Added].Color = cnx["Added"]
  '   '.Styles[Highlight.Removed].Color = cnx["Removed"]
  '   '.Styles[Highlight.Class].Color = cnx["Class"]
  '   '.Styles[Highlight.Id].Color = cnx["Id"]
  '   '.Styles[Highlight.Element].Color = cnx["Element"]
  '   '.Styles[Highlight.Property].Color = cnx["Property"]
  '   '.Styles[Highlight.Pseudo].Color = cnx["Pseudo"]
  '   '.Styles[Highlight.Rule].Color = cnx["Rule"]
  '   '.Styles[Highlight.Important].Color = cnx["Important"]
  '   '.Styles[Highlight.File].Color = cnx["File"]
  '   '.Styles[Highlight.Header].Color = cnx["Header"]
  '   '.Styles[Highlight.Position].Color = cnx["Position"]
  '   '.Styles[Highlight.Markup].Color = cnx["Markup"]
  '   '.Styles[Highlight.Attribute].Color = cnx["Attribute"]
  '   '.Styles[Highlight.Value].Color = cnx["Value"]
  '   '.Styles[Highlight.Entity].Color = cnx["Entity"]
  '   '.Styles[Highlight.WebMarkup].Color = cnx["WebMarkup"]
  '   '.Styles[Highlight.WebComment].Color = cnx["WebComment"]
  '   '.Styles[Highlight.WebArgument].Color = cnx["WebArgument"]
  ' 'End With
  ' 'Endif

  TextEditor1.Refresh

End
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dark.theme
Type: application/x-theme
Size: 390 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220210/d55976ed/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oblivion.theme
Type: application/x-theme
Size: 447 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220210/d55976ed/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zen.theme
Type: application/x-theme
Size: 391 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220210/d55976ed/attachment-0002.bin>


More information about the User mailing list