Sublime Forum

Background color of find and build results

#1

In my effort to continuously optimize Monokai Pro, I’m looking for a way to style the background color of the find results output (when not using a buffer), and the build results output. I also like to adjust the left margin, which seems to be an empty space. Below is a screenshot:

Oddly enough, the console output panel has a background that seems to come from Widget.hidden-color-scheme. But the build and find results don’t seem to pick this up. Any pointers how I can adjust the background color and margins of the other panel outputs? I cannot find anything that seems to do what I want in the theming docs.

0 Likes

#2

the obvious choice for find results would be the syntax specific settings

0 Likes

#3

The console and build / output are both text_output_control classes. Both use the color scheme set in the Widget.sublime-settings or Widget - .sublime-settings. If none is set, the global color scheme is used.

A theme can modify the background color with the color_scheme_tint attribute. An adaptive theme, which adapts its colors from the global color scheme might want to set two different tinting rules for dark and light color schemes.

The color_scheme_tint value needs to be adjusted to match the `panel_control``s background color.

Example

{
  "variables": {
    "panel_output_tint-dark": "color(white alpha(7.5%))",
    "panel_output_tint-light": "color(black alpha(7.5%))",
  },
  "rules": [
    {
      "class": "text_output_control",
      "color_scheme_tint": "var(panel_output_tint-dark)"
    },
    {
      "class": "text_output_control",
      "parents": [
        {"class": "window", "attributes": ["file_light"]}
      ],
      "color_scheme_tint": "var(panel_output_tint-light)"
    },
  ]
}

Result

The margins are controlled via panel_control class or one of its subsequent classes

    // Panal Specific Margins

    {
      "class": "panel_control find_panel",
      "content_margin": [6, 12, 6, 11]
    },
    {
      "class": "panel_control replace_panel",
      "content_margin": [6, 12, 6, 11]
    },
    {
      "class": "panel_control find_in_files_panel",
      "content_margin": [6, 12, 12, 11]
    },
    {
      "class": "panel_control input_panel",
      "content_margin": 12
    },
    {
      "class": "panel_control output_panel",
      "content_margin": [0, 8]
    },
    {
      "class": "panel_control console_panel",
      "content_margin": 12
    },
1 Like

#4

Thank you, text_output_control, that was the setting for the background color of the build and find results! It’s not in the theme docs. Where did you find it?

Re: margins: Thanks, I already had most of that settings in place. It seems the find results specifically have an area on the left side, which I don’t yet understand the function of. I was looking to get rid of it, but maybe it serves a purpose.

One more question. The console output is correctly styled by Widget - Monokai Pro.sublime-settings. I use it to adjust the text selection background color, which visually depends on the background color. The find and build results don’t seem to pick this up. Do you perhaps also know where I can set the text selection background color of the find and build results?

0 Likes

#5

I found text_output_control in the DA UI theme. If it is missing, we should probably raise a core issue to ask @wbond to add it.

Find Results and Build Output are both normal output panels. Hence they use the global preferences like color scheme or syntax by default. While the “Find in Files” panel how it is called internally seems to be implemented in ST core, the build output panel is created by the Default/exec.py.

The spacing in the left of the “Find in Files” panel is the gutter, I guess. From what I’ve read so far disabling it would disable the active line highlighting as well.

I am not aware of whether they are meant to use Widgets.sublime-settings or not. Otherwise modifying their settings would require a plugin which uses the API to alter settings like color scheme. Bu I don’t think this is a good idea.

0 Likes

#6

Thanks for investigating.

I agree it’s not a good idea to use the API to style the line selection background color.

I think there’s some settings missing in Sublime Text. I’ve raised a feature request here: https://github.com/SublimeTextIssues/Core/issues/2743

0 Likes