Progress bar colors

Specific support for Deluge on Microsoft Windows OS
Post Reply
tayyem
New User
New User
Posts: 1
Joined: Tue Jun 18, 2024 11:11 pm

Progress bar colors

Post 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
mhertz
Moderator
Moderator
Posts: 2331
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Progress bar colors

Post 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.
tayyem
New User
New User
Posts: 1
Joined: Tue Jun 18, 2024 11:11 pm

Re: Progress bar colors

Post by tayyem »

Ahhhh thats a shame.
Thank you very very much for this thorough response hopefully it helps someone else.
<3
Last edited by tayyem on Wed Jun 19, 2024 10:24 pm, edited 1 time in total.
mhertz
Moderator
Moderator
Posts: 2331
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Progress bar colors

Post by mhertz »

Love back bro, appreciated :)
Post Reply