Theme-DAneo icon indicating copy to clipboard operation
Theme-DAneo copied to clipboard

Too much padding in a custom list view

Open rchl opened this issue 3 years ago • 12 comments

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

rchl avatar Jul 26 '22 08:07 rchl

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.

https://github.com/SublimeText/Theme-DAneo/blob/642f43a75b4fe8c8b22c0317ed5727578207aec4/themes/DAneo%20Base.hidden-theme#L1165-L1171

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

deathaxe avatar Jul 26 '22 16:07 deathaxe

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:

https://github.com/SublimeText/Theme-DAneo/blob/642f43a75b4fe8c8b22c0317ed5727578207aec4/themes/DAneo%20Base.hidden-theme#L1150-L1156

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

Screenshot 2022-07-26 at 18 52 53

rchl avatar Jul 26 '22 16:07 rchl

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.

deathaxe avatar Jul 26 '22 17:07 deathaxe

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

rchl avatar Jul 26 '22 17:07 rchl

Nope

deathaxe avatar Jul 26 '22 17:07 deathaxe

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

deathaxe avatar Jul 26 '22 17:07 deathaxe

https://github.com/sublimehq/sublime_text/issues/4832

deathaxe avatar Jul 26 '22 17:07 deathaxe

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

rchl avatar Jul 26 '22 17:07 rchl

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

deathaxe avatar Jul 26 '22 17:07 deathaxe

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

rchl avatar Jul 26 '22 17:07 rchl

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

rchl avatar Nov 01 '22 12:11 rchl

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.

deathaxe avatar Nov 01 '22 12:11 deathaxe