added pretty suspend tab
This commit is contained in:
parent
0ee5ac4983
commit
9a5a210fe5
|
@ -217,3 +217,6 @@ static Button buttons[] = {
|
||||||
{ OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 },
|
{ OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 },
|
||||||
{ OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 },
|
{ OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const char *suspended_html = "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title></title><style>body{background-color:#222;color:#444;display:flex;justify-content:center;align-items:center;height:100vh;margin:0;font-size:220px;}</style></head><body>⏾</body></html>";
|
||||||
|
|
8
surf.c
8
surf.c
|
@ -573,7 +573,7 @@ void tab_mouse_pos_index(GdkEvent *e, Client *c, int *index, bool *close_tab) {
|
||||||
|
|
||||||
if (close_tab != NULL) {
|
if (close_tab != NULL) {
|
||||||
int x_width = MIN(get_font_size(c->tab_bar) * 5 / 2, tab_width / 4);
|
int x_width = MIN(get_font_size(c->tab_bar) * 5 / 2, tab_width / 4);
|
||||||
*close_tab = (x - *index * tab_width > tab_width - x_width);
|
*close_tab = (x - *index * tab_width > tab_width - x_width && *index < n_tabs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1004,6 +1004,12 @@ loaduri(Client *c, const Arg *a)
|
||||||
if (g_strcmp0(uri, "") == 0)
|
if (g_strcmp0(uri, "") == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Tab *selected_tab = g_list_nth_data(c->tabs, c->selected_tab);
|
||||||
|
if (selected_tab->suspended) {
|
||||||
|
webkit_web_view_load_alternate_html(c->view, suspended_html, uri, NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_str_has_prefix(uri, "http://") ||
|
if (g_str_has_prefix(uri, "http://") ||
|
||||||
g_str_has_prefix(uri, "https://") ||
|
g_str_has_prefix(uri, "https://") ||
|
||||||
g_str_has_prefix(uri, "file://") ||
|
g_str_has_prefix(uri, "file://") ||
|
||||||
|
|
Loading…
Reference in a new issue