diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispextern.h | 26 | ||||
| -rw-r--r-- | src/xdisp.c | 28 | ||||
| -rw-r--r-- | src/xfaces.c | 8 |
3 files changed, 46 insertions, 16 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 55f4118d676..16565b8ad18 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -1610,6 +1610,27 @@ struct glyph_string | |||
| 1610 | : estimate_mode_line_height \ | 1610 | : estimate_mode_line_height \ |
| 1611 | (XFRAME ((W)->frame), CURRENT_HEADER_LINE_ACTIVE_FACE_ID (W))))) | 1611 | (XFRAME ((W)->frame), CURRENT_HEADER_LINE_ACTIVE_FACE_ID (W))))) |
| 1612 | 1612 | ||
| 1613 | /* Return the desired face id for the tab line of a window, depending | ||
| 1614 | on whether the window is selected or not, or if the window is the | ||
| 1615 | scrolling window for the currently active minibuffer window. */ | ||
| 1616 | |||
| 1617 | #define CURRENT_TAB_LINE_ACTIVE_FACE_ID_3(SELW, MBW, SCRW) \ | ||
| 1618 | ((!mode_line_in_non_selected_windows \ | ||
| 1619 | || (SELW) == XWINDOW (selected_window) \ | ||
| 1620 | || (minibuf_level > 0 \ | ||
| 1621 | && !NILP (minibuf_selected_window) \ | ||
| 1622 | && (MBW) == XWINDOW (minibuf_window) \ | ||
| 1623 | && (SCRW) == XWINDOW (minibuf_selected_window))) \ | ||
| 1624 | ? TAB_LINE_ACTIVE_FACE_ID \ | ||
| 1625 | : TAB_LINE_INACTIVE_FACE_ID) | ||
| 1626 | |||
| 1627 | /* Return the desired face id for the tab line of window W. */ | ||
| 1628 | |||
| 1629 | #define CURRENT_TAB_LINE_ACTIVE_FACE_ID(W) \ | ||
| 1630 | CURRENT_TAB_LINE_ACTIVE_FACE_ID_3(W, \ | ||
| 1631 | XWINDOW (selected_window), \ | ||
| 1632 | W) | ||
| 1633 | |||
| 1613 | /* Return the current height of the tab line of window W. If not known | 1634 | /* Return the current height of the tab line of window W. If not known |
| 1614 | from W->tab_line_height, look at W's current glyph matrix, or return | 1635 | from W->tab_line_height, look at W's current glyph matrix, or return |
| 1615 | an estimation based on the height of the font of the face `tab-line'. */ | 1636 | an estimation based on the height of the font of the face `tab-line'. */ |
| @@ -1621,7 +1642,7 @@ struct glyph_string | |||
| 1621 | = (MATRIX_TAB_LINE_HEIGHT ((W)->current_matrix) \ | 1642 | = (MATRIX_TAB_LINE_HEIGHT ((W)->current_matrix) \ |
| 1622 | ? MATRIX_TAB_LINE_HEIGHT ((W)->current_matrix) \ | 1643 | ? MATRIX_TAB_LINE_HEIGHT ((W)->current_matrix) \ |
| 1623 | : estimate_mode_line_height \ | 1644 | : estimate_mode_line_height \ |
| 1624 | (XFRAME ((W)->frame), TAB_LINE_FACE_ID)))) | 1645 | (XFRAME ((W)->frame), CURRENT_TAB_LINE_ACTIVE_FACE_ID (W))))) |
| 1625 | 1646 | ||
| 1626 | /* Return the height of the desired mode line of window W. */ | 1647 | /* Return the height of the desired mode line of window W. */ |
| 1627 | 1648 | ||
| @@ -1943,7 +1964,8 @@ enum face_id | |||
| 1943 | INTERNAL_BORDER_FACE_ID, | 1964 | INTERNAL_BORDER_FACE_ID, |
| 1944 | CHILD_FRAME_BORDER_FACE_ID, | 1965 | CHILD_FRAME_BORDER_FACE_ID, |
| 1945 | TAB_BAR_FACE_ID, | 1966 | TAB_BAR_FACE_ID, |
| 1946 | TAB_LINE_FACE_ID, | 1967 | TAB_LINE_ACTIVE_FACE_ID, |
| 1968 | TAB_LINE_INACTIVE_FACE_ID, | ||
| 1947 | BASIC_FACE_ID_SENTINEL | 1969 | BASIC_FACE_ID_SENTINEL |
| 1948 | }; | 1970 | }; |
| 1949 | 1971 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 370c3ec30c1..281f04e4132 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1343,7 +1343,7 @@ window_box_height (struct window *w) | |||
| 1343 | if (tl_row && tl_row->mode_line_p) | 1343 | if (tl_row && tl_row->mode_line_p) |
| 1344 | height -= tl_row->height; | 1344 | height -= tl_row->height; |
| 1345 | else | 1345 | else |
| 1346 | height -= estimate_mode_line_height (f, TAB_LINE_FACE_ID); | 1346 | height -= estimate_mode_line_height (f, CURRENT_TAB_LINE_ACTIVE_FACE_ID (w)); |
| 1347 | } | 1347 | } |
| 1348 | } | 1348 | } |
| 1349 | 1349 | ||
| @@ -1743,7 +1743,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, | |||
| 1743 | = window_parameter (w, Qtab_line_format); | 1743 | = window_parameter (w, Qtab_line_format); |
| 1744 | 1744 | ||
| 1745 | w->tab_line_height | 1745 | w->tab_line_height |
| 1746 | = display_mode_line (w, TAB_LINE_FACE_ID, | 1746 | = display_mode_line (w, CURRENT_TAB_LINE_ACTIVE_FACE_ID (w), |
| 1747 | NILP (window_tab_line_format) | 1747 | NILP (window_tab_line_format) |
| 1748 | ? BVAR (current_buffer, tab_line_format) | 1748 | ? BVAR (current_buffer, tab_line_format) |
| 1749 | : window_tab_line_format); | 1749 | : window_tab_line_format); |
| @@ -3285,7 +3285,8 @@ init_iterator (struct it *it, struct window *w, | |||
| 3285 | if (base_face_id == MODE_LINE_ACTIVE_FACE_ID | 3285 | if (base_face_id == MODE_LINE_ACTIVE_FACE_ID |
| 3286 | || base_face_id == MODE_LINE_INACTIVE_FACE_ID) | 3286 | || base_face_id == MODE_LINE_INACTIVE_FACE_ID) |
| 3287 | row = MATRIX_MODE_LINE_ROW (w->desired_matrix); | 3287 | row = MATRIX_MODE_LINE_ROW (w->desired_matrix); |
| 3288 | else if (base_face_id == TAB_LINE_FACE_ID) | 3288 | else if (base_face_id == TAB_LINE_ACTIVE_FACE_ID |
| 3289 | || base_face_id == TAB_LINE_INACTIVE_FACE_ID) | ||
| 3289 | row = MATRIX_TAB_LINE_ROW (w->desired_matrix); | 3290 | row = MATRIX_TAB_LINE_ROW (w->desired_matrix); |
| 3290 | else if (base_face_id == HEADER_LINE_ACTIVE_FACE_ID | 3291 | else if (base_face_id == HEADER_LINE_ACTIVE_FACE_ID |
| 3291 | || base_face_id == HEADER_LINE_INACTIVE_FACE_ID) | 3292 | || base_face_id == HEADER_LINE_INACTIVE_FACE_ID) |
| @@ -11975,7 +11976,7 @@ window_text_pixel_size (Lisp_Object window, Lisp_Object from, Lisp_Object to, | |||
| 11975 | Lisp_Object window_tab_line_format | 11976 | Lisp_Object window_tab_line_format |
| 11976 | = window_parameter (w, Qtab_line_format); | 11977 | = window_parameter (w, Qtab_line_format); |
| 11977 | 11978 | ||
| 11978 | y = y + display_mode_line (w, TAB_LINE_FACE_ID, | 11979 | y = y + display_mode_line (w, CURRENT_TAB_LINE_ACTIVE_FACE_ID (w), |
| 11979 | NILP (window_tab_line_format) | 11980 | NILP (window_tab_line_format) |
| 11980 | ? BVAR (current_buffer, tab_line_format) | 11981 | ? BVAR (current_buffer, tab_line_format) |
| 11981 | : window_tab_line_format); | 11982 | : window_tab_line_format); |
| @@ -27946,7 +27947,7 @@ display_mode_lines (struct window *w) | |||
| 27946 | Lisp_Object window_tab_line_format | 27947 | Lisp_Object window_tab_line_format |
| 27947 | = window_parameter (w, Qtab_line_format); | 27948 | = window_parameter (w, Qtab_line_format); |
| 27948 | 27949 | ||
| 27949 | display_mode_line (w, TAB_LINE_FACE_ID, | 27950 | display_mode_line (w, CURRENT_TAB_LINE_ACTIVE_FACE_ID_3 (sel_w, sel_w, w), |
| 27950 | NILP (window_tab_line_format) | 27951 | NILP (window_tab_line_format) |
| 27951 | ? BVAR (current_buffer, tab_line_format) | 27952 | ? BVAR (current_buffer, tab_line_format) |
| 27952 | : window_tab_line_format); | 27953 | : window_tab_line_format); |
| @@ -27975,10 +27976,10 @@ display_mode_lines (struct window *w) | |||
| 27975 | 27976 | ||
| 27976 | /* Display mode or header/tab line of window W. FACE_ID specifies which | 27977 | /* Display mode or header/tab line of window W. FACE_ID specifies which |
| 27977 | line to display; it is either MODE_LINE_ACTIVE_FACE_ID, | 27978 | line to display; it is either MODE_LINE_ACTIVE_FACE_ID, |
| 27978 | HEADER_LINE_ACTIVE_FACE_ID, HEADER_LINE_INACTIVE_FACE_ID, or | 27979 | HEADER_LINE_ACTIVE_FACE_ID, HEADER_LINE_INACTIVE_FACE_ID, |
| 27979 | TAB_LINE_FACE_ID. FORMAT is the mode/header/tab line format to | 27980 | TAB_LINE_ACTIVE_FACE_ID or TAB_LINE_INACTIVE_FACE_ID. |
| 27980 | display. Value is the pixel height of the mode/header/tab line | 27981 | FORMAT is the mode/header/tab line format to display. |
| 27981 | displayed. */ | 27982 | Value is the pixel height of the mode/header/tab line displayed. */ |
| 27982 | 27983 | ||
| 27983 | static int | 27984 | static int |
| 27984 | display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format) | 27985 | display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format) |
| @@ -27994,7 +27995,8 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format) | |||
| 27994 | prepare_desired_row (w, it.glyph_row, true); | 27995 | prepare_desired_row (w, it.glyph_row, true); |
| 27995 | 27996 | ||
| 27996 | it.glyph_row->mode_line_p = true; | 27997 | it.glyph_row->mode_line_p = true; |
| 27997 | if (face_id == TAB_LINE_FACE_ID) | 27998 | if (face_id == TAB_LINE_ACTIVE_FACE_ID |
| 27999 | || face_id == TAB_LINE_INACTIVE_FACE_ID) | ||
| 27998 | { | 28000 | { |
| 27999 | it.glyph_row->tab_line_p = true; | 28001 | it.glyph_row->tab_line_p = true; |
| 28000 | w->desired_matrix->tab_line_p = true; | 28002 | w->desired_matrix->tab_line_p = true; |
| @@ -28021,7 +28023,8 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format) | |||
| 28021 | if (NILP (Vmode_line_compact) | 28023 | if (NILP (Vmode_line_compact) |
| 28022 | || face_id == HEADER_LINE_ACTIVE_FACE_ID | 28024 | || face_id == HEADER_LINE_ACTIVE_FACE_ID |
| 28023 | || face_id == HEADER_LINE_INACTIVE_FACE_ID | 28025 | || face_id == HEADER_LINE_INACTIVE_FACE_ID |
| 28024 | || face_id == TAB_LINE_FACE_ID) | 28026 | || face_id == TAB_LINE_ACTIVE_FACE_ID |
| 28027 | || face_id == TAB_LINE_INACTIVE_FACE_ID) | ||
| 28025 | { | 28028 | { |
| 28026 | mode_line_target = MODE_LINE_DISPLAY; | 28029 | mode_line_target = MODE_LINE_DISPLAY; |
| 28027 | display_mode_element (&it, 0, 0, 0, format, Qnil, false); | 28030 | display_mode_element (&it, 0, 0, 0, format, Qnil, false); |
| @@ -28879,7 +28882,8 @@ are the selected window and the WINDOW's buffer). */) | |||
| 28879 | : EQ (face, Qmode_line_inactive) ? MODE_LINE_INACTIVE_FACE_ID | 28882 | : EQ (face, Qmode_line_inactive) ? MODE_LINE_INACTIVE_FACE_ID |
| 28880 | : EQ (face, Qheader_line_active) ? HEADER_LINE_ACTIVE_FACE_ID | 28883 | : EQ (face, Qheader_line_active) ? HEADER_LINE_ACTIVE_FACE_ID |
| 28881 | : EQ (face, Qheader_line_inactive) ? HEADER_LINE_INACTIVE_FACE_ID | 28884 | : EQ (face, Qheader_line_inactive) ? HEADER_LINE_INACTIVE_FACE_ID |
| 28882 | : EQ (face, Qtab_line) ? TAB_LINE_FACE_ID | 28885 | : EQ (face, Qtab_line_active) ? TAB_LINE_ACTIVE_FACE_ID |
| 28886 | : EQ (face, Qtab_line_inactive) ? TAB_LINE_INACTIVE_FACE_ID | ||
| 28883 | : EQ (face, Qtab_bar) ? TAB_BAR_FACE_ID | 28887 | : EQ (face, Qtab_bar) ? TAB_BAR_FACE_ID |
| 28884 | : EQ (face, Qtool_bar) ? TOOL_BAR_FACE_ID | 28888 | : EQ (face, Qtool_bar) ? TOOL_BAR_FACE_ID |
| 28885 | : DEFAULT_FACE_ID; | 28889 | : DEFAULT_FACE_ID; |
diff --git a/src/xfaces.c b/src/xfaces.c index ab0934abde2..6c4267b8afa 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -5195,7 +5195,8 @@ lookup_basic_face (struct window *w, struct frame *f, int face_id) | |||
| 5195 | case MODE_LINE_INACTIVE_FACE_ID: name = Qmode_line_inactive; break; | 5195 | case MODE_LINE_INACTIVE_FACE_ID: name = Qmode_line_inactive; break; |
| 5196 | case HEADER_LINE_ACTIVE_FACE_ID: name = Qheader_line_active; break; | 5196 | case HEADER_LINE_ACTIVE_FACE_ID: name = Qheader_line_active; break; |
| 5197 | case HEADER_LINE_INACTIVE_FACE_ID: name = Qheader_line_inactive; break; | 5197 | case HEADER_LINE_INACTIVE_FACE_ID: name = Qheader_line_inactive; break; |
| 5198 | case TAB_LINE_FACE_ID: name = Qtab_line; break; | 5198 | case TAB_LINE_ACTIVE_FACE_ID: name = Qtab_line_active; break; |
| 5199 | case TAB_LINE_INACTIVE_FACE_ID: name = Qtab_line_inactive; break; | ||
| 5199 | case TAB_BAR_FACE_ID: name = Qtab_bar; break; | 5200 | case TAB_BAR_FACE_ID: name = Qtab_bar; break; |
| 5200 | case TOOL_BAR_FACE_ID: name = Qtool_bar; break; | 5201 | case TOOL_BAR_FACE_ID: name = Qtool_bar; break; |
| 5201 | case FRINGE_FACE_ID: name = Qfringe; break; | 5202 | case FRINGE_FACE_ID: name = Qfringe; break; |
| @@ -5975,7 +5976,8 @@ realize_basic_faces (struct frame *f) | |||
| 5975 | realize_named_face (f, Qinternal_border, INTERNAL_BORDER_FACE_ID); | 5976 | realize_named_face (f, Qinternal_border, INTERNAL_BORDER_FACE_ID); |
| 5976 | realize_named_face (f, Qchild_frame_border, CHILD_FRAME_BORDER_FACE_ID); | 5977 | realize_named_face (f, Qchild_frame_border, CHILD_FRAME_BORDER_FACE_ID); |
| 5977 | realize_named_face (f, Qtab_bar, TAB_BAR_FACE_ID); | 5978 | realize_named_face (f, Qtab_bar, TAB_BAR_FACE_ID); |
| 5978 | realize_named_face (f, Qtab_line, TAB_LINE_FACE_ID); | 5979 | realize_named_face (f, Qtab_line_active, TAB_LINE_ACTIVE_FACE_ID); |
| 5980 | realize_named_face (f, Qtab_line_inactive, TAB_LINE_INACTIVE_FACE_ID); | ||
| 5979 | unbind_to (count, Qnil); | 5981 | unbind_to (count, Qnil); |
| 5980 | 5982 | ||
| 5981 | /* Reflect changes in the `menu' face in menu bars. */ | 5983 | /* Reflect changes in the `menu' face in menu bars. */ |
| @@ -7534,6 +7536,8 @@ syms_of_xfaces (void) | |||
| 7534 | DEFSYM (Qtab_bar, "tab-bar"); | 7536 | DEFSYM (Qtab_bar, "tab-bar"); |
| 7535 | DEFSYM (Qfringe, "fringe"); | 7537 | DEFSYM (Qfringe, "fringe"); |
| 7536 | DEFSYM (Qtab_line, "tab-line"); | 7538 | DEFSYM (Qtab_line, "tab-line"); |
| 7539 | DEFSYM (Qtab_line_inactive, "tab-line-inactive"); | ||
| 7540 | DEFSYM (Qtab_line_active, "tab-line-active"); | ||
| 7537 | DEFSYM (Qheader_line, "header-line"); | 7541 | DEFSYM (Qheader_line, "header-line"); |
| 7538 | DEFSYM (Qheader_line_inactive, "header-line-inactive"); | 7542 | DEFSYM (Qheader_line_inactive, "header-line-inactive"); |
| 7539 | DEFSYM (Qheader_line_active, "header-line-active"); | 7543 | DEFSYM (Qheader_line_active, "header-line-active"); |