[Xfce4-commits] <postler:master> Implement Fullscreen view of a single message

Christian Dywan noreply at xfce.org
Tue Jul 13 00:54:06 CEST 2010


Updating branch refs/heads/master
         to d69f33f062cdde0012c254152ff6c7dff9574ddc (commit)
       from 184fa4d69a7ff2b8d7835503a2b82e8ee81bed76 (commit)

commit d69f33f062cdde0012c254152ff6c7dff9574ddc
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Jul 4 22:42:12 2010 +0200

    Implement Fullscreen view of a single message

 postler/postler-bureau.vala |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index 40b026d..65ab73a 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -46,6 +46,7 @@ public class Postler.Bureau : Gtk.Window {
                 <menu action="Edit">
                     <menuitem action="HideRead"/>
                     <separator/>
+                    <menuitem action="Fullscreen"/>
                     <menuitem action="ViewSource"/>
                     <separator/>
                     <menuitem action="Search"/>
@@ -74,6 +75,7 @@ public class Postler.Bureau : Gtk.Window {
                     <menu action="View">
                         <menuitem action="HideRead"/>
                         <separator/>
+                        <menuitem action="Fullscreen"/>
                         <menuitem action="ViewSource"/>
                     </menu>
                 </toolitem>
@@ -252,6 +254,24 @@ public class Postler.Bureau : Gtk.Window {
         folders.populate ();
     }
 
+    void action_fullscreen () {
+        if ((window.get_state () & Gdk.WindowState.FULLSCREEN) == 0) {
+            toolbar.hide ();
+            ((Gtk.Paned)(folders.parent.parent)).set_position (0);
+            ((Gtk.Paned)(messages.parent.parent.parent)).set_position (0);
+            fullscreen ();
+        } else {
+            toolbar.show ();
+            int width, height;
+            get_size (out width, out height);
+            width = (int)((double)width / 4);
+            height = (int)((double)height / 3);
+            ((Gtk.Paned)(folders.parent.parent)).set_position (width);
+            ((Gtk.Paned)(messages.parent.parent.parent)).set_position (height);
+            unfullscreen ();
+        }
+    }
+
     void action_view_source () {
         Postler.App.spawn_module ("source", content.last_location);
     }
@@ -309,6 +329,8 @@ public class Postler.Bureau : Gtk.Window {
           N_("Search the selected folder"), action_search },
         { "SaveSearch", null, N_("Save Search"), "<Ctrl><Shift>s",
           N_("Save the current search"), action_save_search },
+        { "Fullscreen", Gtk.STOCK_FULLSCREEN, null, "F11",
+          N_("View the message in fullscreen"), action_fullscreen },
         { "ViewSource", null, N_("View _Source"), "<Ctrl><Alt>u",
           N_("View the source of the message"), action_view_source },
         { "Preferences", Gtk.STOCK_PREFERENCES, null, "<Ctrl><Alt>p",
@@ -517,6 +539,7 @@ public class Postler.Bureau : Gtk.Window {
 
         folders.set_headers_visible (false);
         messages.set_headers_visible (false);
+        vpaned.set_position ((int)(monitor.height / 1.7 / 3));
         hpaned.set_position ((int)(window_width / 4));
 
         folders.messages = messages;



More information about the Xfce4-commits mailing list