Page 1 of 1

Progress bar colors

Posted: Tue Jun 18, 2024 11:20 pm
by tayyem
Hello

Is there anyway to to change progress bar color (ex: red while downloading, blue for seeding, grey for completed etc...)

I'm using deluge 2.1.1 on windows 10 64-bit, im not sure about the specifics but i seem to have the gtk-3.0 version (?) since i had to create an etc folder to use the already embedded dark mode using this comment here. viewtopic.php?p=234478#p234478

Re: Progress bar colors

Posted: Wed Jun 19, 2024 8:08 am
by mhertz
Hi :)

The piecesbar colors is configurable in 'gtk3ui.conf' in profile dir(on windows '%appdata%\deluge') as:

Code: Select all

    'pieces_color_missing': [65535, 0, 0],
    'pieces_color_waiting': [4874, 56494, 0],
    'pieces_color_downloading': [65535, 55255, 0],
    'pieces_color_completed': [4883, 26985, 56540],
Edit: Google e.g 'red hex color' to get hex number for said color wanted, or just 'hex color codes' to get full list.

Edit2: Sorry, didn't even notice that each color have 3 values defined, which I should have cought simply from the function name itself('cairo.Context.set_source_rgb()') - It's then RGB values(red green, blue) which can be google'd also.

Note, the docs state these are floating point values between 0 and 1 and so doesn't match with the values in gtk3ui.conf, but that's because deluge divides each of these firstly with 65535(to make the 16 bit values be floats between 0 and 1) I.e here's relevant part from piecesbar.py:

Code: Select all

 
COLOR_STATES = ['missing', 'waiting', 'downloading', 'completed']
[...] 
pieces_ctx = cairo.Context(self.pieces_overlay)
[...]
pieces_colors = [
                [
                    color / 65535
                    for color in self.gtkui_config['pieces_color_%s' % state]
                ]
                for state in COLOR_STATES
            ]
            for state in pieces:
                pieces_ctx.set_source_rgb(*pieces_colors[state])
Just for completeness.

Lastly, I apologize for stating wrongly that it was just single hex values originally, doh, sorry about that.

Edit3: I now see there's even direct support for changing these colors in gtk-ui preferences itself, which I should've caught myself when seeing part of prefs dict, don't know what was thinking there lol, sorry.

Edit4: I reread your post and found completely misunderstood your clear question, so feel little stupid now, sorry buddy. Unfortunately no, would need add extra code for that, and on windows also rebuild deluge and replace deluge.exe as needed file freezed with pyinstaller into it. Sorry.

Re: Progress bar colors

Posted: Wed Jun 19, 2024 10:23 pm
by tayyem
Ahhhh thats a shame.
Thank you very very much for this thorough response hopefully it helps someone else.
<3

Re: Progress bar colors

Posted: Thu Jun 20, 2024 9:53 am
by mhertz
Love back bro, appreciated :)