Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too much padding in a custom list view #18

Open
rchl opened this issue Jul 26, 2022 · 12 comments
Open

Too much padding in a custom list view #18

rchl opened this issue Jul 26, 2022 · 12 comments

Comments

@rchl
Copy link
Member

rchl commented Jul 26, 2022

On Mac, build 4134, DAneo Elegant.

The LSP "Go to diagnostic" panel looks like this here:

Screenshot 2022-07-26 at 10 41 02

Note how much padding each item has. I feel that it's too much and it wastes quite a bit of useful space that could be otherwise used to avoid scrolling (especially with smaller window sizes).

As an example this is the built-in "Goto Symbol in Project" using DAneo. There is much better IMO:

Screenshot 2022-07-26 at 10 41 17

And for reference, this is "Go to diagnostic" in adaptive theme:

Screenshot 2022-07-26 at 10 40 55

@deathaxe
Copy link
Member

deathaxe commented Jul 26, 2022

It's looking pretty well on Windows.

Default theme

grafik

DAneo Origin

grafik

Sure you have the latest release and no overrides anywhere?

None of the few OS specific rules themes related with this issue.

The following rule is responsible to remove all row paddings for overlay controls with kind info.

{
"class": "quick_panel",
"parents": [
{"class": "overlay_control kind_info"}
],
"row_padding": [0, 0, 0, 0]
},

That's important as padding is controlled by symbol_container or kind_container in this case.

@rchl
Copy link
Member Author

rchl commented Jul 26, 2022

Using latest version and no relevant overrides.

I went and investigated a little and the rule you've pointed out didn't make any difference but this one did:

{
"class": "quick_panel",
"row_padding": [12, 7, 12, 7],
"dark_content": true,
"layer0.tint": "var(quick_panel_bg-dark)",
"layer0.opacity": 0.0
},

With [12, 0, 12, 0] paddings it looks more like I would expect:

Screenshot 2022-07-26 at 18 52 53

@deathaxe
Copy link
Member

That's the basic rule, which is applied to all quick panels. Your change would end up in all non-kind_info containing quick panels' rows to have no padding.

It should be overridden by the one I've linked.

Could you enable sublime.log_control_tree() and click on a label?

It should look as follows:

     ...

     overlay_control command_palette kind_info pos: 364,75.3333 size: 588,200 
         .content_margin=[16, 16, 16, 31]
         .layer0.inner_margin=[24, 19, 24, 34]
         .layer0.opacity=1
         .layer0.texture=res://Packages/Theme - DAneo/textures/overlay/overlay_shadow--mt10.png
         .layer1.inner_margin=[20, 16, 20, 32]
         .layer1.opacity=1
         .layer1.texture=res://Packages/Theme - DAneo/textures/overlay/overlay--mt10--bw0--br4.png
         .layer1.tint=[58, 66, 75, 255]
         .layer2.draw_center=false
         .layer2.inner_margin=[20, 16, 20, 32]
         .layer2.opacity=1
         .layer2.texture=res://Packages/Theme - DAneo/textures/overlay/overlay--mt10--bw1--br4.png
         .layer2.tint=[41, 48, 55, 255]
      scroll_area_control [scrollable] pos: 380,150 size: 556,47
          .overlay=true
       control pos: 380,150 size: 556,47.3333
        quick_panel pos: 380,150 size: 632.667,125.333
            .dark_content=true
            .row_padding=[0, 0, 0, 0]
            .layer0.tint=[58, 66, 75, 255]
         mini_quick_panel_row [selected] pos: 380,150 size: 556,31.3333
             .layer0.opacity=1
             .layer0.tint=[255, 255, 255, 13]
          control pos: 380,150 size: 556,31.3333
           symbol_container pos: 410,150 size: 526,31.3333
               .content_margin=[3, 7, 12, 7]
            quick_panel_label pos: 413,157 size: 244,17

     ...

1st line is important: overlay_control command_palette kind_info.

@rchl
Copy link
Member Author

rchl commented Jul 26, 2022

So you don't see any differences in padding between the "Goto diagnostic" and the native "Goto Symbol in Project"?

@deathaxe
Copy link
Member

Nope

@deathaxe
Copy link
Member

But I can barely remember a ST bug, which caused kind_info not to be applied to command palette.

@deathaxe
Copy link
Member

@rchl
Copy link
Member Author

rchl commented Jul 26, 2022

control tree at: 1016.23,134.512
title_bar [file_medium_dark] pos: 0,0 size: 1905,1302
    .bg=[58, 66, 75, 255]
    .fg=[255, 255, 255, 140]
 edit_window window [file_medium_dark] pos: 0,0 size: 1905,1302
  grid_layout_control pos: 271,0 size: 1634,821
      .border_color=[58, 66, 75, 255]
      .border_size=2
   pane_container_control pos: 271,0 size: 1634,821
    control pos: 746,42 size: 683,328
     overlay_control command_palette pos: 746,42 size: 683,328
         .content_margin=[16, 16, 16, 31]
         .layer0.inner_margin=[24, 19, 24, 34]
         .layer0.opacity=1
         .layer0.texture=res://Packages/Theme - DAneo/textures/overlay/overlay_shadow--mt10.png
         .layer1.inner_margin=[20, 16, 20, 32]
         .layer1.opacity=1
         .layer1.texture=res://Packages/Theme - DAneo/textures/overlay/overlay--mt10--bw0--br4.png
         .layer1.tint=[58, 66, 75, 255]
         .layer2.draw_center=false
         .layer2.inner_margin=[20, 16, 20, 32]
         .layer2.opacity=1
         .layer2.texture=res://Packages/Theme - DAneo/textures/overlay/overlay--mt10--bw1--br4.png
         .layer2.tint=[41, 48, 55, 255]
      scroll_area_control [scrollable] pos: 762,111 size: 651,181
          .overlay=true
       control pos: 762,111 size: 651,181
        quick_panel pos: 762,111 size: 678,308
            .dark_content=true
            .row_padding=[12, 7, 12, 7]
            .layer0.tint=[58, 66, 75, 255]
         mini_quick_panel_row [selected] pos: 762,111 size: 651,44
             .layer0.opacity=1
             .layer0.tint=[255, 255, 255, 13]
          control pos: 774,118 size: 627,30
           symbol_container pos: 798,118 size: 603,30
               .content_margin=[3, 7, 12, 7]
            quick_panel_label pos: 801,125 size: 400,16
                .fg=[255, 255, 255, 217]
                .font.face=system
                .font.mono_face=system
                .font.mono_size=12
                .font.size=12
                .match_fg=[255, 255, 255, 242]
                .selected_fg=[255, 255, 255, 242]
                .selected_match_fg=[108, 163, 218, 255]
    sheet_container_control pos: 271,42 size: 1634,779
        .layer0.opacity=1
     scroll_area_control [scrollable] pos: 271,42 size: 1634,779
         .overlay=true
      control pos: 271,42 size: 1485,779
       text_area_control sheet_contents [file_medium_dark, highlighted] pos: 271,42 size: 1485,19011
           .deleted_line_texture=36

@deathaxe
Copy link
Member

Exactly the bug: kind_info is missing. It seems fixed in ST 4134 on Windows though.

@rchl
Copy link
Member Author

rchl commented Jul 26, 2022

I'll take the liberty of pinging @BenjaminSchaaf instead of pinging the issue.

@rchl
Copy link
Member Author

rchl commented Nov 1, 2022

It is wrong when triggering the command using key binding:

    {
        "keys": ["shift+f8"]
        "command": "lsp_goto_diagnostic",
    }

Screenshot 2022-11-01 at 13 05 05

or through the main menu (Goto -> LSP: Goto diagnostic).

It looks fine when using LSP: Goto diagnostic... from the command palette:

Screenshot 2022-11-01 at 13 05 51

The command palette entry is:

    {
        "caption": "LSP: Goto Diagnostic",
        "command": "lsp_goto_diagnostic",
    },

(actual entry also includes "args" but I've reproduced without it too)

Code of the command: https://github.com/sublimelsp/LSP/blob/2a7b3bae8ae2d47cff58e7e7f5ebb16eebdf304e/plugin/goto_diagnostic.py#L36-L78

@deathaxe
Copy link
Member

deathaxe commented Nov 1, 2022

Can reproduce it with your steps on Windows as well.

With shift+f8 padding is too much. Selecting a file and removing it again via backspace brings everything to normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants