Option to place tab bar at the top edge

Fixes #288
This commit is contained in:
Kovid Goyal
2018-01-19 17:04:58 +05:30
parent aff1abdb26
commit 213768b6e0
4 changed files with 30 additions and 6 deletions

View File

@@ -245,10 +245,20 @@ add_borders_rect(id_type os_window_id, id_type tab_id, uint32_t left, uint32_t t
void
os_window_regions(OSWindow *os_window, Region *central, Region *tab_bar) {
if (os_window->num_tabs > 1) {
central->left = 0; central->top = 0; central->right = os_window->viewport_width - 1;
central->bottom = os_window->viewport_height - global_state.cell_height - 1;
tab_bar->left = central->left; tab_bar->right = central->right; tab_bar->top = central->bottom + 1;
tab_bar->bottom = os_window->viewport_height - 1;
switch(OPT(tab_bar_edge)) {
case TOP_EDGE:
central->left = 0; central->top = global_state.cell_height; central->right = os_window->viewport_width - 1;
central->bottom = os_window->viewport_height - 1;
tab_bar->left = central->left; tab_bar->right = central->right; tab_bar->top = 0;
tab_bar->bottom = central->top - 1;
break;
default:
central->left = 0; central->top = 0; central->right = os_window->viewport_width - 1;
central->bottom = os_window->viewport_height - global_state.cell_height - 1;
tab_bar->left = central->left; tab_bar->right = central->right; tab_bar->top = central->bottom + 1;
tab_bar->bottom = os_window->viewport_height - 1;
break;
}
} else {
memset(tab_bar, 0, sizeof(Region));
central->left = 0; central->top = 0; central->right = os_window->viewport_width - 1;
@@ -330,6 +340,7 @@ PYWRAP1(set_options) {
S(cursor_shape, PyLong_AsLong);
S(url_style, PyLong_AsUnsignedLong);
S(x11_bell_volume, PyLong_AsLong);
S(tab_bar_edge, PyLong_AsLong);
S(mouse_hide_wait, PyFloat_AsDouble);
S(wheel_scroll_multiplier, PyFloat_AsDouble);
S(open_url_modifiers, PyLong_AsUnsignedLong);