[geary/wip/765516-gtk-widget-conversation-viewer: 108/207] Re-enable message view zoom.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/765516-gtk-widget-conversation-viewer: 108/207] Re-enable message view zoom.
- Date: Tue, 4 Oct 2016 00:05:29 +0000 (UTC)
commit f7f350c235bc628897a73c7953fb845728c43a3d
Author: Michael James Gratton <mike vee net>
Date: Sun Jul 10 21:56:55 2016 +1000
Re-enable message view zoom.
src/client/application/geary-controller.vala | 12 ++++----
.../conversation-viewer/conversation-viewer.vala | 30 ++++++++++++++++++++
2 files changed, 36 insertions(+), 6 deletions(-)
---
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index 00fda2d..f0aa50c 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -2604,23 +2604,23 @@ public class GearyController : Geary.BaseObject {
debug("Unable to revoke operation: %s", err.message);
}
}
-
+
private void on_zoom_in() {
- //main_window.conversation_viewer.web_view.zoom_in();
+ this.main_window.conversation_viewer.zoom_in();
}
private void on_zoom_out() {
- //main_window.conversation_viewer.web_view.zoom_out();
+ this.main_window.conversation_viewer.zoom_out();
}
private void on_zoom_normal() {
- //main_window.conversation_viewer.web_view.zoom_level = 1.0f;
+ this.main_window.conversation_viewer.zoom_reset();
}
-
+
private void on_search() {
main_window.search_bar.give_search_focus();
}
-
+
private void on_conversation_list() {
main_window.conversation_list_view.grab_focus();
}
diff --git a/src/client/conversation-viewer/conversation-viewer.vala
b/src/client/conversation-viewer/conversation-viewer.vala
index b6e7df8..427b760 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -312,6 +312,36 @@ public class ConversationViewer : Gtk.Stack {
}
/**
+ * Increases the magnification level used for displaying messages.
+ */
+ public void zoom_in() {
+ message_view_iterator().foreach((msg_view) => {
+ msg_view.web_view.zoom_in();
+ return true;
+ });
+ }
+
+ /**
+ * Decreases the magnification level used for displaying messages.
+ */
+ public void zoom_out() {
+ message_view_iterator().foreach((msg_view) => {
+ msg_view.web_view.zoom_out();
+ return true;
+ });
+ }
+
+ /**
+ * Resets magnification level used for displaying messages to the default.
+ */
+ public void zoom_reset() {
+ message_view_iterator().foreach((msg_view) => {
+ msg_view.web_view.zoom_level = 1.0f;
+ return true;
+ });
+ }
+
+ /**
* Sets the currently visible page of the stack.
*/
private new void set_visible_child(Gtk.Widget widget) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]