loskutov / deadbeef-lyricbar

A simple plugin for DeaDBeeF audio player that fetches and shows the song’s lyrics
MIT License
29 stars 8 forks source link

Ability to change background/text colors #4

Closed DaarkWel closed 2 years ago

DaarkWel commented 6 years ago

Please add. It looks pretty weird with my color scheme. Like a white bald spot :-)

loskutov commented 6 years ago

I think the problem is caused by your color scheme, which lyricbar totally obeys. For instance, here's what it looks like with the Arc-dark theme: Arc-dark sample

DaarkWel commented 6 years ago

I meant color scheme of Deadbeef, not GTK theme. I am using gtk2 version and I overrode gtk settings in Deadbeef preferences — Appearance — Playlist (I just need white background and black text in all my other gtk applications, like text editor and browser, but Deadbeef looks better with dark background). Other Deadbeef plugins that I'm using — Waveform Seekbar and Spectrogram — has color settings, but Lyricbar has neither such option nor ability to inherit overriden options from Deadbeef.

C0rn3j commented 5 years ago

I have a similar question - how do I change color of partial text in the code? I've been staring at it myself, and figured I should probably be doing something with Pango judging from code like this

    tagItalic = refBuffer->create_tag();
    tagItalic->property_style() = Pango::STYLE_ITALIC;

But I suck at C/C++ so I can't really figure out what exactly I need to do, having an example would be awesome.

I want to see if I can do something like this - image

loskutov commented 5 years ago

@C0rn3j check this: https://developer.gnome.org/gtkmm-tutorial/stable/sec-textview-buffer.html.en#textview-formatting

You need to create a tag to hold the color (the example they have is refTagMatch->property_background() = "orange", foreground is available in a similar manner) and then use apply_tag to apply it to a portion of the text. I do something similar inside set_lyrics, except I use insert_with_tags because formatting is static in my case.

C0rn3j commented 5 years ago

I've tried setting both background and foreground to orange as per the example via both ways (applying it to specific text or just adding it directly with the formatting) and neither works.

The text will get added but it'll have the same black color as everything else, do you perhaps see what I'm doing wrong?

image