! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[Patch] Fix colors on some GTK themes, add AC color state, allow user-configu...
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-battery-plugin
Component:
General

Comments

Description Jarrad Whitaker 2010-11-01 04:10:04 CET
Created attachment 3166 
patch to implement above enhancements

Hi,

Just hacked this together over the past day, I'm new to C, diff, gtk, etc so I hope the code isn't too ugly. :)
What got me started was that the bar did not get colours applied on the Dust theme on Ubuntu, so I set about mucking around with styles as hinted at by an obscure mailing list post somewhere.. turns out this was unnecessary (all that needed to be done was to set the background with STATE_SELECTED as well), but I've left it that way as it avoids what looks like a new rcstyle object being created by modify_bg() every poll with the current approach.

After that I bit the bullet and moved the color data to the options struct, and made an option in the configuration dialog for the user to set the colors, based largely on code from the netload plugin. I've also added another color entry for the AC state.

It compiles and runs with no errors, but like I sad I'm new to all this so as for best programming practices... well, I'll need your feedback to judge that. :)

The patch is based on the Ubuntu sources, but the only change they make to battery.c is some separate acpi stuff, which I've removed from the diff. It seems to apply against trunk and 0.5.1 fine.

Hope this is at least useful for someone,

Jarrad
Comment 1 Florian Rivoal editbugs 2010-12-27 15:00:36 CET
Nice, thank you. I haven't had time to look into your patch yet, but it does sound useful. The release of xfce 4.8 is getting close, so I am focusing on this right now, but once that's behind, I'll give your patch a try.

Bug #6757

Reported by:
Jarrad Whitaker
Reported on: 2010-11-01
Last modified on: 2012-04-18

People

Assignee:
Landry Breuil
CC List:
2 users

Version

Version:
0.5.1 or older

Attachments

patch to implement above enhancements (15.09 KB, patch)
2010-11-01 04:10 CET , Jarrad Whitaker
no flags

Additional information