mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-28 09:13:08 +03:00
Possibly fix the GTK build and implement frameset scaling.
svn path=/trunk/netsurf/; revision=2933
This commit is contained in:
parent
02a8722cc6
commit
f775b64fb7
@ -128,7 +128,6 @@ static gboolean nsgtk_history_button_press_event(GtkWidget *, GdkEventButton *,
|
|||||||
gpointer);
|
gpointer);
|
||||||
|
|
||||||
static void nsgtk_attach_menu_handlers(GladeXML *, gpointer);
|
static void nsgtk_attach_menu_handlers(GladeXML *, gpointer);
|
||||||
static void nsgtk_window_change_scale(struct gui_window *, float);
|
|
||||||
|
|
||||||
#define MENUEVENT(x) { #x, G_CALLBACK(nsgtk_on_##x##_activate) }
|
#define MENUEVENT(x) { #x, G_CALLBACK(nsgtk_on_##x##_activate) }
|
||||||
#define MENUPROTO(x) static gboolean nsgtk_on_##x##_activate( \
|
#define MENUPROTO(x) static gboolean nsgtk_on_##x##_activate( \
|
||||||
@ -560,39 +559,23 @@ MENUHANDLER(choices)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsgtk_window_change_scale(struct gui_window *g, float scale)
|
|
||||||
{
|
|
||||||
g->scale = scale;
|
|
||||||
|
|
||||||
if (g->bw->current_content != NULL)
|
|
||||||
gui_window_update_extent(g);
|
|
||||||
|
|
||||||
gtk_widget_queue_draw(GTK_WIDGET(g->drawing_area));
|
|
||||||
}
|
|
||||||
|
|
||||||
MENUHANDLER(zoom_in)
|
MENUHANDLER(zoom_in)
|
||||||
{
|
{
|
||||||
struct gui_window *gw = g;
|
browser_window_set_scale(g->bw, g->scale + 0.05, true);
|
||||||
|
|
||||||
nsgtk_window_change_scale(gw, gw->scale + 0.05);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
MENUHANDLER(normal_size)
|
MENUHANDLER(normal_size)
|
||||||
{
|
{
|
||||||
struct gui_window *gw = g;
|
browser_window_set_scale(g->bw, 1.0, true);
|
||||||
|
|
||||||
nsgtk_window_change_scale(gw, 1.00);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
MENUHANDLER(zoom_out)
|
MENUHANDLER(zoom_out)
|
||||||
{
|
{
|
||||||
struct gui_window *gw = g;
|
browser_window_set_scale(g->bw, g->scale - 0.05, true);
|
||||||
|
|
||||||
nsgtk_window_change_scale(gw, gw->scale - 0.05);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -965,6 +948,24 @@ void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float gui_window_get_scale(struct gui_window *g)
|
||||||
|
{
|
||||||
|
return g->scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gui_window_set_scale(struct gui_window *g, float scale)
|
||||||
|
{
|
||||||
|
if (g->scale == scale)
|
||||||
|
return;
|
||||||
|
g->scale = scale;
|
||||||
|
|
||||||
|
if (g->bw->current_content != NULL)
|
||||||
|
gui_window_update_extent(g);
|
||||||
|
|
||||||
|
gtk_widget_queue_draw(GTK_WIDGET(g->drawing_area));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void gui_window_update_extent(struct gui_window *g)
|
void gui_window_update_extent(struct gui_window *g)
|
||||||
{
|
{
|
||||||
if (!g->bw->current_content)
|
if (!g->bw->current_content)
|
||||||
|
Loading…
Reference in New Issue
Block a user