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

Separate Style of Inner Section of the Status bar from Outer #732

Conversation

asim215
Copy link
Contributor

@asim215 asim215 commented Feb 26, 2024

Inner section of status line now is independent from outer section and current mode:

  • easier to read:
    • mode doesn't influence inner section -> less distraction while switching modes.
    • inner section can now have bold style for size and percent.
  • style independent of other sections of status bar

Need to remove comments on theme.toml:51, where I question need of separator_style field. It looks like it used in cand.rs:32.

inner_outer

20240226_17h50m02s_grim

Preview:

Kooha-2024-02-26-17-18-21.mp4

inner now is independent from current mode
- easier to read and set bold style
- less distraction from switching modes
any combination of colors can be set easily
- one for inner section
- other for outer section
style of inner section can be set using bold and others modifications
@sxyazi
Copy link
Owner

sxyazi commented Feb 27, 2024

Thank you for the PR and detailed explanation.

It seems that now the text color in the inner part does not change with the mode switch, it looked like this before:

text-color.mp4

@asim215
Copy link
Contributor Author

asim215 commented Feb 27, 2024

Yes. Here is my case comparison before and after change:

Kooha-2024-02-27-12-52-30.mp4

Here is why I have problem with current implementation:

  1. With light colors in light terminal it became hard to read status bar info.
    • I use two colors as background colors in gruvbox light theme in normal mode: bg2=#d5c4a1, yellow=#d79921.
      Because inner section is depends of colors of outer section I can't make font color inside section all dark color: fg=#3c3836, fg0=#282828. It is always inversed based on outer section inner makes fg=bg_outer, bg=fg_outer. So combination of all dark font on light colors are impossible.
    • I also colorblind (red-green) so I need distinct colors to see text on screen.
    • I need text of inner section in bold, same as bold in outer section to read easily. I cannot set that in current settings of theme.toml.
  2. Outer section in code are combined with separator symbol. So as color of outer section change, separator also changes. Basically setting separator_style doesn't have any affect on outer separator symbol. It is only useful for inner separator symbol which isn't depends on inner section, therefore can be any color. I can't find here any logic why? Maybe only as some sort of indicator? So after changes, now separator_style can me omitted because it takes his color from adjacent section. I have find it usage in one place cand.rs:32, don't know how it will affect after deletion that from theme.toml.
    • Before: (separator+outer_section)[outer_color, outer_style] | (inner_section)[inverse_outer_section_color] | (separator)[separator_color]
    • After: (separator+outer_section)[outer_color, outer_style] | (inner_section+separator)[inner_color, inner_style]
  3. I think it is sufficient to mark mode by color only in outer section. I don't think that there is any need to change inner section after changed mode. For me it brings: 1) distraction; 2) need to carefully choose colors for each of mode so it will look readable on light bg2 color (complexity).
  4. It is hard to read values of size, percent without bold font. Bold style is previously impossible to set for these sections of text in status bar.

Commit require:

  • Decide for need of separator_style after change? theme.rs, theme.toml
  • Remove extra comments
  • Format code to style of project

I can send you my theme.toml, so you will see for yourself.

@asim215
Copy link
Contributor Author

asim215 commented Feb 27, 2024

Here updated gruvbox light theme with current behavior:

Kooha-2024-02-27-19-17-03.mp4

It is basically unreadable for me with light colors aqua = #8ec07c, blue = #83a598.

mode_select = { fg = "#3c3836", bg = "#8ec07c", bold = true }
mode_unset  = { fg = "#3c3836", bg = "#83a598", bold = true } 

@sxyazi
Copy link
Owner

sxyazi commented Feb 27, 2024

Yes. Here is my case comparison before and after change:

Kooha-2024-02-27-12-52-30.mp4
Here is why I have problem with current implementation:

  1. With light colors in light terminal it became hard to read status bar info.

    • I use two colors as background colors in gruvbox light theme in normal mode: bg2=#d5c4a1, yellow=#d79921.
      Because inner section is depends of colors of outer section I can't make font color inside section all dark color: fg=#3c3836, fg0=#282828. It is always inversed based on outer section inner makes fg=bg_outer, bg=fg_outer. So combination of all dark font on light colors are impossible.
    • I also colorblind (red-green) so I need distinct colors to see text on screen.
    • I need text of inner section in bold, same as bold in outer section to read easily. I cannot set that in current settings of theme.toml.
  2. Outer section in code are combined with separator symbol. So as color of outer section change, separator also changes. Basically setting separator_style doesn't have any affect on outer separator symbol. It is only useful for inner separator symbol which isn't depends on inner section, therefore can be any color. I can't find here any logic why? Maybe only as some sort of indicator? So after changes, now separator_style can me omitted because it takes his color from adjacent section. I have find it usage in one place cand.rs:32, don't know how it will affect after deletion that from theme.toml.

    • Before: (separator+outer_section)[outer_color, outer_style] | (inner_section)[inverse_outer_section_color] | (separator)[separator_color]
    • After: (separator+outer_section)[outer_color, outer_style] | (inner_section+separator)[inner_color, inner_style]
  3. I think it is sufficient to mark mode by color only in outer section. I don't think that there is any need to change inner section after changed mode. For me it brings: 1) distraction; 2) need to carefully choose colors for each of mode so it will look readable on light bg2 color (complexity).

  4. It is hard to read values of size, percent without bold font. Bold style is previously impossible to set for these sections of text in status bar.

Commit require:

  • Decide for need of separator_style after change? theme.rs, theme.toml
  • Remove extra comments
  • Format code to style of project

I can send you my theme.toml, so you will see for yourself.

Ah I see your point, it took me some time to understand.

From the video, it seems that only the combination of #d5c4a1 and #d79921 causes a decrease in distinguishability, I think this is because they are very similar colors. Is it possible to work around this issue by changing the color combination?

I do not quite want to change the current theme scheme for the following reasons:

  1. It will reduce the distinguishability when switching modes, when I use the code of this PR, mode switching only occurs in the bottom left (or bottom right) cell. Compared to the previous version, the recognizable area is smaller.
  2. The newly introduced "inner" is somewhat confusing, such as file names, permissions, and components added by users themselves (such as user groups), they are not controlled by "inner", but they are within the "inner" area.
  3. The status bar becomes ugly. 🤣

musjj and others added 22 commits March 5, 2024 20:16
* ci: add cachix workflow (sxyazi#740)

* feat: add hovered as `$0` for shell and opener (sxyazi#738)

* feat: flavor (sxyazi#753)

* feat: add a new `[notify]` section to the `theme.toml` to configure the `notify` component's style (sxyazi#749)

* feat: switch to inline images protocol for VSCode, Tabby, and Hyper

* feat: add `prepend_rules` and `append_rules` for `[open]` in `yazi.toml` (sxyazi#754)

* feat: support `YAZI_FILE_ONE` environment variable for `file(1)` path (sxyazi#752)

* feat: allow both '/' and '\' in folder creation (sxyazi#751)

* perf: apply `add_many()`/`remove_many()` to the visual mode items for selection conflict detecting (sxyazi#758)

* feat: support `%0` as the hovered file for Windows (sxyazi#761)

* feat: `ya.input()` plugin API (sxyazi#762)

* fix: remove redundant check to allow operations on the `shell` command with an empty file list

* feat: add musl linux build targets (sxyazi#759)

* fix: nested conflict detection exception when performing cross-level searches (sxyazi#769)

* refactor: add new `run` property (sxyazi#773)

* feat: add `Ctrl-[` as an escape key (sxyazi#763)

* feat: add `parse` method to `Line` element

* feat: `ya.notify()` plugin API (sxyazi#780)

---------

Co-authored-by: musjj <[email protected]>
Co-authored-by: rrveex <[email protected]>
Co-authored-by: sxyazi <[email protected]>
Co-authored-by: little camel <[email protected]>
Co-authored-by: Filipe Paniguel <[email protected]>
Co-authored-by: Nguyễn Đức Toàn <[email protected]>
Co-authored-by: Konrad Baran <[email protected]>
Co-authored-by: hankertrix <[email protected]>
@sxyazi
Copy link
Owner

sxyazi commented May 16, 2024

I'm going to close this because it still needs some work and hasn't seen any activity recently. @asim215 thanks for the effort!

@sxyazi sxyazi closed this May 16, 2024
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

Successfully merging this pull request may close these issues.

None yet

9 participants