Revision: 7130
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7130&view=rev
Author:   hofman
Date:     2011-02-26 12:04:07 +0000 (Sat, 26 Feb 2011)

Log Message:
-----------
simplify interaction mode switching

Modified Paths:
--------------
    trunk/SKApplication.m

Modified: trunk/SKApplication.m
===================================================================
--- trunk/SKApplication.m       2011-02-25 12:41:53 UTC (rev 7129)
+++ trunk/SKApplication.m       2011-02-26 12:04:07 UTC (rev 7130)
@@ -83,25 +83,14 @@
 }
 
 - (void)updatePresentationOptionsForWindow:(NSWindow *)aWindow {
-    SystemUIMode currentMode, mode;
-    SystemUIOptions currentOptions, options;
+    const static SystemUIMode modes[3] = {kUIModeNormal, kUIModeAllHidden, 
kUIModeAllHidden};
+    const static SystemUIOptions options[3] = {0, kUIOptionAutoShowMenuBar, 
kUIOptionDisableProcessSwitch};
+    SystemUIMode currentMode;
+    SystemUIOptions currentOptions;
     GetSystemUIMode(&currentMode, &currentOptions);
-    switch ([[[aWindow windowController] document] systemInteractionMode]) {
-        case SKPresentationMode:
-            mode = kUIModeAllHidden;
-            options = kUIOptionDisableProcessSwitch;
-            break;
-        case SKFullScreenMode:
-            mode = kUIModeAllHidden;
-            options = kUIOptionAutoShowMenuBar;
-            break;
-        default:
-            mode = kUIModeNormal;
-            options = 0;
-            break;
-    }
-    if (mode != currentMode || options != currentOptions)
-        SetSystemUIMode(mode, options);
+    SKInteractionMode mode = [[[aWindow windowController] document] 
systemInteractionMode];
+    if (currentMode != modes[mode] || currentOptions != options[mode])
+        SetSystemUIMode(modes[mode], options[mode]);
 }
 
 - (void)reorganizeWindowsItem:(NSWindow *)aWindow {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to