mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-17 09:42:38 +03:00
Avoid need for hlcache_handle by using browser APIs.
This commit is contained in:
parent
62395c1186
commit
b727c31de7
@ -4306,14 +4306,12 @@ void ro_gui_throb(void)
|
|||||||
void ro_gui_window_update_toolbar_buttons(struct gui_window *g)
|
void ro_gui_window_update_toolbar_buttons(struct gui_window *g)
|
||||||
{
|
{
|
||||||
struct browser_window *bw;
|
struct browser_window *bw;
|
||||||
hlcache_handle *h;
|
|
||||||
struct toolbar *toolbar;
|
struct toolbar *toolbar;
|
||||||
|
|
||||||
if (g == NULL || g->toolbar == NULL)
|
if (g == NULL || g->toolbar == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bw = g->bw;
|
bw = g->bw;
|
||||||
h = bw->current_content;
|
|
||||||
toolbar = g->toolbar;
|
toolbar = g->toolbar;
|
||||||
|
|
||||||
ro_toolbar_set_button_shaded_state(toolbar, TOOLBAR_BUTTON_RELOAD,
|
ro_toolbar_set_button_shaded_state(toolbar, TOOLBAR_BUTTON_RELOAD,
|
||||||
@ -4332,17 +4330,16 @@ void ro_gui_window_update_toolbar_buttons(struct gui_window *g)
|
|||||||
!browser_window_up_available(bw));
|
!browser_window_up_available(bw));
|
||||||
|
|
||||||
ro_toolbar_set_button_shaded_state(toolbar, TOOLBAR_BUTTON_SEARCH,
|
ro_toolbar_set_button_shaded_state(toolbar, TOOLBAR_BUTTON_SEARCH,
|
||||||
h == NULL || (content_get_type(h) != CONTENT_HTML &&
|
!browser_window_can_search(bw));
|
||||||
content_get_type(h) != CONTENT_TEXTPLAIN));
|
|
||||||
|
|
||||||
ro_toolbar_set_button_shaded_state(toolbar, TOOLBAR_BUTTON_SCALE,
|
ro_toolbar_set_button_shaded_state(toolbar, TOOLBAR_BUTTON_SCALE,
|
||||||
h == NULL);
|
!browser_window_has_content(bw));
|
||||||
|
|
||||||
ro_toolbar_set_button_shaded_state(toolbar, TOOLBAR_BUTTON_PRINT,
|
ro_toolbar_set_button_shaded_state(toolbar, TOOLBAR_BUTTON_PRINT,
|
||||||
h == NULL);
|
!browser_window_has_content(bw));
|
||||||
|
|
||||||
ro_toolbar_set_button_shaded_state(toolbar, TOOLBAR_BUTTON_SAVE_SOURCE,
|
ro_toolbar_set_button_shaded_state(toolbar, TOOLBAR_BUTTON_SAVE_SOURCE,
|
||||||
h == NULL);
|
!browser_window_has_content(bw));
|
||||||
|
|
||||||
ro_toolbar_update_urlsuggest(toolbar);
|
ro_toolbar_update_urlsuggest(toolbar);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user