Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 39

Thread: HOWTO: Change colors of wine applications

  1. #21
    Join Date
    Oct 2007
    Beans
    832
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: Change colors of wine applications

    do I copy this into a file and then run it? Can you pls explain this a little more detailed for the novice.

    Thanks in advance...

  2. #22
    Join Date
    Apr 2005
    Location
    C A N A DA
    Beans
    268
    Distro
    Ubuntu

    Re: HOWTO: Change colors of wine applications

    Quote Originally Posted by KillerKiwi View Post
    I've started this... it grabs the color scheme from GTK and produces a wine user.cfg at least it will

    Code:
    #!/usr/bin/env python
    import pygtk
    pygtk.require("2.0")
    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 ))
    	
    style = gtk.Style()
    
    user_reg = """WINE REGISTRY Version 2
    ;; All keys relative to \\User\\S-1-5-4
    
    [Control Panel\\\\Colors]
    """
    
    # REF - http://www.moeraki.com/pygtkreference/pygtk2reference/class-gtkstyle.html
    user_reg += format_color_key('ButtonHilight', style.bg[gtk.STATE_ACTIVE] )
    user_reg += format_color_key('ButtonLight', style.bg[gtk.STATE_NORMAL] )
    user_reg += format_color_key('ButtonShadow', style.dark[gtk.STATE_NORMAL] )
    user_reg += format_color_key('ButtonText', style.text[gtk.STATE_NORMAL] )
    user_reg += format_color_key('ButtonFace', style.bg[gtk.STATE_PRELIGHT])
    
    print user_reg
    It should just be a matter of finding the correct mappings from here.....
    omg this worked like a charm!! thxs

    Quote Originally Posted by mdpalow View Post
    do I copy this into a file and then run it? Can you pls explain this a little more detailed for the novice.

    Thanks in advance...
    to answer mdpalow's question..
    copy and paste the code provided in a new document.. like getcolors.py for example.
    then in a shell simply type: python getcolors.py
    it'll spit out the colors you can copy and paste in your user.reg file as described in the first post. Good luck!
    Running: Ubuntu 10.10 & Windows 7 Pro
    Registered Linux User #373810
    Become a Registered Linux User Here.

  3. #23

    Re: HOWTO: Change colors of wine applications

    A bit more tweaking.... the mappings still arnt correct but its closer

    Code:
    #!/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

  4. #24
    Join Date
    Sep 2007
    Beans
    161
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Change colors of wine applications

    Thanks! But I think its too bright

  5. #25
    Join Date
    Dec 2007
    Beans
    25

    Re: HOWTO: Change colors of wine applications

    Thanks, that looks a lot better.

    My menu text (Ubuntu 7.10) is still grey instead of black, is there any way to fix that?

  6. #26
    Join Date
    Sep 2006
    Beans
    554
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Change colors of wine applications

    Loving Ubuntu every step of the way.

  7. #27
    Join Date
    Jan 2007
    Location
    Florida
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Change colors of wine applications

    Quote Originally Posted by Super Jamie View Post
    many months too late, but this page has good google rating

    here are wine xp settings, which i lifted from http://www.winehq.org/pipermail/wine...st/010161.html
    Sweet! Thanks!
    Lee

    "Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened." - Sir Winston Churchill

  8. #28
    Join Date
    Feb 2008
    Location
    South Africa
    Beans
    19
    Distro
    Ubuntu 8.04 Hardy Heron

    Exclamation Re: HOWTO: Change colors of wine applications

    Quote Originally Posted by ice60 View Post
    I've installed the theme in wine, and it looks great.

    ...however... its way slower and eats a ton of your cpu usuage just by for example selecting another tab.

  9. #29
    Join Date
    Feb 2007
    Location
    New York
    Beans
    894
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Change colors of wine applications

    Quote Originally Posted by KillerKiwi View Post
    A bit more tweaking.... the mappings still arnt correct but its closer
    I decided to take a stab at fulfilling my own request in Bug 111061. While researching, I found that you had already done much of the work for me.

    I fixed some mappings and got it working so that it does everything automatically now; reads the color codes from various places, creates a .reg file, and then imports that into the Wine registry. So you just run the script once after changing themes and it updates. Although some of your choices looked better than nothing, and work pretty well on some themes, they don't work on all, so I've disabled them for now so we can find the real settings. It's a lot harder than I expected to get the correct colors that the system is currently using:
    • 'ActiveBorder' = Active window border
    • 'ActiveTitle' = Left end of active title bar
    • 'GradientActiveTitle' = Right end of active title bar
    • 'GradientInactiveTitle' = Right end of inactive title bar
    • 'InactiveBorder' = Inactive window border
    • 'InactiveTitle' = Left end of inactive title bar
    • 'InactiveTitleText' = Inactive title bar text
    • 'TitleText' = Active title bar text

    Aren't all of these defined by the window manager; not GTK? How do we access those settings? There's a metacity module for python, but I can't find any documentation.

    • 'AppWorkSpace' = Background color of multiple-document interface

    Seems like Gnome has pretty much abandoned MDIs, and I don't know where to read this color from. Seems like a GTK setting, though.

    • 'Background' = Gnome desktop color

    I scraped this from gconf, but there might be a better way.

    • 'HotTrackingColor' = Single-click navigation hover color

    Is there an equivalent of this in Gnome? It's used in Windows Explorer and Internet Explorer as the hover color for single-click navigation.

    • 'InfoText' = ToolTip text
    • 'InfoWindow' = ToolTip background

    I think this is in GTK, but I don't know where to look.

    tooltips1 = gtk.Tooltips() ?

    'gtk.Tooltips' object has no attribute 'style'

    • 'Menu' = Background for menus, also background for menu bars in 3D mode
    • 'MenuBar' = Background for menu bars - rarely seen with 3D menus
    • 'MenuHilight' = Highlight for flat menus - in 3D mode, Hilight is used instead
    • 'MenuText' = Menu text

    The menustyle.bg thing returns values for these, but they don't usually match with the theme. For instance, menustyle.bg[gtk.STATE_SELECTED] gives me a blue in the Human theme, when the selected menu background is actually yellow. I don't get it. (Note that these really only work in Wine when you enable flat menus.)

    • 'Scrollbar' = Background color of scrollbar, but only in some apps.

    I don't think scrollbarstyle.bg[gtk.STATE_NORMAL] matches the real color, either.

    If anyone can help with this, it would be very appreciated.

    Also, it took me a while (and tweaking in actual Windows) to figure out what all the Wine registry values do. Some are obvious, but others are not. I still don't know what ButtonAlternateFace does. (As far as I can tell, "ButtonAlternativeFace" is just a typo of "ButtonAlternateFace".) I wish there were more documentation for this, but I'll post what I've found somewhere so that others don't have to reverse-engineer it again like I did.

    I also want to look into importing font faces, sizes, and widget sizes as well. I'm sure some of these would be a further improvement, while others would just make Wine look stupid.

    Attached is the script as well as a spreadsheet of all the registry values and the mappings I've found. This is my first Python script; be nice.

    Edit: Latest version is on Launchpad: http://bazaar.launchpad.net/~endolit...-scraper/files
    Attached Files Attached Files
    Last edited by Endolith; October 21st, 2008 at 09:46 PM. Reason: latest version is on Launchpad
    "Please remember to do things the Ubuntu way. There is always more than one solution to a problem, choose the one you think will be the easiest for the user. ... Try to think as a green user and choose the simplest solution." — Code of Conduct

  10. #30
    Join Date
    Feb 2007
    Location
    New York
    Beans
    894
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Change colors of wine applications

    The spreadsheet of Wine color names is too big to upload here, but I created a page explaining them all anyway:

    http://www.endolith.com/wordpress/20...3/wine-colors/
    "Please remember to do things the Ubuntu way. There is always more than one solution to a problem, choose the one you think will be the easiest for the user. ... Try to think as a green user and choose the simplest solution." — Code of Conduct

Page 3 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •