Lisp_Object new_value,
Lisp_Object old_value)
{
- Lisp_Object choice = list4 (Qleft, Qright, Qtop, Qbottom);
+ if (!EQ (new_value, Qtop) && !EQ (new_value, Qbottom))
+ error ("Tool bar position must be either `top' or `bottom'");
- if (!NILP (Fmemq (new_value, choice)))
- {
- if (!EQ (new_value, Qtop))
- error ("The only supported tool bar position is top");
- }
- else
- wrong_choice (choice, new_value);
+ if (EQ (new_value, old_value))
+ return;
+
+ /* Set the tool bar position. */
+ fset_tool_bar_position (f, new_value);
+
+ /* Now reconfigure frame glyphs to place the tool bar at the
+ bottom. While the inner height has not changed, call
+ `resize_frame_windows' to place each of the windows at its
+ new position. */
+
+ adjust_frame_size (f, -1, -1, 3, false, Qtool_bar_position);
+ adjust_frame_glyphs (f);
+ SET_FRAME_GARBAGED (f);
+
+ if (FRAME_ANDROID_WINDOW (f))
+ android_clear_under_internal_border (f);
}
void
tab_bar_height = FRAME_TAB_BAR_HEIGHT (f);
tab_bar_width = (tab_bar_height
- ? native_width - 2 * internal_border_width
+ ? native_width - 2 * internal_border_width
: 0);
inner_top += tab_bar_height;
tool_bar_width = (tool_bar_height
? native_width - 2 * internal_border_width
: 0);
- inner_top += tool_bar_height;
+
+ /* Subtract or add to the inner dimensions based on the tool bar
+ position. */
+
+ if (EQ (FRAME_TOOL_BAR_POSITION (f), Qtop))
+ inner_top += tool_bar_height;
+ else
+ inner_bottom -= tool_bar_height;
/* Construct list. */
if (EQ (attribute, Qouter_edges))
android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc,
flash_left,
(height - flash_height
- - FRAME_INTERNAL_BORDER_WIDTH (f)),
+ - FRAME_INTERNAL_BORDER_WIDTH (f)
+ - FRAME_BOTTOM_MARGIN_HEIGHT (f)),
width, flash_height);
}
android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc,
flash_left,
(height - flash_height
- - FRAME_INTERNAL_BORDER_WIDTH (f)),
+ - FRAME_INTERNAL_BORDER_WIDTH (f)
+ - FRAME_BOTTOM_MARGIN_HEIGHT (f)),
width, flash_height);
}
else
int width = FRAME_PIXEL_WIDTH (f);
int height = FRAME_PIXEL_HEIGHT (f);
int margin = FRAME_TOP_MARGIN_HEIGHT (f);
- int face_id =
- (FRAME_PARENT_FRAME (f)
- ? (!NILP (Vface_remapping_alist)
- ? lookup_basic_face (NULL, f, CHILD_FRAME_BORDER_FACE_ID)
- : CHILD_FRAME_BORDER_FACE_ID)
- : (!NILP (Vface_remapping_alist)
- ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID)
- : INTERNAL_BORDER_FACE_ID));
+ int bottom_margin = FRAME_BOTTOM_MARGIN_HEIGHT (f);
+ int face_id = (FRAME_PARENT_FRAME (f)
+ ? (!NILP (Vface_remapping_alist)
+ ? lookup_basic_face (NULL, f,
+ CHILD_FRAME_BORDER_FACE_ID)
+ : CHILD_FRAME_BORDER_FACE_ID)
+ : (!NILP (Vface_remapping_alist)
+ ? lookup_basic_face (NULL, f,
+ INTERNAL_BORDER_FACE_ID)
+ : INTERNAL_BORDER_FACE_ID));
struct face *face = FACE_FROM_ID_OR_NULL (f, face_id);
if (face)
android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc, width - border,
0, border, height);
android_fill_rectangle (FRAME_ANDROID_DRAWABLE (f), gc, 0,
- height - border, width, border);
+ height - bottom_margin - border,
+ width, border);
android_set_foreground (gc, FRAME_FOREGROUND_PIXEL (f));
}
else
android_clear_area (FRAME_ANDROID_DRAWABLE (f), width - border,
0, border, height);
android_clear_area (FRAME_ANDROID_DRAWABLE (f), 0,
- height - border, width, border);
+ height - bottom_margin - border,
+ width, border);
}
}
}