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

Icons with Themed Splits #7

Closed
alkaris2 opened this issue Jun 30, 2023 · 3 comments
Closed

Icons with Themed Splits #7

alkaris2 opened this issue Jun 30, 2023 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@alkaris2
Copy link

I'm unsure how to add icons to Themed splits, though it follows the specifications of GTK3 for CSS, it's unclear how it's intended to be used and applied to theming for splits. the documentation of GTK3 mentions things like -gtk-icon-source for icon properties, but simply putting it into the CSS doesn't necessarily do anything or make icons appear in each split when listed. I've tried adding sub-class names for splits, but this also didn't seem to work.

ie; .split.split-name-1:before

@paoloose
Copy link
Owner

paoloose commented Jul 1, 2023

Sadly there is no (supported) way to add icons to splits. This is a desired feature, however.
Although the original repo shows a screenshot with icons in its README, when looking at the code I didn't find anything related to split icons. (If you see icons in this project's README, they are actually emojis).

the documentation of GTK3 mentions things like -gtk-icon-source for icon properties

Those icons are only related to some gtk built-in widgets such as checks, radios, arrows, etc.

ie; .split.split-name-1:before

I couldn't find anything about GTK css pseudo elements, so I think they are not supported.

As I said, split icons are a desired feature. I'm not having time to work on this for now, hopefully soon. If someone want to help, the desired way to define splits icons would be in an "icon" property for each split object in the splits json file; not in the .css themes :)

@paoloose paoloose added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 1, 2023
@paoloose
Copy link
Owner

paoloose commented Jul 1, 2023

If you need icons so badly, this dirty workaround may help:

In your css theme:

.split .split-title {
  padding-left: 26px;
  background-repeat: no-repeat;
  background-size: 20px;
}

And for each split you want to put an icon on:

.split:nth-child(1) .split-title {
  background-image: url('<url>');
}
.split:nth-child(2) .split-title {
  background-image: url('<url>');
}
.split:nth-child(3) .split-title {
  background-image: url('<url>');
}
/* ... */

Where <url> is an existing file (preferably an absolute path) in your system or a link to a web image.

@paoloose
Copy link
Owner

This feature was implemented in 9f30f32!

See https://github.com/paoloose/urn/blob/main/splits_examples/minecraft_speedrun.json for an example using split icons :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants