[Buoh-dev] CVS commit to /cvsroot/buoh/buoh/src by carlosgc
- From: noreply at forge.novell.com (noreply forge novell com)
- Subject: [Buoh-dev] CVS commit to /cvsroot/buoh/buoh/src by carlosgc
- Date: Sun Oct 8 09:38:32 2006
CVS commit to /cvsroot/buoh/buoh/src by carlosgc
Modified Files:
buoh-view-comic.c buoh-view-comic.h buoh-view.c buoh-view.h
buoh-window.c
Log Message:
2006-10-08 Carlos Garcia Campos <carlosgc gnome org>
* data/buoh-ui.xml:
* src/buoh-view-comic.[ch]:
* src/buoh-view.[ch]:
* src/buoh-window.c:
Implement best fit and fit width zoom modes. Fit width is now the mode
by default.
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view-comic.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- /cvsroot/buoh/buoh/src/buoh-view-comic.c 2006/09/24 18:31:42 1.16
+++ /cvsroot/buoh/buoh/src/buoh-view-comic.c 2006/10/08 15:38:29 1.17
@@ -33,6 +33,7 @@
enum {
PROP_0,
PROP_COMIC,
+ PROP_ZOOM_MODE,
PROP_SCALE
};
@@ -42,6 +43,7 @@
GString *comic_data;
BuohComic *comic;
+ BuohViewZoomMode zoom_mode;
gdouble scale;
BuohComicLoader *comic_loader;
@@ -60,7 +62,7 @@
#define ZOOM_OUT_FACTOR (1.0 / ZOOM_IN_FACTOR)
#define MIN_ZOOM_SCALE 0.6
-#define MAX_ZOOM_SCALE 2
+#define MAX_ZOOM_SCALE 4
#define DATA_SIZE 61440 /* 60K */
@@ -82,6 +84,8 @@
GdkEventKey *event);
static gboolean buoh_view_comic_scroll_event (GtkWidget *widget,
GdkEventScroll *event);
+static void buoh_view_comic_size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation);
static void buoh_view_comic_drag_begin (GtkWidget *widget,
GdkDragContext *drag_context,
gpointer gdata);
@@ -101,6 +105,13 @@
static void buoh_view_comic_load_finished (BuohViewComic *c_view,
gpointer gdata);
static void buoh_view_comic_load (BuohViewComic *c_view);
+static gdouble buoh_view_comic_get_scale_for_width (BuohViewComic *c_view,
+ gint width);
+static gdouble buoh_view_comic_get_scale_for_height (BuohViewComic *c_view,
+ gint height);
+static void buoh_view_comic_zoom (BuohViewComic *c_view,
+ gdouble factor,
+ gboolean relative);
GType
buoh_view_comic_get_type (void)
@@ -134,6 +145,7 @@
c_view->priv = BUOH_VIEW_COMIC_GET_PRIVATE (c_view);
+ c_view->priv->zoom_mode = VIEW_ZOOM_FIT_WIDTH;
c_view->priv->scale = 1.0;
c_view->priv->comic_loader = buoh_comic_loader_new ();
c_view->priv->comic_data = g_string_sized_new (DATA_SIZE);
@@ -176,6 +188,7 @@
widget_class->key_press_event = buoh_view_comic_key_press_event;
widget_class->scroll_event = buoh_view_comic_scroll_event;
+ widget_class->size_allocate = buoh_view_comic_size_allocate;
parent_class = g_type_class_peek_parent (klass);
@@ -187,12 +200,20 @@
"The current comic",
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
+ PROP_ZOOM_MODE,
+ g_param_spec_enum ("zoom-mode",
+ "ZoomMode",
+ "The view zoom mode",
+ BUOH_TYPE_VIEW_ZOOM_MODE,
+ VIEW_ZOOM_FIT_WIDTH,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
PROP_SCALE,
g_param_spec_double ("scale",
"Scale",
"Current view scale",
- MIN_ZOOM_SCALE,
- MAX_ZOOM_SCALE,
+ G_MINDOUBLE,
+ G_MAXDOUBLE,
1.0,
G_PARAM_READWRITE));
@@ -254,6 +275,10 @@
c_view->priv->comic = BUOH_COMIC (g_value_get_pointer (value));
break;
+ case PROP_ZOOM_MODE:
+ c_view->priv->zoom_mode = g_value_get_enum (value);
+
+ break;
case PROP_SCALE:
c_view->priv->scale = g_value_get_double (value);
@@ -276,6 +301,10 @@
g_value_set_pointer (value, c_view->priv->comic);
break;
+ case PROP_ZOOM_MODE:
+ g_value_set_enum (value, c_view->priv->zoom_mode);
+
+ break;
case PROP_SCALE:
g_value_set_double (value, c_view->priv->scale);
@@ -362,6 +391,67 @@
return FALSE;
}
+static gboolean
+buoh_view_comic_update_zoom_cb (BuohViewComic *c_view)
+{
+ GdkPixbuf *pixbuf;
+ gdouble new_scale;
+
+ pixbuf = buoh_comic_get_pixbuf (c_view->priv->comic);
+ if (!pixbuf)
+ return FALSE;
+
+ switch (c_view->priv->zoom_mode) {
+ case VIEW_ZOOM_FREE:
+ new_scale = c_view->priv->scale;
+ break;
+ case VIEW_ZOOM_BEST_FIT: {
+ gdouble scale_width;
+ gdouble scale_height;
+
+ scale_width =
+ buoh_view_comic_get_scale_for_width (c_view,
+ gdk_pixbuf_get_width (pixbuf));
+
+ scale_height =
+ buoh_view_comic_get_scale_for_height (c_view,
+ gdk_pixbuf_get_height (pixbuf));
+
+ new_scale = MIN (scale_width, scale_height);
+ }
+ break;
+ case VIEW_ZOOM_FIT_WIDTH:
+ new_scale =
+ buoh_view_comic_get_scale_for_width (c_view,
+ gdk_pixbuf_get_width (pixbuf));
+ break;
+ default:
+ g_assert_not_reached ();
+
+ }
+
+ if (new_scale != c_view->priv->scale)
+ buoh_view_comic_zoom (c_view, new_scale, FALSE);
+
+ return FALSE;
+}
+
+static void
+buoh_view_comic_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
+{
+ BuohViewComic *c_view = BUOH_VIEW_COMIC (widget);
+ static gint id = 0;
+
+ if (c_view->priv->comic) {
+ if (id > 0)
+ g_source_remove (id);
+ id = g_idle_add ((GSourceFunc) buoh_view_comic_update_zoom_cb,
+ c_view);
+ }
+
+ GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
+}
+
GtkWidget *
buoh_view_comic_new (BuohView *view)
{
@@ -415,6 +505,33 @@
}
static void
+buoh_view_comic_size_prepared (GdkPixbufLoader *loader,
+ gint width,
+ gint height,
+ BuohViewComic *c_view)
+{
+ switch (c_view->priv->zoom_mode) {
+ case VIEW_ZOOM_BEST_FIT: {
+ gdouble scale_width;
+ gdouble scale_height;
+
+ scale_width = buoh_view_comic_get_scale_for_width (c_view, width);
+
+ scale_height = buoh_view_comic_get_scale_for_height (c_view, height);
+
+ c_view->priv->scale = MIN (scale_width, scale_height);
+ }
+ break;
+ case VIEW_ZOOM_FIT_WIDTH:
+ c_view->priv->scale =
+ buoh_view_comic_get_scale_for_width (c_view, width);
+ break;
+ default:
+ break;
+ }
+}
+
+static void
buoh_view_comic_prepare_load (BuohViewComic *c_view)
{
GtkAdjustment *hadjustment;
@@ -433,6 +550,10 @@
g_object_unref (c_view->priv->pixbuf_loader);
}
c_view->priv->pixbuf_loader = gdk_pixbuf_loader_new ();
+ g_signal_connect (G_OBJECT (c_view->priv->pixbuf_loader),
+ "size-prepared",
+ G_CALLBACK (buoh_view_comic_size_prepared),
+ (gpointer) c_view);
c_view->priv->comic_data->len = 0;
@@ -630,6 +751,41 @@
}
}
+static gdouble
+buoh_view_comic_get_scale_for_width (BuohViewComic *c_view,
+ gint width)
+{
+ GtkWidget *widget = GTK_WIDGET (c_view);
+ gdouble new_scale;
+
+ new_scale = (gdouble)(widget->allocation.width - 2 * widget->style->xthickness) /
+ (gdouble)width;
+
+ return new_scale;
+}
+
+static gdouble
+buoh_view_comic_get_scale_for_height (BuohViewComic *c_view,
+ gint height)
+{
+ GtkWidget *widget = GTK_WIDGET (c_view);
+ gdouble new_scale;
+
+ new_scale = (gdouble)(widget->allocation.height - 2 * widget->style->ythickness) /
+ (gdouble)height;
+
+ return new_scale;
+}
+
+static void
+buoh_view_comic_set_zoom_mode (BuohViewComic *c_view,
+ BuohViewZoomMode mode)
+{
+ g_object_set (G_OBJECT (c_view),
+ "zoom-mode", mode,
+ NULL);
+}
+
static void
buoh_view_comic_zoom (BuohViewComic *c_view, gdouble factor, gboolean relative)
{
@@ -644,10 +800,13 @@
else
scale = factor;
+ if (scale == c_view->priv->scale)
+ return;
+
g_object_set (G_OBJECT (c_view),
- "scale", CLAMP (scale, MIN_ZOOM_SCALE, MAX_ZOOM_SCALE),
+ "scale", scale,
NULL);
-
+
pixbuf = buoh_comic_get_pixbuf (c_view->priv->comic);
if (pixbuf) {
buoh_view_comic_set_image_from_pixbuf (c_view, pixbuf);
@@ -659,7 +818,7 @@
{
g_return_val_if_fail (BUOH_IS_VIEW_COMIC (c_view), FALSE);
- return c_view->priv->scale == MIN_ZOOM_SCALE;
+ return c_view->priv->scale <= MIN_ZOOM_SCALE;
}
gboolean
@@ -667,14 +826,14 @@
{
g_return_val_if_fail (BUOH_IS_VIEW_COMIC (c_view), FALSE);
- return c_view->priv->scale == MAX_ZOOM_SCALE;
+ return c_view->priv->scale >= MAX_ZOOM_SCALE;
}
gboolean
buoh_view_comic_is_normal_size (BuohViewComic *c_view)
{
g_return_val_if_fail (BUOH_IS_VIEW_COMIC (c_view), FALSE);
-
+
return c_view->priv->scale == 1.0;
}
@@ -682,7 +841,8 @@
buoh_view_comic_zoom_in (BuohViewComic *c_view)
{
g_return_if_fail (BUOH_IS_VIEW_COMIC (c_view));
-
+
+ buoh_view_comic_set_zoom_mode (c_view, VIEW_ZOOM_FREE);
buoh_view_comic_zoom (c_view, ZOOM_IN_FACTOR, TRUE);
}
@@ -690,7 +850,8 @@
buoh_view_comic_zoom_out (BuohViewComic *c_view)
{
g_return_if_fail (BUOH_IS_VIEW_COMIC (c_view));
-
+
+ buoh_view_comic_set_zoom_mode (c_view, VIEW_ZOOM_FREE);
buoh_view_comic_zoom (c_view, ZOOM_OUT_FACTOR, TRUE);
}
@@ -698,6 +859,33 @@
buoh_view_comic_normal_size (BuohViewComic *c_view)
{
g_return_if_fail (BUOH_IS_VIEW_COMIC (c_view));
-
+
+ buoh_view_comic_set_zoom_mode (c_view, VIEW_ZOOM_FREE);
buoh_view_comic_zoom (c_view, 1.0, FALSE);
}
+
+void
+buoh_view_comic_best_fit (BuohViewComic *c_view)
+{
+ g_return_if_fail (BUOH_IS_VIEW_COMIC (c_view));
+
+ buoh_view_comic_set_zoom_mode (c_view, VIEW_ZOOM_BEST_FIT);
+ gtk_widget_queue_resize (GTK_WIDGET (c_view));
+}
+
+void
+buoh_view_comic_fit_width (BuohViewComic *c_view)
+{
+ g_return_if_fail (BUOH_IS_VIEW_COMIC (c_view));
+
+ buoh_view_comic_set_zoom_mode (c_view, VIEW_ZOOM_FIT_WIDTH);
+ gtk_widget_queue_resize (GTK_WIDGET (c_view));
+}
+
+BuohViewZoomMode
+buoh_view_comic_get_zoom_mode (BuohViewComic *c_view)
+{
+ g_return_val_if_fail (BUOH_IS_VIEW_COMIC (c_view), 0);
+
+ return c_view->priv->zoom_mode;
+}
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view-comic.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /cvsroot/buoh/buoh/src/buoh-view-comic.h 2005/11/16 20:29:28 1.3
+++ /cvsroot/buoh/buoh/src/buoh-view-comic.h 2006/10/08 15:38:29 1.4
@@ -46,15 +46,18 @@
GtkViewportClass parent_class;
};
-GType buoh_view_comic_get_type (void) G_GNUC_CONST;
-GtkWidget *buoh_view_comic_new (BuohView *view);
+GType buoh_view_comic_get_type (void) G_GNUC_CONST;
+GtkWidget *buoh_view_comic_new (BuohView *view);
-gboolean buoh_view_comic_is_min_zoom (BuohViewComic *c_view);
-gboolean buoh_view_comic_is_max_zoom (BuohViewComic *c_view);
-gboolean buoh_view_comic_is_normal_size (BuohViewComic *c_view);
-void buoh_view_comic_zoom_in (BuohViewComic *c_view);
-void buoh_view_comic_zoom_out (BuohViewComic *c_view);
-void buoh_view_comic_normal_size (BuohViewComic *c_view);
+gboolean buoh_view_comic_is_min_zoom (BuohViewComic *c_view);
+gboolean buoh_view_comic_is_max_zoom (BuohViewComic *c_view);
+gboolean buoh_view_comic_is_normal_size (BuohViewComic *c_view);
+void buoh_view_comic_zoom_in (BuohViewComic *c_view);
+void buoh_view_comic_zoom_out (BuohViewComic *c_view);
+void buoh_view_comic_normal_size (BuohViewComic *c_view);
+void buoh_view_comic_best_fit (BuohViewComic *c_view);
+void buoh_view_comic_fit_width (BuohViewComic *c_view);
+BuohViewZoomMode buoh_view_comic_get_zoom_mode (BuohViewComic *c_view);
G_END_DECLS
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- /cvsroot/buoh/buoh/src/buoh-view.c 2006/09/25 18:18:33 1.13
+++ /cvsroot/buoh/buoh/src/buoh-view.c 2006/10/08 15:38:29 1.14
@@ -122,6 +122,25 @@
return etype;
}
+GType
+buoh_view_zoom_mode_get_type (void)
+{
+ static GType etype = 0;
+
+ if (etype == 0) {
+ static const GEnumValue values[] = {
+ { VIEW_ZOOM_FREE, "VIEW_ZOOM_FREE", "free" },
+ { VIEW_ZOOM_BEST_FIT, "VIEW_ZOOM_BEST_FIT", "best-fit" },
+ { VIEW_ZOOM_FIT_WIDTH, "VIEW_ZOOM_FIT_WIDTH", "fit-width" },
+ { 0, NULL, NULL }
+ };
+
+ etype = g_enum_register_static ("BuohViewZoomMode", values);
+ }
+
+ return etype;
+}
+
static void
buoh_view_init (BuohView *buoh_view)
{
@@ -383,6 +402,30 @@
buoh_view_comic_normal_size (BUOH_VIEW_COMIC (view->priv->comic));
}
+void
+buoh_view_zoom_best_fit (BuohView *view)
+{
+ g_return_if_fail (BUOH_IS_VIEW (view));
+
+ buoh_view_comic_best_fit (BUOH_VIEW_COMIC (view->priv->comic));
+}
+
+void
+buoh_view_zoom_fit_width (BuohView *view)
+{
+ g_return_if_fail (BUOH_IS_VIEW (view));
+
+ buoh_view_comic_fit_width (BUOH_VIEW_COMIC (view->priv->comic));
+}
+
+BuohViewZoomMode
+buoh_view_get_zoom_mode (BuohView *view)
+{
+ g_return_val_if_fail (BUOH_IS_VIEW (view), 0);
+
+ return buoh_view_comic_get_zoom_mode (BUOH_VIEW_COMIC (view->priv->comic));
+}
+
BuohViewStatus
buoh_view_get_status (BuohView *view)
{
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- /cvsroot/buoh/buoh/src/buoh-view.h 2005/11/16 20:29:28 1.8
+++ /cvsroot/buoh/buoh/src/buoh-view.h 2006/10/08 15:38:29 1.9
@@ -38,6 +38,7 @@
#define BUOH_VIEW_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), BUOH_TYPE_VIEW, BuohViewClass))
#define BUOH_TYPE_VIEW_STATUS (buoh_view_status_get_type ())
+#define BUOH_TYPE_VIEW_ZOOM_MODE (buoh_view_zoom_mode_get_type ())
typedef enum {
STATE_MESSAGE_WELCOME,
@@ -47,6 +48,12 @@
STATE_EMPTY
} BuohViewStatus;
+typedef enum {
+ VIEW_ZOOM_FREE,
+ VIEW_ZOOM_BEST_FIT,
+ VIEW_ZOOM_FIT_WIDTH
+} BuohViewZoomMode;
+
struct _BuohView {
GtkNotebook parent;
BuohViewPrivate *priv;
@@ -60,21 +67,29 @@
GType buoh_view_get_type (void) G_GNUC_CONST;
GType buoh_view_status_get_type (void) G_GNUC_CONST;
+GType buoh_view_zoom_mode_get_type (void) G_GNUC_CONST;
GtkWidget *buoh_view_new (void);
+/* Zoom */
gboolean buoh_view_is_min_zoom (BuohView *view);
gboolean buoh_view_is_max_zoom (BuohView *view);
gboolean buoh_view_is_normal_size (BuohView *view);
void buoh_view_zoom_in (BuohView *view);
void buoh_view_zoom_out (BuohView *view);
void buoh_view_zoom_normal_size (BuohView *view);
+void buoh_view_zoom_best_fit (BuohView *view);
+void buoh_view_zoom_fit_width (BuohView *view);
+BuohViewZoomMode buoh_view_get_zoom_mode (BuohView *view);
+/* Status */
BuohViewStatus buoh_view_get_status (BuohView *view);
+/* Comic */
void buoh_view_set_comic (BuohView *view,
const BuohComic *comic);
BuohComic *buoh_view_get_comic (BuohView *view);
+/* Message */
void buoh_view_set_message_title (BuohView *view,
const gchar *title);
void buoh_view_set_message_text (BuohView *view,
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-window.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- /cvsroot/buoh/buoh/src/buoh-window.c 2006/09/25 18:18:33 1.33
+++ /cvsroot/buoh/buoh/src/buoh-window.c 2006/10/08 15:38:29 1.34
@@ -133,6 +133,10 @@
gpointer gdata);
static void buoh_window_cmd_view_zoom_normal (GtkAction *action,
gpointer gdata);
+static void buoh_window_cmd_view_zoom_best_fit (GtkAction *action,
+ gpointer gdata);
+static void buoh_window_cmd_view_zoom_fit_width (GtkAction *action,
+ gpointer gdata);
static void buoh_window_cmd_go_previous (GtkAction *action,
gpointer gdata);
static void buoh_window_cmd_go_next (GtkAction *action,
@@ -147,6 +151,7 @@
gpointer gdata);
static void buoh_window_update_title (BuohWindow *window);
+static void buoh_window_update_zoom_mode (BuohWindow *window);
static const GtkActionEntry menu_entries[] = {
@@ -218,7 +223,13 @@
G_CALLBACK (buoh_window_cmd_view_toolbar), TRUE },
{ "ViewStatusbar", NULL, N_("St_atusbar"), NULL,
N_("Changes the visibility of the statusbar"),
- G_CALLBACK (buoh_window_cmd_view_statusbar), TRUE }
+ G_CALLBACK (buoh_window_cmd_view_statusbar), TRUE },
+ { "ViewZoomBestFit", GTK_STOCK_ZOOM_FIT, N_("_Best Fit"), NULL,
+ N_("Make the current comic fill the window"),
+ G_CALLBACK (buoh_window_cmd_view_zoom_best_fit) },
+ { "ViewZoomFitWidth", GTK_STOCK_ZOOM_FIT, N_("Fit Comic _Width"), NULL,
+ N_("Make the current comic fill the window width"),
+ G_CALLBACK (buoh_window_cmd_view_zoom_fit_width) }
};
GType
@@ -401,6 +412,7 @@
buoh_window_comic_actions_set_sensitive (buoh_window, FALSE);
buoh_window_comic_save_to_disk_set_sensitive (buoh_window, FALSE);
buoh_window_set_sensitive (buoh_window, "ComicRemove", FALSE);
+ buoh_window_update_zoom_mode (buoh_window);
gtk_widget_grab_focus (GTK_WIDGET (buoh_window->priv->view));
@@ -741,6 +753,26 @@
}
static void
+buoh_window_cmd_view_zoom_best_fit (GtkAction *action, gpointer gdata)
+{
+ BuohWindow *window = BUOH_WINDOW (gdata);
+
+ buoh_view_zoom_best_fit (window->priv->view);
+}
+
+static void
+buoh_window_cmd_view_zoom_fit_width (GtkAction *action, gpointer gdata)
+{
+ BuohWindow *window = BUOH_WINDOW (gdata);
+
+ if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
+ buoh_view_zoom_fit_width (window->priv->view);
+ } else {
+ buoh_view_zoom_normal_size (window->priv->view);
+ }
+}
+
+static void
buoh_window_cmd_go_previous (GtkAction *action, gpointer gdata)
{
BuohWindow *window = BUOH_WINDOW (gdata);
@@ -880,7 +912,7 @@
buoh_window_comic_browsing_actions_set_sensitive (window, sensitive);
buoh_window_set_sensitive (window, "ComicProperties", sensitive);
- buoh_window_set_sensitive (window, "ComicCopyURI", sensitive);
+ buoh_window_set_sensitive (window, "ComicCopyURI", sensitive);
buoh_window_set_sensitive (window, "ViewZoomIn",
buoh_view_is_max_zoom (window->priv->view) ?
FALSE : sensitive);
@@ -890,6 +922,8 @@
buoh_window_set_sensitive (window, "ViewZoomNormal",
buoh_view_is_normal_size (window->priv->view) ?
FALSE : sensitive);
+ buoh_window_set_sensitive (window, "ViewZoomBestFit", sensitive);
+ buoh_window_set_sensitive (window, "ViewZoomFitWidth", sensitive);
}
static void
@@ -1026,6 +1060,33 @@
}
static void
+buoh_window_update_zoom_mode (BuohWindow *window)
+{
+ BuohViewZoomMode zoom_mode;
+ GtkAction *action;
+
+ zoom_mode = buoh_view_get_zoom_mode (window->priv->view);
+
+ action = gtk_action_group_get_action (window->priv->action_group,
+ "ViewZoomBestFit");
+ g_signal_handlers_block_by_func
+ (action, G_CALLBACK (buoh_window_cmd_view_zoom_best_fit), window);
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
+ zoom_mode == VIEW_ZOOM_BEST_FIT);
+ g_signal_handlers_unblock_by_func
+ (action, G_CALLBACK (buoh_window_cmd_view_zoom_best_fit), window);
+
+ action = gtk_action_group_get_action (window->priv->action_group,
+ "ViewZoomFitWidth");
+ g_signal_handlers_block_by_func
+ (action, G_CALLBACK (buoh_window_cmd_view_zoom_fit_width), window);
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
+ zoom_mode == VIEW_ZOOM_FIT_WIDTH);
+ g_signal_handlers_unblock_by_func
+ (action, G_CALLBACK (buoh_window_cmd_view_zoom_fit_width), window);
+}
+
+static void
buoh_window_view_zoom_change_cb (BuohView *view, gpointer gdata)
{
BuohWindow *window = BUOH_WINDOW (gdata);
@@ -1037,6 +1098,8 @@
buoh_window_set_sensitive (window, "ViewZoomNormal",
!buoh_view_is_normal_size (window->priv->view));
+ buoh_window_update_zoom_mode (window);
+
gtk_widget_grab_focus (GTK_WIDGET (view));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]