Skip to content

Commit

Permalink
Some small portrait iPhone fixups.
Browse files Browse the repository at this point in the history
Made launch image a dynamicly resizing screen (was always horizontal, and fixed PNGs before).
Fixed up full-screep portrait AuxWindows on iPhone with safe/inset areas.
  • Loading branch information
wcjohns committed Aug 16, 2024
1 parent 249eb3c commit cbcbd3f
Show file tree
Hide file tree
Showing 48 changed files with 174 additions and 370 deletions.
47 changes: 33 additions & 14 deletions InterSpec_resources/DbFileBrowser.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,49 @@
display: inline;
}


.DbSpecFileItem
{
.DbSpecFileItem {
padding-left: 5px;
padding-right: 3px;
padding-top: 3px;
margin-bottom: 7px;
width: 95%;
height: 1.8em;
border:1px solid #e1e1e1;
}


.DbSpecFileItemTxt
{
font-size:100%;
font-family:"Times New Roman", Times, serif;
position:absolute;
/* Styles for screens with a width of 480px or less */
@media (max-width: 480px) {
.DbSpecFileItem
{
display: flex;
flex-direction: column;
align-items: center;
padding: 4px;
border-radius: 5px;
}

.DbSpecFileItemTxt
{
}

.DbSpecFileItemButton
{
}
}

/* Styles for screens with a width greater than 480px */
@media (min-width: 481px) {
.DbSpecFileItemTxt
{
position:absolute;
}

.DbSpecFileItemButton
{
float: right;
}
}


.DbSpecFileItemButton
{
float: right;
@media screen and (max-device-width: 480px) {
}

.ResumeWorkTxt
Expand Down
31 changes: 27 additions & 4 deletions InterSpec_resources/InterSpecSafeArea.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ I *think* this CSS file could be safely loaded for all browsers, but currently o
left: max( calc(0.5*env(safe-area-inset-left)), 5px );
}

.Portrait .PhoneFullScreenDialog {
padding-top: max( calc(env(safe-area-inset-top) - 8px), 0px);
margin-bottom: max( calc(env(safe-area-inset-bottom) - 8px), 0px);
}

.Portrait .Wt-tabs li {
font-size: x-small;
Expand Down Expand Up @@ -92,8 +88,35 @@ ul.PopupDivMenuPhone > li:last-of-type
padding-bottom: max( calc(env(safe-area-inset-bottom) - 8px), 0px);
}

.Portrait .PhoneFullScreenDialog {
/* Correct for the potential notch at top of screen. */
padding-top: max( calc(env(safe-area-inset-top) - 8px), 0px);

/* Padding of the outer dialog div doesnt seem to be taken into account by
wt-3.7.1/src/js/WDialog.js:layoutResize(...)/wtResize(...), so setting bottom
padding doesnt seem to produce the desired effect - and in fact, the dialog
contents will be taller than it should be, by the amount of top padding we
add here. We'll make-up for this, in a questionable way, by setting the
bottom-padding of the dialog contents, to be the sum of top and bottom insets.
*/
/* padding-bottom: max( calc(env(safe-area-inset-bottom) - 8px), 0px); */
}


.Portrait .PhoneFullScreenDialog .AuxWindow-content.MobileFullScreen {
/* Make up for apparent padding not accounted for in WDialog out div, and make sure full
contents of dialog can be seen. (note: dialog body is is inset top+bottom too long, so this
margin-area will not actually be seen on the screen; not the best, but it works)
*/
margin-bottom: calc( max(env(safe-area-inset-bottom) - 8px, 0px) + max(env(safe-area-inset-bottom) - 8px, 0px) );
}

.LandscapeLeft .PeakInfoDisplayButtonDiv, .LandscapeRight .PeakInfoDisplayButtonDiv {
margin-bottom: 2px;
}

.Portrait #qtip-growl-container.qtipDiv:not(.belowMenu) {
top: max( calc(env(safe-area-inset-top) - 8px), 0px);
}

/* End styling for iPhoneX* phones with a notch */
2 changes: 1 addition & 1 deletion src/DbFileBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class DbSpecFileItem : public WContainerWidget

addStyleClass( "DbSpecFileItem" );

string msg = "Uploaded: " + dbentry->uploadTime.toString( DATE_TIME_FORMAT_STR ).toUTF8();
string msg = "Loaded: " + dbentry->uploadTime.toString( DATE_TIME_FORMAT_STR ).toUTF8();
if( dbentry->userHasModified )
msg += ", was modified";

Expand Down
2 changes: 1 addition & 1 deletion src/DoseCalcWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ DoseCalcWindow::DoseCalcWindow( MaterialDB *materialDB,
show();

// If we are loading this widget, as we are creating the InterSpec session,
// the screen width and height wont be avaiable, so we'll just assume its
// the screen width and height wont be available, so we'll just assume its
// big enough, which it should be.
const int screenW = viewer->renderedWidth();
const int screenH = viewer->renderedHeight();
Expand Down
6 changes: 6 additions & 0 deletions target/ios/InterSpec/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "SNL_Stacked_Black_Blue.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "InterSpec_multipeak_no_background.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions target/ios/InterSpec/InterSpec.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
3D4D11B718F85F550043773C /* data in Resources */ = {isa = PBXBuildFile; fileRef = 3D4D11B618F85F550043773C /* data */; };
3D4D11B918F85F610043773C /* example_spectra in Resources */ = {isa = PBXBuildFile; fileRef = 3D4D11B818F85F610043773C /* example_spectra */; };
3D4D11BB18F85F720043773C /* InterSpec_resources in Resources */ = {isa = PBXBuildFile; fileRef = 3D4D11BA18F85F720043773C /* InterSpec_resources */; };
881EB8F719CCBC06000AB0DF /* LoadScreenImages.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 881EB8F619CCBC06000AB0DF /* LoadScreenImages.xcassets */; };
9B026CE018075B1D00314635 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B026CDF18075B1D00314635 /* UIKit.framework */; };
9B026CE218075B1D00314635 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B026CE118075B1D00314635 /* Foundation.framework */; };
9B026CE418075B1D00314635 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B026CE318075B1D00314635 /* CoreGraphics.framework */; };
Expand All @@ -20,13 +19,14 @@
9B026CF918075B1D00314635 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9B026CF818075B1D00314635 /* ViewController.mm */; };
9B20B8E32251881900E56E93 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B20B8E22251881900E56E93 /* WebKit.framework */; };
9B6A620B28B1361300443442 /* WtsRsrcs in Resources */ = {isa = PBXBuildFile; fileRef = 9B6A620A28B1361300443442 /* WtsRsrcs */; };
9BB621D02C6FD6ED004E7388 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9BB621CF2C6FD6ED004E7388 /* Launch Screen.storyboard */; };
9BB621D42C6FE3BD004E7388 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9BB621D32C6FE3BD004E7388 /* Assets.xcassets */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
3D4D11B618F85F550043773C /* data */ = {isa = PBXFileReference; lastKnownFileType = folder; name = data; path = ../../../data; sourceTree = SOURCE_ROOT; };
3D4D11B818F85F610043773C /* example_spectra */ = {isa = PBXFileReference; lastKnownFileType = folder; name = example_spectra; path = ../../../example_spectra; sourceTree = SOURCE_ROOT; };
3D4D11BA18F85F720043773C /* InterSpec_resources */ = {isa = PBXFileReference; lastKnownFileType = folder; name = InterSpec_resources; path = ../../../InterSpec_resources; sourceTree = SOURCE_ROOT; };
881EB8F619CCBC06000AB0DF /* LoadScreenImages.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = LoadScreenImages.xcassets; sourceTree = "<group>"; };
9B026CDC18075B1D00314635 /* InterSpec.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = InterSpec.app; sourceTree = BUILT_PRODUCTS_DIR; };
9B026CDF18075B1D00314635 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
9B026CE118075B1D00314635 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
Expand All @@ -43,6 +43,8 @@
9B6A620A28B1361300443442 /* WtsRsrcs */ = {isa = PBXFileReference; lastKnownFileType = folder; name = WtsRsrcs; path = "build-iphoneos/WtsRsrcs"; sourceTree = "<group>"; };
9B6A620C28B139B400443442 /* libInterSpecAppLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libInterSpecAppLib.a; path = "build-iphoneos/libInterSpecAppLib.a"; sourceTree = "<group>"; };
9B6A620E28B139BC00443442 /* InterSpec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = InterSpec.a; path = "build-iphoneos/LibInterSpec/InterSpec.a"; sourceTree = "<group>"; };
9BB621CF2C6FD6ED004E7388 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "Launch Screen.storyboard"; path = "InterSpec/Launch Screen.storyboard"; sourceTree = "<group>"; };
9BB621D32C6FE3BD004E7388 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -63,6 +65,8 @@
9B026CD318075B1D00314635 = {
isa = PBXGroup;
children = (
9BB621D32C6FE3BD004E7388 /* Assets.xcassets */,
9BB621CF2C6FD6ED004E7388 /* Launch Screen.storyboard */,
9B6A620A28B1361300443442 /* WtsRsrcs */,
3D4D11BA18F85F720043773C /* InterSpec_resources */,
3D4D11B818F85F610043773C /* example_spectra */,
Expand Down Expand Up @@ -101,7 +105,6 @@
9B026CEF18075B1D00314635 /* AppDelegate.mm */,
9B026CF718075B1D00314635 /* ViewController.h */,
9B026CF818075B1D00314635 /* ViewController.mm */,
881EB8F619CCBC06000AB0DF /* LoadScreenImages.xcassets */,
9B026CE618075B1D00314635 /* Supporting Files */,
);
path = InterSpec;
Expand Down Expand Up @@ -182,11 +185,12 @@
buildActionMask = 2147483647;
files = (
3D4D11B918F85F610043773C /* example_spectra in Resources */,
881EB8F719CCBC06000AB0DF /* LoadScreenImages.xcassets in Resources */,
9B026CEA18075B1D00314635 /* InfoPlist.strings in Resources */,
3D4D11B718F85F550043773C /* data in Resources */,
3D4D11BB18F85F720043773C /* InterSpec_resources in Resources */,
9B6A620B28B1361300443442 /* WtsRsrcs in Resources */,
9BB621D42C6FE3BD004E7388 /* Assets.xcassets in Resources */,
9BB621D02C6FD6ED004E7388 /* Launch Screen.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -338,13 +342,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_CXX_LIBRARY = "libc++";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 21;
DEVELOPMENT_TEAM = G2VV85LMR5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "InterSpec/InterSpec-Prefix.pch";
Expand Down Expand Up @@ -441,13 +446,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_CXX_LIBRARY = "libc++";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 21;
DEVELOPMENT_TEAM = G2VV85LMR5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "InterSpec/InterSpec-Prefix.pch";
Expand Down
6 changes: 4 additions & 2 deletions target/ios/InterSpec/InterSpec/InterSpec-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>Launch Screen.storyboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
Expand All @@ -76,9 +78,9 @@
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
Expand Down
48 changes: 48 additions & 0 deletions target/ios/InterSpec/InterSpec/Launch Screen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright © 2024 Sandia National Laboratories. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<rect key="frame" x="0.0" y="626.5" width="375" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="InterSpec" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
<constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" constant="20" symbolic="YES" id="SfN-ll-jLj"/>
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" constant="20" symbolic="YES" id="x7j-FC-K8j"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
Loading

0 comments on commit cbcbd3f

Please sign in to comment.