#    Trisquel GTK2 theme, Version 3.0
#    This theme requires the GTK engines "Clearlooks" and "pixmap"
#
#    Copyright (C) 2008 Rico Sta. Cruz and Ricardo (Kido) Mariano III
#    Copyright (C) 2009 Rubén Rodríguez <ruben@trisquel.info>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
#
#    This theme uses some code from the Dust theme by Rico Sta. Cruz and Ricardo (Kido) Mariano III

gtk_color_scheme = "fg_color:#323232\nbg_color:#e7e7e7\ntext_color:#000\nbase_color:#ffffff\nselected_fg_color:#000000\nselected_bg_color:#81B0DB\ntooltip_fg_color:#000\ntooltip_bg_color:#FFF9C1"

gtk-icon-sizes = "panel-menu=24,24:panel=24,24:gtk-button=15,15:gtk-large-toolbar=24,24"

include "panel.rc"

style "default"
{
	########
	# Style Properties
	########
	GtkScrolledWindow ::scrollbar-spacing = 4
	GtkScrolledWindow ::scrollbar-within-bevel = 4
    
	GtkArrow        ::arrow-scaling       = 0.5

	GtkButton      ::child-displacement-x = 1
	GtkButton      ::child-displacement-y = 1
	GtkButton      ::default-border       = { 0, 0, 0, 0 }
	GtkButton      ::focus-padding        = 0
	GtkCheckButton ::indicator-size       = 12

	GtkPaned       ::handle-size          = 6

	GtkRange       ::trough-border        = 0
	GtkRange       ::slider-width         = 15
	GtkRange       ::stepper-size         = 15

	GtkScale       ::slider-length        = 20
	GtkScale       ::trough-side-details  = 0	# 0 = thin slider, >0 = thick slider
	GtkScrollbar   ::min-slider-length    = 50

	GtkMenuBar     ::internal-padding     = 1
	GtkExpander    ::expander-size        = 11
	GtkToolbar     ::internal-padding     = 1
	GtkTreeView    ::expander-size        = 11
	GtkTreeView    ::vertical-separator   = 0
	
	GtkMenu        ::horizontal-padding   = 0
	GtkMenu        ::vertical-padding     = 0
	WnckTasklist   ::fade-overlay-rect    = 0
	GtkEntry::honors-transparent-bg-hint = 1
    
	xthickness = 1
	ythickness = 1

	fg[NORMAL]        = @fg_color
	fg[PRELIGHT]      = @fg_color
	fg[SELECTED]      = @selected_fg_color
	fg[ACTIVE]        = @fg_color
	fg[INSENSITIVE]   = darker (@bg_color)

	bg[NORMAL]        = @bg_color
	bg[PRELIGHT]      = shade (1.02, @bg_color)
	bg[SELECTED]	  = @selected_bg_color
	bg[INSENSITIVE]   = @bg_color
	bg[ACTIVE]        = shade (0.9, @bg_color)

	base[NORMAL]      = @base_color
	base[PRELIGHT]    = shade (0.95, @bg_color)
	base[ACTIVE]      = mix (0.7, @selected_bg_color, @bg_color)
	base[SELECTED]    = @selected_bg_color
	base[INSENSITIVE] = @bg_color

	text[NORMAL]      = @text_color
	text[PRELIGHT]    = @text_color
	text[ACTIVE]      = @selected_fg_color
	text[SELECTED]    = @selected_fg_color
	text[INSENSITIVE] = darker (@bg_color)

	engine "clearlooks" 
	{
		colorize_scrollbar = TRUE
		reliefstyle        = 1
		menubarstyle       = 2      # 0 = flat, 1 = sunken, 2 = flat gradient
		toolbarstyle       = 1      # 0 = flat, 1 = enable effects
		animation          = FALSE
		style              = GUMMY
		contrast = 1.0
		radius = 0.0
	}
}

style "entry" {
        xthickness = 3
        ythickness = 3

        bg[SELECTED] = mix (0.4, @selected_bg_color, @base_color)
        fg[SELECTED] = @text_color

        engine "clearlooks" {
                focus_color = shade (0.65, @selected_bg_color)
		radius = 2.0
        }
}


style "wide"
{
	xthickness = 2
	ythickness = 2
}

style "wider"
{
	xthickness = 3
	ythickness = 3
}

style "button" = "default"
{
	xthickness   = 3
	ythickness   = 3

	bg[NORMAL]   = "#DADADA" #shade (1.2, @bg_color)
	bg[PRELIGHT] = shade (0.9, @bg_color) #mix(0.82,shade (1.3, @bg_color),@selected_bg_color)
	bg[ACTIVE]   = shade (0.85, @bg_color)
	
	engine "clearlooks"
        {
                radius = 3.0
        }
	
}

style "toolbar" = "default"
{
    xthickness = 3
    ythickness = 2
    
	bg[NORMAL]       = "#DBDBDB" #shade(0.88,@bg_color)
	bg[PRELIGHT]     = "#DBDBDB" #shade(0.88,@bg_color)
	bg[ACTIVE]       = "#DBDBDB" #shade(0.88,@bg_color)
	bg[SELECTED]     = "#DBDBDB" #shade(0.88,@bg_color)
	bg[INSENSITIVE]  = "#DBDBDB" #shade(0.88,@bg_color)
	
	engine "pixmap"
	{

		image {
	  		function = BOX
	  		file = "toolbar.png"
                        border  = { 0, 0, 0, 1}
                        stretch = TRUE
	  	}
	  	image {
		      function				= HANDLE
		      overlay_file			= "handlebox.png"
		      overlay_stretch 	= FALSE
		      orientation			= HORIZONTAL
		}
        	image {
		      function				= HANDLE
		      overlay_file			= "handlebox.png"
		      overlay_stretch 	= FALSE
		      orientation			= VERTICAL
		}
		image
		{
		       function        = VLINE
		       recolorable     = TRUE
		       file            = "blank.png"
		}
		image
		{
		      function            = HLINE
		      recolorable        = TRUE
		      file                = "blank.png"
		}
    }
}


style "toolbar-item" = "toolbar"
{

	bg[NORMAL]   = "#DBDBDB" #shade(0.88,@bg_color)
	bg[PRELIGHT] = "#EFEFEF" #shade(1.1,@bg_color)
	bg[ACTIVE]   = "#CFCFCF" #shade(0.6,@bg_color)
	
	fg[INSENSITIVE] = shade(0.6,@bg_color)
	
	fg[ACTIVE] = @fg_color
	text[ACTIVE] = @fg_color
	
}
style "toolbar-sep" = "toolbar-item"
{
    bg[NORMAL] = shade(0.5, @bg_color)
}

style "notebook-bg" = "wider"
{
	bg[NORMAL] = shade (1.05, @bg_color)
	bg[SELECTED]   = shade (1.05, @bg_color)
	bg[ACTIVE] = shade(0.90,@bg_color)
}

style "notebook" = "notebook-bg"
{
        xthickness = 2
        ythickness = 2

	GtkWidget::focus-line-width = 0
	engine "clearlooks"{
		radius = 0.0
		style = GLOSSY
	}
}


style "menu" 
{
	bg[NORMAL] = shade (1.2, @bg_color)
	xthickness = 0
	ythickness = 0

}

style "menu-item"
{
	fg[PRELIGHT] = @selected_fg_color
	bg[SELECTED] = shade (1.0, @selected_bg_color)
	xthickness = 2
	ythickness = 4
	engine "clearlooks"{
	style = GLOSSY
	contrast = 1.0
	}
}

style "separator-menu-item"
{
	GtkSeparatorMenuItem::horizontal-padding = 1
	GtkWidget::wide-separators = 1
	GtkWidget::separator-width = 1
	GtkWidget::separator-height = 7
	xthickness = 0
	ythickness = 0
	
}


# Based on the default style so that the colors from the button
# style are overriden again.
style "treeview-header" = "default"
{
	xthickness = 0
	ythickness = 4

    
    
	engine "pixmap" {
    image
      {
        function                        = BOX
        file                            = "treeview.png"
        border                  = { 2, 2, 2, 2 }
        stretch                         = TRUE
      }


	}
}

style "tooltips"
{
	xthickness = 4
	ythickness = 4

	bg[NORMAL] = @tooltip_bg_color
	fg[NORMAL] = @tooltip_fg_color
}

style "progressbar"
{
	xthickness = 1
	ythickness = 1

	fg[PRELIGHT] = @selected_fg_color

	engine "clearlooks"
	{
		contrast = 1.1
	}
}


style "comboboxentry" 
{
}

style "spinbutton"
{
}

style "scale"
{
	bg[PRELIGHT] = shade(0.9,@bg_color)
	GtkWidget::focus-line-width = 0
	engine "clearlooks"{
		contrast = 1.0
		style = GLOSSY
	}
}

style "menubar" = "default"
{
	fg[NORMAL] = "#000"
	fg[PRELIGHT] = "#444"
	xthickness                      = 1
	ythickness                      = 2

	engine "pixmap"
	{
		image {
	  		function = BOX
	  		file = "menubar.png"
	  		border = {0,0,0,0}
	  		stretch = TRUE
	  	}
		
	  	image {
		      function				= HANDLE
		      overlay_file			= "handlebox.png"
		      overlay_stretch 	= FALSE
		      orientation			= HORIZONTAL
		}
        image {
		      function				= HANDLE
		      overlay_file			= "handlebox.png"
		      overlay_stretch 	= FALSE
		      orientation			= VERTICAL
		}
    }
}

style "frame"
{
	#Uncomment for dark statusbars. Breaks some apps. (FIXME: Doesn't work)
	#bg[ACTIVE] = shade(0.2,@bg_color)
	#fg[NORMAL] = mix (1.5, @fg_color, '#ffffff')
	#fg[PRELIGHT] = mix (1.4, @fg_color, '#ffffff')
	engine "clearlooks"{
		contrast = 0.77
	}
}

style "frame-title" = "frame"
{
	fg[NORMAL] = lighter (@fg_color)
}

style "nautilus-location"
{
	bg[NORMAL] = mix(0.60, @bg_color, @selected_bg_color)
}

#########################################
# Matches
#########################################

# clearlooks default style is applied to every widget
class "GtkWidget"    style "default"

# Increase the x/ythickness in some widgets
class "GtkRange"     style "default"
class "GtkFrame"     style "frame"
class "GtkSeparator" style "wide"
class "GtkEntry"     style "entry"
class "GtkMenuBar*"   style "menubar"
widget_class "*MenuBar.*" style "menubar"

# Toolbar default: light
class "*HandleBox" style "toolbar"
class "GtkToolbar"   style "toolbar" 
widget_class "*HandleBox" style "toolbar"
widget_class "*<GtkToolbar>.*"   style "toolbar-item"
widget_class "*BonoboDockItem" style "toolbar"
class "*BonoboDockItem" style "toolbar"
widget_class "*Toolbar" style "toolbar"
class "*Toolbar" style "toolbar"


#
# Toolbar exceptions:
# Browser-type and viewer-type applications get a dark toolbar.
# Everything below the toolbar for these apps are the content. This will make
# a separation on function (toolbar) and content (client area).
#

# Work around for http://bugzilla.gnome.org/show_bug.cgi?id=382646
style "text-is-fg-color-workaround"
{
	text[NORMAL]      = @fg_color
	text[PRELIGHT]    = @fg_color
	text[SELECTED]    = @selected_fg_color
	text[ACTIVE]      = @fg_color
	text[INSENSITIVE] = darker (@bg_color)
}
widget_class "*.<GtkComboBox>.<GtkCellView>"   style "text-is-fg-color-workaround"

style "text-is-fg-color-workaround-dark"
{
	#Make it work with this theme!
	text[NORMAL] = @fg_color
	text[PRELIGHT] = @selected_fg_color
}

class "GtkSpinButton"  style "spinbutton"
class "GtkScale"       style "scale"
class "GtkVScale"      style "scale"
class "GtkHScale"      style "scale"
class "GtkButton"      style "button"


# General matching following, the order is choosen so that the right styles override each other
# eg. progressbar needs to be more important then the menu match.

widget_class "*<GtkNotebook>*<GtkEventBox>"     style "notebook-bg"
widget_class "*<GtkNotebook>*<GtkDrawingArea>"  style "notebook-bg"
widget_class "*<GtkNotebook>*<GtkLayout>"       style "notebook-bg"
widget_class "*<GtkNotebook>"    style "notebook"

widget_class "*<GtkComboBoxEntry>*" style "comboboxentry"
widget_class "*<GtkCombo>*"         style "comboboxentry"

widget_class "*<GtkMenu>*"              style "menu"
widget_class "*<GtkMenuItem>*"          style "menu-item"
widget_class "*<GtkSeparatorMenuItem>*" style "separator-menu-item"

widget_class "*<GtkFrame>"  style "frame"
widget_class "*.<GtkFrame>.<GtkLabel>" style "frame-title"

widget_class "*<GtkStatusbar>*"  style "wider"
widget_class "*<GtkProgressBar>"       style "progressbar"

# Treeview header
widget_class "*.<GtkTreeView>.<GtkButton>" style "treeview-header"
widget_class "*.<GtkCTree>.<GtkButton>"    style "treeview-header"
widget_class "*.<GtkList>.<GtkButton>"     style "treeview-header"
widget_class "*.<GtkCList>.<GtkButton>"    style "treeview-header"

# The window of the tooltip is called "gtk-tooltip"
widget "gtk-tooltip*" style "tooltips"

###################################################
# Special cases and work arounds
###################################################

# Workarounds for Evolution
widget_class "*.ETable.ECanvas"    style "treeview-header"
widget_class "*.ETree.ECanvas"    style "treeview-header"

# Firefox isn't nice to dark themes, so unset the dark stuff.
widget "MozillaGtkWidget*Toolbar*"	style "toolbar-item"
#widget "MozillaGtkWidget*Frame*"	style "default"

# Monodevelop uses an OptionPanel widget, which incidentally is dark in our theme.
# Undo it:
widget "*OptionPanel*"		style "button"
widget "*optionPanel*"		style "button"

# Special case the nautilus-extra-view-widget
# ToDo: A more generic approach for all applications that have a widget like this.
widget "*.nautilus-extra-view-widget" style : highest "nautilus-location"

style "menuitem-text-is-fg-color-workaround" 
{
	text[NORMAL]        = @fg_color
	text[PRELIGHT]      = @selected_fg_color
	text[SELECTED]      = @selected_fg_color
	text[ACTIVE]        = @fg_color
	text[INSENSITIVE]   = darker (@bg_color)
}
widget "*.gtk-combobox-popup-menu.*"   style "menuitem-text-is-fg-color-workaround"

# Work around the usage of GtkLabel inside GtkListItems to display text.
# This breaks because the label is shown on a background that is based on the
# base color set.
style "fg-is-text-color-workaround"
{
	fg[NORMAL]      = @text_color
	fg[PRELIGHT]    = @text_color
	fg[ACTIVE]      = @selected_fg_color
	fg[SELECTED]    = @selected_fg_color
	fg[INSENSITIVE] = darker (@bg_color)
}
widget_class "*<GtkListItem>*" style "fg-is-text-color-workaround"
# The same problem also exists for GtkCList and GtkCTree
# Only match GtkCList and not the parent widgets, because that would also change the headers.
widget_class "*<GtkCList>" style "fg-is-text-color-workaround"


#Rhythmbox toolbar near the search entry. Use default + wide so that it doesn't turn dark.
style "rhythmbox-header" = "default"
{
	xthickness = 3
	ythickness = 3
	engine "clearlooks" {
	}
}
widget "*RBSourceHeader*"	style:highest "rhythmbox-header"
widget "*HeaderToolbar*"	style:highest "rhythmbox-header"
widget "*FooterToolbar*"	style:highest "rhythmbox-header"

widget "*swt*toolbar*"	style "default"

style "dialog" = "dark"
{
    bg[NORMAL] = mix(0.4, @selected_bg_color, shade(0.7, @bg_color))
    fg[NORMAL] = shade(0.5, @fg_color)
    text[NORMAL] = shade(0.5, @text_color)
}
style "dialog-button" = "dark"
{
    bg[NORMAL] = shade(0.15, @bg_color)
    bg[PRELIGHT] = shade(0.18, @bg_color)
}




style "pixmap-statusbar" = "default"
{
	ythickness = 3
	xthickness = 3

    engine "pixmap"
    {
        image
        {
            function = RESIZE_GRIP
            recolorable = TRUE
            detail = "statusbar"
            overlay_file = "grip.png"
            overlay_border = {0,0,0,0}
        }
    }
}


class "GtkStatusbar" style "pixmap-statusbar"
