init button states for the button backgrounds

2002-08-04  Havoc Pennington  <hp@redhat.com>

	* src/frames.c (meta_frames_paint_to_drawable): init button
	states for the button backgrounds

	* src/themes/Atlanta/metacity-theme-1.xml: adapt to work correctly
	with button repositioning
This commit is contained in:
Havoc Pennington 2002-08-04 20:45:05 +00:00 committed by Havoc Pennington
parent d81fdce482
commit f3446fad9a
3 changed files with 29 additions and 5 deletions

View File

@ -1,3 +1,11 @@
2002-08-04 Havoc Pennington <hp@redhat.com>
* src/frames.c (meta_frames_paint_to_drawable): init button
states for the button backgrounds
* src/themes/Atlanta/metacity-theme-1.xml: adapt to work correctly
with button repositioning
2002-08-04 Havoc Pennington <hp@redhat.com>
* src/frames.c (meta_frames_button_press_event): raise/focus

View File

@ -1573,6 +1573,20 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
break;
}
}
/* Map button function states to button position states */
button_states[META_BUTTON_TYPE_LEFT_LEFT_BACKGROUND] =
button_states[META_BUTTON_TYPE_MENU];
button_states[META_BUTTON_TYPE_LEFT_MIDDLE_BACKGROUND] =
META_BUTTON_STATE_NORMAL;
button_states[META_BUTTON_TYPE_LEFT_RIGHT_BACKGROUND] =
META_BUTTON_STATE_NORMAL;
button_states[META_BUTTON_TYPE_RIGHT_LEFT_BACKGROUND] =
button_states[META_BUTTON_TYPE_MINIMIZE];
button_states[META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND] =
button_states[META_BUTTON_TYPE_MAXIMIZE];
button_states[META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND] =
button_states[META_BUTTON_TYPE_CLOSE];
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
type = meta_core_get_frame_type (gdk_display, frame->xwindow);

View File

@ -80,7 +80,6 @@
</draw_ops>
<draw_ops name="menu_button_pressed">
<include name="button_pressed_bg"/>
<include name="menu_button"/>
</draw_ops>
@ -94,7 +93,6 @@
</draw_ops>
<draw_ops name="minimize_button_pressed">
<include name="button_pressed_bg"/>
<include name="minimize_button"/>
</draw_ops>
@ -106,7 +104,6 @@
</draw_ops>
<draw_ops name="maximize_button_pressed">
<include name="button_pressed_bg"/>
<include name="maximize_button"/>
</draw_ops>
@ -131,7 +128,6 @@
</draw_ops>
<draw_ops name="restore_button_pressed">
<include name="button_pressed_bg"/>
<include name="restore_button"/>
</draw_ops>
@ -145,7 +141,6 @@
</draw_ops>
<draw_ops name="close_button_pressed">
<include name="button_pressed_bg"/>
<include name="close_button"/>
</draw_ops>
@ -252,6 +247,13 @@
<piece position="title" draw_ops="title_normal"/>
<!-- we don't specify for prelight, so normal is used -->
<button function="left_left_background" state="pressed" draw_ops="button_pressed_bg"/>
<button function="left_middle_background" state="pressed" draw_ops="button_pressed_bg"/>
<button function="left_right_background" state="pressed" draw_ops="button_pressed_bg"/>
<button function="right_left_background" state="pressed" draw_ops="button_pressed_bg"/>
<button function="right_middle_background" state="pressed" draw_ops="button_pressed_bg"/>
<button function="right_right_background" state="pressed" draw_ops="button_pressed_bg"/>
<button function="close" state="normal" draw_ops="close_button"/>
<button function="close" state="pressed" draw_ops="close_button_pressed"/>
<button function="minimize" state="normal" draw_ops="minimize_button"/>