# Author: Simon Steinbeiß
# Theme: Greybird
# based on "Bluebird" by Simon Steinbeiß and Pasi Lallinaho
# Description: As is the original theme, this theme is 100% free and open source.

gtk_color_scheme	= "bg_color:#D9D9D9\nselected_bg_color:#8b98a9\nbase_color:#FFFFFF" # Background, base.
gtk_color_scheme	= "fg_color:#3C3C3C\nselected_fg_color:#f5f5f5\ntext_color:#000000" # Foreground, text. 
gtk_color_scheme	= "tooltip_bg_color:#000000\ntooltip_fg_color:#E1E1E1" # Tooltips.
gtk_color_scheme	= "link_color:#08c" # Hyperlinks
gtk_color_scheme	= "panel_bg:#686868" # Panel bg color
gtk_color_scheme	= "fm_color:#F7F7F7" # Color used in Nautilus and Thunar.

gtk-icon-sizes		= "panel-menu=16,16:panel=16,16:gtk-button=16,16"			# Set icon size for button without text
gtk-button-images	= 0					# Disables icons for buttons with text
gtk-toolbar-style	= 0					# Disables text in toolbar
gtk-auto-mnemonics	= 1					# Disables ugly lines under menu items

include "panel.rc"	# This includes the file that handles panel theming.

####################
## Default Styles ##
####################

style "murrine-default"
{
	GnomeHRef		::link_color  				= @link_color		
	GtkHTML			::link-color				= @link_color
 	GtkIMHtmlr		::hyperlink-color 			= @link_color
	GtkIMHtml		::hyperlink-color			= @link_color
	GtkWidget		::link-color				= @link_color
	GtkWidget		::visited-link-color			= @text_color

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

	GtkEntry		::honors-transparent-bg-hint 		= 1
	GtkEntry		::progress-border			= { 3, 3, 3, 3 }
	GtkEntry		::state-hint 				= 0

	GtkImage		::x-ayatana-indicator-dynamic 		= 1

	GtkMenu			::horizontal-padding			= 0
	GtkMenu			::vertical-padding			= 0

	GtkPaned		::handle-size          			= 6

	GtkProgressBar		::min-vertical-bar-width		= 10
	GtkProgressBar		::min-horizontal-bar-height		= 10

	GtkRange		::trough-border				= 2
	GtkRange		::slider-width				= 9
	GtkRange		::stepper-size				= 13
	GtkRange		::stepper_spacing			= 0
 
	GtkScale		::slider-length				= 13
	GtkScale		::slider-width				= 13
	GtkScale		::trough-side-details			= 1

	GtkScrollbar		::min-slider-length			= 30
	GtkScrollbar		::slider-width				= 10
	#GtkScrollbar		::has-backward-stepper 			= 0 
	#GtkScrollbar		::has_secondary_backward_stepper	= 1 
	#GtkScrollbar		::has-forward-stepper			= 0 
	#GtkScrollbar		::has_secondary_forward_stepper		= 0 

	GtkScrolledWindow	::scrollbar-spacing			= 0
	GtkScrolledWindow	::scrollbars-within-bevel		= 1

	GtkMenuBar		::internal-padding			= 0
	GtkMenuBar		::window-dragging			= 1

	GtkExpander		::expander-size				= 12
	GtkToolbar		::internal-padding			= 0
	GtkTreeView		::expander-size				= 10
	GtkTreeView		::vertical-separator			= 0

	GtkWidget		::new-tooltip-style			= 1
	GtkWidget		::focus-line-width			= 1
	GtkWidget		::focus-padding				= 0

	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 (1.04, @bg_color)

	base[NORMAL]      = @base_color
	base[PRELIGHT]    = shade (0.95, @bg_color)
	base[ACTIVE]      = shade (0.92, @selected_bg_color)
	base[SELECTED]    = shade (0.93, @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 "murrine" 
	{
		animation           = TRUE
		arrowstyle          = 2                 # 0 = normal arrows, 1 = filled arrows		
		border_shades       = { 1.2, 1.0 }      # gradient to draw on border
		cellstyle	    = 0
		colorize_scrollbar  = FALSE		
		comboboxstyle       = 0                 # 0 = normal combobox, 1 = colorized combobox below arrow		
		contrast            = 0.4               # 0.8 for less contrast, more than 1.0 for more contrast on borders
		expanderstyle	    = 0
		focus_color         = mix (0.1, @bg_color, shade (1.1, @selected_bg_color))
		focusstyle	    = 3
		glazestyle          = 1                 # 0 = flat highlight, 1 = curved highlight, 2 = concave style, 3 = top curved highlight, 4 = beryl highlight
		gradient_shades     = {1.2,1.0,1.0,0.9} #{1.1,1.0,1.0,0.87}
		glowstyle           = 4                 # 0,1,2,3,4
		glow_shade          = 1.1
		highlight_shade     = 1.0               # set highlight amount for buttons or widgets
		lightborder_shade   = 1.1               # sets lightborder amount for buttons or widgets
		lightborderstyle    = 0                 # 0 = lightborder on top side, 1 = lightborder on all sides
		listviewheaderstyle = 1                 # 0 = flat, 1 = glassy, 2 = raised
		listviewstyle       = 1                 # 0 = nothing, 1 = dotted
		menubaritemstyle    = 0                 # 0 = menuitem look, 1 = button look
		menubarstyle        = 2                 # 0 = flat, 1 = glassy, 2 = gradient, 3 = striped
		menuitemstyle       = 0                 # 0 = flat, 1 = glassy, 2 = striped
		menustyle           = 0                 # 0 = no vertical menu stripe, 1 = display vertical menu stripe
		prelight_shade      = .95               # shade level for scrollbar's slider, comboboxstyle(1), and prelight state with gradient_colors		
		reliefstyle         = 3                 # 0 = flat, 1 = inset, 2 = shadow
		rgba                = FALSE             # FALSE = disabled, TRUE = enabled
		roundness           = 3                 # 0 = squared, 1 = old default, more will increase roundness
		scrollbarstyle      = 0                 # 0 = nothing, 1 = circles, 2 = handles, 3 = diagonal stripes, 4 = diagonal stripes and handles, 5 = horizontal stripes, 6 = horizontal stripes and handles
		separatorstyle      = 1                 # 0 = Hard seperators 1 = Smooth seperators
		sliderstyle         = 0                 # 0 = nothing added, 1 = handles
		spinbuttonstyle	    = 1
		stepperstyle        = 1                 # 0 = standard, 1 = integrated stepper handles, 2 = unknown
		progressbarstyle    = 1                 # 0 = nothing, 1 = stripes, 2 = lines
		focus_color         = @selected_bg_color
		shadow_shades       = { 0.8, 2.2 }      # gradient for shadows.		
		textstyle           = 0                 # 0 = normal text, 1 = inset		
		toolbarstyle        = 2                 # 0 = flat, 1 = glassy, 2 = gradient		
		trough_shades	    = { 0.75, 0.9 }	# draw gradient on trough of GtkScrollbar and GtkProgressbar
		trough_border_shades = { 0.9, 0.7 }	}
}


### THEME MODULES ###

style "evolution-hack" = "murrine-default" # Hacks for Evolution Mail.
{	
	bg[NORMAL]     = shade (1.14, @bg_color) # Color for evo treeview headers.
	bg[PRELIGHT]   = shade (1.18, @bg_color) # Color for evo treeview header prelight.
	bg[ACTIVE]     = shade (0.75, @bg_color) # Color for unfocused evo selected items.
	bg[SELECTED]   = @selected_bg_color      # Color for evo selected items.
	fg[ACTIVE]     = @selected_fg_color      # Color for evo active text.
	fg[SELECTED]   = @selected_fg_color      # Color for evo selected text.
}

style "murrine-dark" {
	bg[NORMAL]	= "#646e7b"
#	bg[ACTIVE]	= "#091720"
#	bg[PRELIGHT]	= "#424b58"
	bg[SELECTED]	= "#75808f"
	
	fg[NORMAL]	= @selected_fg_color
	fg[PRELIGHT]	= "#ffffff"
	fg[ACTIVE]	= @selected_fg_color
	
	text[NORMAL]   = @selected_fg_color
	text[PRELIGHT] = "#ffffff"
	text[ACTIVE]   = @selected_fg_color
}

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

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

style "murrine-entry" = "murrine-wider" {

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

	engine "murrine" {
		contrast      = 0.4
		reliefstyle   = 4
		border_shades = {1.03,0.8}
		shadow_shades = {0.5,0.0}
	}
}

style "murrine-button" = "murrine-wider"
{	
	bg[NORMAL]        = shade (1.06, @bg_color) 
	bg[PRELIGHT]      = shade (1.45, @selected_bg_color)  
	bg[ACTIVE]        = shade (0.85, @bg_color)
	bg[SELECTED]      = shade (1.0, @selected_bg_color)  
	bg[INSENSITIVE]   = shade (0.95, @bg_color)

  	engine "murrine" 
	{
		contrast            = .8
		highlight_shade     = 1.00
		lightborder_shade   = 1.7
		gradient_shades     = {1.1,1.05,0.95,0.95} #{1.3,1.10,0.95,0.92} 
		border_shades       = { 1.1, 0.9 }
		shadow_shades       = {0.5,0.0}
		reliefstyle         = 3
		roundness	    = 2
	}
}

style "murrine-notebook-bg"
{
	bg[NORMAL]	= shade (1.1, @bg_color) # Tab background.
	bg[ACTIVE]	= shade (0.9, @bg_color) # Unfocused tab background.
}

style "murrine-notebook" = "murrine-notebook-bg"
{
	xthickness = 1 # Width of tabs and notebook borders.
	ythickness = 1 # Height of tabs and notebook borders.

	engine "murrine" 
	{
		roundness       = 3 # Roundness of notebook tabs.
		contrast        = 1.0
		highlight_shade = 1.05
		gradient_shades = {1.28,1.17,0.92,0.87} 
	}
}

style "murrine-menu"
{
	ythickness        = 2
	xthickness        = 0
	GtkMenuBar	:: shadow-type		= GTK_SHADOW_NONE
	
	bg[SELECTED]      = shade (0.85, @selected_bg_color)
	bg[NORMAL]        = @bg_color
	bg[PRELIGHT]      = shade (0.85, @selected_bg_color)
	bg[ACTIVE]        = @bg_color
	bg[INSENSITIVE]   = @bg_color
	fg[NORMAL]        = @text_color # Color for normal text.
	fg[PRELIGHT]      = @selected_fg_color
	fg[SELECTED]      = @selected_fg_color
	fg[ACTIVE]        = @selected_fg_color
	fg[INSENSITIVE]   = shade (0.75, @bg_color) # Text color for non-interactive menu items
	text[NORMAL]      = @text_color # Color for menu-item radio/checks.
	base[NORMAL]      = @bg_color # Color for menu-item radio/checks background.
	text[PRELIGHT]    = @selected_fg_color
	text[SELECTED]    = @selected_fg_color
	text[ACTIVE]      = @selected_fg_color
	text[INSENSITIVE] = @text_color
	
	engine "murrine" 
	{
		roundness = 0 # Roundness of menu items.
	}
}

style "menubar-menuitem" 
{
	bg[PRELIGHT]   = @selected_bg_color
	bg[SELECTED]   = @selected_bg_color
	fg[NORMAL]     = @selected_fg_color
	fg[PRELIGHT]   = @selected_fg_color
	fg[SELECTED]   = @selected_fg_color
	text[NORMAL]   = @base_color
	text[PRELIGHT] = @selected_fg_color
	text[SELECTED] = @selected_fg_color
}

style "menubar-menuitem-prelight"
{
	fg[PRELIGHT] = @selected_fg_color
}

style "murrine-treeview"
{
  	engine "murrine" 
	{
		roundness = 0  # This makes treeview progressbars square.
	}
}

style "murrine-treeview-header" = "murrine-button"
{
	xthickness   = 2
	ythickness   = 1
	
	bg[NORMAL]	 = shade (1.14, @bg_color)  # Color for treeview headers.
	bg[PRELIGHT] = shade (0.98, @bg_color)  # Color for treeview header prelight.
	bg[ACTIVE]   = shade (0.85, @bg_color)  # Color for pressed-treeview.
  	
	engine "murrine" 
	{
		roundness = 0  # This makes treeview progressbars square.
	}
}

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

style "murrine-tooltips" = "murrine-wider"
{
	xthickness = 7
	ythickness = 4

	bg[NORMAL] = @tooltip_bg_color
	bg[SELECTED] = "#000000"
	fg[NORMAL] = @tooltip_fg_color

	engine "murrine"
	{
		roundness	= 0
		trough_shades	= { 0.15, 0.3 }
	}
}

style "murrine-progressbar"
{
	xthickness   = 0
	ythickness   = 0

	fg[PRELIGHT] = lighter (@selected_fg_color)
	bg[NORMAL]   = shade (1.05, @bg_color)
	bg[SELECTED] = shade (1.05, @selected_bg_color)

	engine "murrine" {
		gradient_shades = {1.2,0.85,1.1,0.75}
		roundness 	= 4
		contrast	= 0.5
		border_shades	= { 1.0, 0.8 }
		glowstyle	= 3
		glow_shade	= 1.2
	}
}
	
style "murrine-scrollbar"
{
	bg[PRELIGHT]	= @panel_bg
	bg[NORMAL]	= shade (1.4, @panel_bg)
	
	engine "murrine" {
		arrowstyle		= 1
		roundness		= 6
		gradient_shades		= {1.0,1.0,1.0,1.0}
		highlight_shade		= 1.0
		glow_shade		= 1.0
		reliefstyle		= 0
		gradient_colors		= FALSE
    		lightborder_shade       = 1.0
		lightborderstyle	= 0
		#trough_shades	        = { 0.97, 0.97}
		#trough_border_shades	= { 2.0, 2.0 }
		#border_shades		= { 0.85, 0.85}		# slider border outline
		#shadow_shades		= { 0.5, 0.8 }
		trough_shades		= { 5.0, 2.20}
		border_shades		= { 2.0, 2.0 }
		contrast		= 0.0			# no trough-border
		prelight_shade		= 0.65
	}
}

style "murrine-statusbar"
{
	xthickness = 2
}

style "murrine-comboboxentry"
{
	engine "murrine"
	{
		contrast      = 0.4
		reliefstyle   = 4
		border_shades = {1.03,0.8}
		shadow_shades = {0.5,0.0}
	}
}

style "murrine-spinbutton"
{
	bg[ACTIVE] = shade (0.85, @bg_color) # Color for pressed-spinbuttons.
}

style "murrine-scale" = "murrine-button"
{
	GtkWidget	::focus-line-width	= 0
	GtkWidget	::focus-padding		= 2
	bg[ACTIVE]				= @selected_fg_color
	bg[NORMAL]				= @panel_bg
	bg[PRELIGHT]				= shade (0.5, @panel_bg)
	bg[INSENSITIVE]				= @panel_bg
	bg[SELECTED]				= @panel_bg
	
	engine "murrine"
	{
		roundness 		= 5
		border_shades		= { 1.0, 1.0 }
		contrast		= 0.1
		trough_shades	    = { 0.8, 0.8 }	# draw gradient on trough of GtkScrollbar and GtkProgressbar
		trough_border_shades = { 0.9, 0.9 }
	}
}

style "murrine-hscale" = "murrine-scale"
{
}

style "murrine-vscale" = "murrine-scale"
{
}

style "murrine-nautilus-location" # Workaround for nautilus' messages.
{
	bg[NORMAL] = shade (1.25, @selected_bg_color)
}

style "murrine-radiocheck" = "murrine-default"
{
	text[NORMAL]    = @selected_fg_color # Color for checks/radio items.
	text[PRELIGHT]  = @selected_fg_color # Color for checks/radio items.
}

style "murrine-toolbar" = "murrine-default"
{
	bg[NORMAL] = @bg_color
	engine "murrine" {
		contrast			= 1.13
		toolbarstyle			= 1
		lightborder_shade		= 1.0
		gradient_shades     		= {1.0,0.94,0.94,0.88}
	}
}

###############################################################################
# The following part of the gtkrc applies the different styles to the widgets.
###############################################################################

# Murrine default style is applied to every widget.
class "GtkWidget"    style "murrine-default"

# Increase the x/ythickness in some widgets.
class "GtkFrame"     style "murrine-wide"
class "GtkEntry"     style "murrine-entry"
class "GtkSeparator" style "murrine-wide"
class "GtkCalendar"  style "murrine-wide"
class "GtkToolbar"   style "murrine-toolbar" 

class "GtkSpinButton"  style "murrine-spinbutton"
class "GtkScale"       style "murrine-scale"
class "GtkVScale"      style "murrine-vscale"
class "GtkHScale"      style "murrine-hscale"

class "GtkScrollbar"   style "murrine-scrollbar"
class "GtkVScrollbar"  style "murrine-scrollbar"
class "GtkHScrollbar"  style "murrine-scrollbar"

class "GtkRadio*"	style "murrine-radiocheck"
class "GtkCheck*"	style "murrine-radiocheck"

# 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.

# This is not perfect, it could be done better (That is modify *every* widget in the notebook, and change those back that we really don't want changed)
widget_class "*<GtkNotebook>*<GtkEventBox>"     style "murrine-notebook-bg"
widget_class "*<GtkNotebook>*<GtkDrawingArea>"  style "murrine-notebook-bg"
widget_class "*<GtkNotebook>*<GtkLayout>"       style "murrine-notebook-bg"
widget_class "*<GtkNotebook>*<GtkViewport>"	style "murrine-notebook-bg"

widget_class "*<GtkButton>"      style "murrine-button"
widget_class "*<GtkNotebook>"    style "murrine-notebook"
widget_class "*<GtkStatusbar>*"  style "murrine-statusbar"

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

widget_class "*<GtkMenuBar>.<GtkMenuItem>*" style "menubar-menuitem"
widget_class "*<GtkMenuItem>*" style "menubar-menuitem-prelight"
widget_class "*<GtkMenu>*"              style "murrine-menu"
widget_class "*<GtkMenuBar>*"		style "murrine-menu"

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

widget_class "*<GtkProgress>"	       style "murrine-progressbar"
widget_class "*<GtkProgressBar>"       style "murrine-progressbar"

# Treeview header
widget_class "*.<GtkTreeView>.<GtkButton>" style "murrine-treeview-header"
widget_class "*.<GtkCTree>.<GtkButton>"    style "murrine-treeview-header"
widget_class "*.<GtkList>.<GtkButton>"     style "murrine-treeview-header"
widget_class "*.<GtkCList>.<GtkButton>"    style "murrine-treeview-header"
widget_class "*.<GtkCMCTree>.<GtkButton>"    style "murrine-treeview-header" # Claws-Mail treeview-headers
widget_class "*.<GtkCMCList>.<GtkButton>"    style "murrine-treeview-header" # Claws-Mail treeview-headers

# Workarounds for Evolution
widget_class "*.ETable.ECanvas"    style "murrine-treeview-header"
widget_class "*.ETree.ECanvas"    style "murrine-treeview-header"
widget_class "*GtkCTree*"	style "evolution-hack"
widget_class "*GtkList*"	style "evolution-hack"
widget_class "*GtkCList*"	style "evolution-hack"
widget_class "*.ETree.*"	style "evolution-hack"
widget_class "*EInfoLabel*"	style "evolution-hack"

# The window of the tooltip is called "gtk-tooltip"
################################
# FIXME:
# This will not work if one embeds eg. a button into the tooltip.
# As far as I can tell right now we will need to rework the theme
# quite a bit to get this working correctly.
# (It will involve setting different priorities, etc.)
################################
widget "gtk-tooltip*" style "murrine-tooltips"

###################################################
# SPECIAL CASES AND WORKAROUNDS
###################################################

# 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 "murrine-nautilus-location"

# Work around for http://bugzilla.gnome.org/show_bug.cgi?id=382646
# Note that the work around assumes that the combobox is _not_ in appears-as-list mode.
# This style does not affect GtkComboBoxEntry, it does have an effect on comboboxes in appears-as-list mode though.
style "murrine-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 "murrine-text-is-fg-color-workaround"

style "murrine-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 "murrine-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 "murrine-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 "murrine-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 "murrine-fg-is-text-color-workaround"
widget_class "*<EelEditableLabel>" style "murrine-fg-is-text-color-workaround"

widget "xfwm4-tabwin*" style "murrine-dark"


# Google Chrome/Chromium theming (requires 9.0.597 or newer)
style "chrome-gtk-frame"
{
    ChromeGtkFrame::frame-color = shade (0.5, @bg_color)
    ChromeGtkFrame::inactive-frame-color = shade (0.5, @bg_color)

    ChromeGtkFrame::frame-gradient-size = 100
    ChromeGtkFrame::frame-gradient-color = shade (1.08,@bg_color)
    ChromeGtkFrame::inactive-frame-gradient-color = shade (1.08,@bg_color)

    ChromeGtkFrame::scrollbar-trough-color = @base_color
    ChromeGtkFrame::scrollbar-slider-prelight-color = @panel_bg
    ChromeGtkFrame::scrollbar-slider-normal-color = shade (1.4, @panel_bg)
}

class "ChromeGtkFrame" style "chrome-gtk-frame"
