<?xml version="1.0"?>
<metacity_theme>

<info>
	<name>Kogaion-nighttime</name>
	<author>bionel</author>
	<copyright>Rogentos</copyright>
	<date>July 2015</date>
	<description>Kogaion Linux nighttime theme</description>
</info>

<!-- TODO -->
<!-- Nothing to see here! -->

<!-- FRAMES GEOMETRY-->

<frame_geometry name="normal" rounded_top_left="false" rounded_top_right="false">
	<distance name="left_width" value="2"/>
	<distance name="right_width" value="2"/>
	<distance name="bottom_height" value="2"/>
	<distance name="left_titlebar_edge" value="2"/>
	<distance name="right_titlebar_edge" value="2"/>
	<aspect_ratio name="button" value="1"/>
	<distance name="title_vertical_pad" value="6"/>
	<border name="title_border" left="4" right="4" top="3" bottom="3"/>
	<border name="button_border" left="4" right="4" top="0" bottom="0"/>
</frame_geometry>

<frame_geometry name="normal_small_borders" parent="normal" rounded_top_left="false" rounded_top_right="false">
	<distance name="left_titlebar_edge" value="1" />
	<distance name="right_titlebar_edge" value="1" />
	<distance name="left_width" value="0" />
	<distance name="right_width" value="0" />
	<distance name="bottom_height" value="0" />
</frame_geometry>

<frame_geometry name="utility" parent="normal">
</frame_geometry>

<frame_geometry name="border" has_title="false" rounded_top_left="false" rounded_top_right="false">
	<distance name="left_width" value="4"/>
	<distance name="right_width" value="4"/>
	<distance name="bottom_height" value="4"/>
	<distance name="left_titlebar_edge" value="0"/>
	<distance name="right_titlebar_edge" value="0"/>
	<distance name="button_width" value="0"/>
	<distance name="button_height" value="0"/>
	<distance name="title_vertical_pad" value="6"/>
	<border name="title_border" left="0" right="0" top="0" bottom="0"/>
	<border name="button_border" left="0" right="0" top="0" bottom="0"/>
</frame_geometry>

<!-- ACTUALLY DRAWING FRAMES -->

<draw_ops name="title_background">   
   <rectangle color="gtk:bg[SELECTED]" x="0" y="0" width="width" height="height" filled="true"/>
   <rectangle color="gtk:light[SELECTED]" x="0" y="0" width="width-1" height="height"/>
</draw_ops>

<draw_ops name="title_background_maximized">
    <rectangle color="gtk:bg[SELECTED]" x="0" y="0" width="width" height="height" filled="true"/>  
    <line color="gtk:light[SELECTED]" x1="0" y1="0" x2="width" y2="0"/>   
</draw_ops>

<draw_ops name="title_unfocused_background">
    <rectangle color="gtk:bg[INSENSITIVE]" x="0" y="0" width="width" height="height" filled="true"/>
    <rectangle color="gtk:light[INSENSITIVE]" x="0" y="0" width="width-1" height="height" />
</draw_ops>

<draw_ops name="title_unfocused_background_maximized">
    <rectangle color="gtk:bg[INSENSITIVE]" x="0" y="0" width="width" height="height" filled="true"/>  
    <line color="gtk:light[INSENSITIVE]" x1="0" y1="0" x2="width" y2="0"/> 
</draw_ops>

<draw_ops name="blank">
	<!-- nothing -->
</draw_ops>

<draw_ops name="focus_outline">
    <rectangle x="0" y="0" width="width" height="height" color="gtk:bg[SELECTED]" filled="true"/>
    <rectangle x="0" y="0" width="width-1" height="height-1" color="gtk:light[SELECTED]" filled="false"/>
</draw_ops>

<draw_ops name="unfocus_outline">
    <rectangle x="0" y="0" width="width" height="height" color="gtk:bg[INSENSITIVE]" filled="true"/>
    <rectangle x="0" y="0" width="width-1" height="height-1" color="gtk:light[INSENSITIVE]" filled="false"/>
</draw_ops>

<draw_ops name="focus_background">
	<include name="focus_outline"/>
</draw_ops>

<draw_ops name="unfocus_background">
	<include name="unfocus_outline" />
</draw_ops>

<!-- unfocussed -->

<draw_ops name="title_text_focused_with_icon">       
    <title color="#d4d4d4"
           x="(((width  - title_width)  / 2) `max` 0)"
           y="(((height - title_height) / 2) `max` 0)"/>
</draw_ops>

<!-- focused -->

<draw_ops name="title_text_with_icon">
    <title color="gtk:light[INSENSITIVE]"
           x="(((width - title_width)  / 2) `max` 0)"
           y="((height - title_height) / 2) `max` 0"/> 
</draw_ops>

<!-- unfocussed -->

<draw_ops name="title_normal">
	<include name="title_text_with_icon"/>
</draw_ops>

<!-- focused -->

<draw_ops name="title_focused">
	<include name="title_text_focused_with_icon"/>
</draw_ops>

<!-- BUTTONS -->
	
	<draw_ops name="menu_focused_normal">
   		<image filename="menu_focused_normal.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="menu_focused_prelight">
  	 	<image filename="menu_focused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="menu_unfocused_normal">
  	 	<image filename="menu_unfocused.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="menu_unfocused_prelight">
   		<image filename="menu_unfocused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="minimize_focused_normal">
		<image filename="minimize_focused_normal.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="minimize_focused_prelight">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[SELECTED]" filled="true"/>
		<image filename="minimize_focused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="minimize_focused_pressed">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[SELECTED]" filled="true"/>
		<image filename="minimize_focused_pressed.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="minimize_unfocused_normal">
		<image filename="minimize_unfocused.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="minimize_unfocused_prelight">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[INSENSITIVE]" filled="true"/>
		<image filename="minimize_unfocused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="minimize_unfocused_pressed">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[INSENSITIVE]" filled="true"/>
		<image filename="minimize_unfocused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="maximize_focused_normal">
		<image filename="maximize_focused_normal.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="maximize_focused_prelight">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[SELECTED]" filled="true"/>
		<image filename="maximize_focused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="maximize_focused_pressed">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[SELECTED]" filled="true"/>
		<image filename="maximize_focused_pressed.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="maximize_unfocused_normal">
		<image filename="maximize_unfocused.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="maximize_unfocused_prelight">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[INSENSITIVE]" filled="true"/>
		<image filename="maximize_unfocused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="maximize_unfocused_pressed">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[INSENSITIVE]" filled="true"/>
		<image filename="maximize_unfocused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="unmaximize_focused_normal">
		<image filename="unmaximize_focused_normal.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="unmaximize_focused_prelight">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[SELECTED]" filled="true"/>
		<image filename="unmaximize_focused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="unmaximize_focused_pressed">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[SELECTED]" filled="true"/>
		<image filename="unmaximize_focused_pressed.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="unmaximize_unfocused_normal">
		<image filename="unmaximize_unfocused.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="unmaximize_unfocused_prelight">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[INSENSITIVE]" filled="true"/>
		<image filename="unmaximize_unfocused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="unmaximize_unfocused_pressed">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[INSENSITIVE]" filled="true"/>
		<image filename="unmaximize_unfocused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="close_focused_normal">
		<image filename="close_focused_normal.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="close_focused_prelight">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[SELECTED]" filled="true"/>
		<image filename="close_focused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="close_focused_pressed">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[SELECTED]" filled="true"/>
		<image filename="close_focused_pressed.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="close_unfocused_normal">
		<image filename="close_unfocused.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="close_unfocused_prelight">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[INSENSITIVE]" filled="true"/>
		<image filename="close_unfocused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

	<draw_ops name="close_unfocused_pressed">
		<rectangle x="1" y="1" width="25" height="25" color="gtk:light[INSENSITIVE]" filled="true"/>
		<image filename="close_unfocused_prelight.png" x="4" y="4" width="object_width" height="object_height"/>
	</draw_ops>

<!-- FRAME STYLES -->

<frame_style name="normal_unfocused" geometry="normal">
    <piece position="entire_background" draw_ops="unfocus_background"/>
    <piece position="titlebar" draw_ops="title_unfocused_background"/>
    <piece position="title" draw_ops="title_normal"/>
	<button function="menu" state="normal" draw_ops="menu_unfocused_normal"/>
	<button function="menu" state="prelight" draw_ops="menu_unfocused_prelight"/>
	<button function="menu" state="pressed" draw_ops="menu_focused_normal"/>
	<button function="minimize" state="normal" draw_ops="minimize_unfocused_normal"/>
	<button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight"/>
	<button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed"/>
	<button function="maximize" state="normal" draw_ops="maximize_unfocused_normal"/>
	<button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight"/>
	<button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed"/>
	<button function="close" state="normal" draw_ops="close_unfocused_normal"/>
	<button function="close" state="prelight" draw_ops="close_unfocused_prelight"/>
	<button function="close" state="pressed" draw_ops="close_unfocused_pressed"/>
</frame_style>

<frame_style name="normal_focused" geometry="normal">
    <piece position="entire_background" draw_ops="focus_background"/>
    <piece position="titlebar" draw_ops="title_background"/>  
    <piece position="title" draw_ops="title_focused"/>
	<button function="menu" state="normal" draw_ops="menu_focused_normal"/>
	<button function="menu" state="prelight" draw_ops="menu_focused_prelight"/>
	<button function="menu" state="pressed" draw_ops="menu_focused_normal"/> 
	<button function="minimize" state="normal" draw_ops="minimize_focused_normal"/>
	<button function="minimize" state="prelight" draw_ops="minimize_focused_prelight"/>
	<button function="minimize" state="pressed" draw_ops="minimize_focused_pressed"/>
	<button function="maximize" state="normal" draw_ops="maximize_focused_normal"/>
	<button function="maximize" state="prelight" draw_ops="maximize_focused_prelight"/>
	<button function="maximize" state="pressed" draw_ops="maximize_focused_pressed"/>
	<button function="close" state="normal" draw_ops="close_focused_normal"/>
	<button function="close" state="prelight" draw_ops="close_focused_prelight"/>
	<button function="close" state="pressed" draw_ops="close_focused_pressed"/>
</frame_style>

<frame_style name="maximized_unfocused" geometry="normal_small_borders" parent="normal_unfocused">
    <piece position="entire_background" draw_ops="blank"/>
    <piece position="titlebar" draw_ops="title_unfocused_background_maximized"/>
	<button function="maximize" state="normal" draw_ops="unmaximize_unfocused_normal"/>
	<button function="maximize" state="prelight" draw_ops="unmaximize_unfocused_prelight"/>
	<button function="maximize" state="pressed" draw_ops="unmaximize_unfocused_pressed"/>
</frame_style>

<frame_style name="maximized_focused" geometry="normal_small_borders" parent="normal_focused">
    <piece position="entire_background" draw_ops="focus_outline"/>
    <piece position="titlebar" draw_ops="title_background_maximized"/>
	<button function="maximize" state="normal" draw_ops="unmaximize_focused_normal"/>
	<button function="maximize" state="prelight" draw_ops="unmaximize_focused_prelight"/>
	<button function="maximize" state="pressed" draw_ops="unmaximize_focused_pressed"/>
</frame_style>

<frame_style name="border" geometry="border" parent="normal_unfocused">
	<piece position="entire_background" draw_ops="unfocus_background"/>
	<piece position="titlebar" draw_ops="blank"/>
	<piece position="title" draw_ops="blank"/>
</frame_style>

<!-- STYLE SETS -->

<frame_style_set name="normal">
	<frame focus="yes" state="normal" resize="both" style="normal_focused"/>
	<frame focus="no" state="normal" resize="both" style="normal_unfocused"/>
	<frame focus="yes" state="maximized" style="maximized_focused"/>
	<frame focus="no" state="maximized" style="maximized_unfocused"/>
	<frame focus="yes" state="shaded" style="normal_focused"/>
	<frame focus="no" state="shaded" style="normal_unfocused"/>
	<frame focus="yes" state="maximized_and_shaded" style="maximized_focused"/>
	<frame focus="no" state="maximized_and_shaded" style="maximized_unfocused"/>
</frame_style_set>

<frame_style_set name="border">
	<frame focus="yes" state="normal" resize="both" style="border"/>
	<frame focus="no" state="normal" resize="both" style="border"/>
	<frame focus="yes" state="maximized" style="border"/>
	<frame focus="no" state="maximized" style="border"/>
	<frame focus="yes" state="shaded" style="border"/>
	<frame focus="no" state="shaded" style="border"/>
	<frame focus="yes" state="maximized_and_shaded" style="border"/>
	<frame focus="no" state="maximized_and_shaded" style="border"/>
</frame_style_set>

<!-- WINDOWS -->

<window type="normal" style_set="normal"/>
<window type="dialog" style_set="normal"/>
<window type="modal_dialog" style_set="normal"/>
<window type="menu" style_set="normal"/>
<window type="utility" style_set="normal"/>
<window type="border" style_set="border"/>

</metacity_theme>