#UI_ENHANCEMENT
authorClaus Gittinger <cg@exept.de>
Thu, 03 Mar 2016 10:16:29 +0100
changeset 7178 7963dc6ec798
parent 7176 047e717102d3
child 7179 cedcbd5de0a9
#UI_ENHANCEMENT class: SimpleView changed: #setDefaultStyle
SimpleView.st
--- a/SimpleView.st	Wed Mar 02 14:26:41 2016 +0100
+++ b/SimpleView.st	Thu Mar 03 10:16:29 2016 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -1239,23 +1241,35 @@
 !
 
 setDefaultStyle
-    |defStyle sysInfo|
-
-    DefaultStyle isNil ifTrue:[
-	defStyle := OperatingSystem getEnvironment:'STX_VIEWSTYLE'.
-	defStyle notNil ifTrue:[
-	    DefaultStyle := defStyle asSymbol.
-	] ifFalse:[
-	    "/ use XP for both linux and older windows systems;
-	    DefaultStyle := ViewStyle msWindowsXP.
-
-	    OperatingSystem isMSWINDOWSlike ifTrue:[
-		"/ use Vista for vista systems;
-		OperatingSystem isVistaLike ifTrue:[
-		    DefaultStyle := ViewStyle msWindowsVista
-		].
-	    ].
-	].
+    "set a default style as appropriate for the underlying system.
+     This is used if no setting is coming from a startup file or a preferences,
+     i.e. for standalone apps (with no .rc file)"
+
+    |defStyle|
+
+    true "DefaultStyle isNil" ifTrue:[
+        defStyle := OperatingSystem getEnvironment:'STX_VIEWSTYLE'.
+        defStyle notNil ifTrue:[
+            DefaultStyle := defStyle asSymbol.
+        ] ifFalse:[
+            "/ use XP for both linux and older windows systems;
+            DefaultStyle := ViewStyle msWindowsXP.
+
+            OperatingSystem isMSWINDOWSlike ifTrue:[
+                "/ use Vista for vista and newer systems;
+                OperatingSystem isVistaLike ifTrue:[
+                    DefaultStyle := ViewStyle msWindowsVista.
+                    OperatingSystem isWin8Like ifTrue:[
+                        "/ use win8 for 8 and newer systems;
+                        DefaultStyle := ViewStyle msWindows8
+                    ].
+                ].
+            ] ifFalse:[
+                OperatingSystem isOSXlike ifTrue:[
+                    DefaultStyle := #macosx
+                ].
+            ].
+        ].
     ].
 
     "Modified: / 03-02-2011 / 21:41:35 / cg"