Ticket #411 (assigned defect)

Opened 2 years ago

Last modified 1 month ago

Set theme colours and fonts

Reported by: klattimer Assigned to: klattimer (accepted)
Priority: critical Milestone: 0.1.3 - Point release
Component: UI/GNOME/FirstRun Severity: enhancement
Keywords: Cc:

Description (Last modified by klattimer)

It would be cool to inherit the theme colours from the gtk theme and apply them to wine. A tip on how to do this can be found on HOWTO: Change colors of wine applications on Ubuntu forums and also this HOWTO: Make Wine less of an eyesore (fonts and colors) from justlinux

Attachments

Change History

02/10/07 13:36:45 changed by klattimer

  • status changed from new to assigned.
  • severity changed from catastrophic to enhancement.
  • component changed from Core to UI/GNOME/FirstRun.
  • priority changed from major to critical.
  • milestone set to 0.2.
  • owner set to klattimer.

02/10/07 13:39:09 changed by klattimer

  • description changed.
  • summary changed from Set theme colours to Set theme colours and fonts.

04/24/07 09:58:29 changed by klattimer

  • milestone changed from 0.2 to 0.1.

05/13/07 17:34:50 changed by klattimer

  • milestone changed from 0.1 to 0.2.

12/01/07 05:24:11 changed by astormont

Someone has already provided a wine-doors package to implement the ubuntu human theme in WINE. We can just alter it for all other distros.

Once the package has been committed to SVN, I'll close this.

01/22/08 03:51:16 changed by klattimer

From Jayson Taylor

#!/usr/bin/env python
import pygtk
import gtk


def format_color_string( Color ):
    return "%s %s %s" % (Color.red /256, Color.green/256,  Color.blue/256)
    
def format_color_key( key, Color): 
    return "\"%s\"=\"%s\"\n" % (key, format_color_string( Color ))
    

invisible1 = gtk.Invisible()
style1 = invisible1.style

button1 = gtk.Button()
buttonstyle = button1.style

scroll1 =  gtk.VScrollbar()
scrollbarstyle = scroll1.style

menu1 = gtk.Menu()
menuitem1 = gtk.MenuItem()
menu1.add(menuitem1)
menustyle = menuitem1.style

user_reg = """WINE REGISTRY Version 2 
;; All keys relative to \\User\\S-1-5-4

[Control Panel\\\\Colors]
"""

# http://www.moeraki.com/pygtkreference/pygtk2reference/class-gtkstyle.html
# http://lists.ximian.com/pipermail/mono-winforms-list/2003-August/000469.html

user_reg += format_color_key('Scrollbar', scrollbarstyle.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('Background', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('ActiveTitle', menustyle.bg[gtk.STATE_PRELIGHT])
user_reg += format_color_key('InactiveTitle', menustyle.bg[gtk.STATE_PRELIGHT])
user_reg += format_color_key('Menu', menustyle.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('Window', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('WindowFrame', style1.fg[gtk.STATE_INSENSITIVE])
user_reg += format_color_key('MenuText', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('WindowText', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('TitleText', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('ActiveBorder', menustyle.bg[gtk.STATE_PRELIGHT])
user_reg += format_color_key('InactiveBorder', menustyle.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('AppWorkSpace', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('Hilight', menustyle.bg[gtk.STATE_PRELIGHT])
user_reg += format_color_key('HilightText', style1.bg[gtk.STATE_PRELIGHT])
user_reg += format_color_key('ButtonFace', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('ButtonShadow', style1.bg[gtk.STATE_INSENSITIVE])
user_reg += format_color_key('GrayText', style1.fg[gtk.STATE_INSENSITIVE])
user_reg += format_color_key('ButtonText', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('InactiveTitleText', style1.fg[gtk.STATE_INSENSITIVE])
user_reg += format_color_key('ButtonHilight', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('ButtonShadow', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('ButtonLight', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('InfoText', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('InfoWindow', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('ButtonAlternateFace', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('ButtonHilight', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('GradientActiveTitle', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('GradientInactiveTitle', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('MenuHilight', menustyle.bg[gtk.STATE_NORMAL])

print user_reg 

01/27/08 08:07:42 changed by klattimer

  • milestone changed from 0.2 - the refactoring to 0.1.3 - Point release.

08/01/08 22:40:34 changed by endolith@gmail.com

I took a stab at improving this script, but I am lost. See http://ubuntuforums.org/showthread.php?p=5506889#post5506889


Add/Change #411 (Set theme colours and fonts)