Skip to content

Commit

Permalink
added in login window height/width min value of 100
Browse files Browse the repository at this point in the history
  • Loading branch information
twocanoes committed Feb 23, 2023
1 parent 18e974e commit 6090d5e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Profile Manifest/com.twocanoes.xcreds.plist
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ A profile can consist of payloads with different version numbers. For example, c
</dict>
<dict>
<key>pfm_description</key>
<string>Login Window webview width (Integer). If this is not defined, it will be full width.</string>
<string>Login Window webview width (Integer). If this is not defined, it will be full width. Minimum value of 100.</string>
<key>pfm_documentation_url</key>
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#loginwindowwidth</string>
<key>pfm_name</key>
Expand All @@ -250,7 +250,7 @@ A profile can consist of payloads with different version numbers. For example, c
</dict>
<dict>
<key>pfm_description</key>
<string>Login Window webview height (Integer). If this is not defined, it will be full height.</string>
<string>Login Window webview height (Integer). If this is not defined, it will be full height. Minimum value of 100.</string>
<key>pfm_documentation_url</key>
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#loginwindowheight</string>
<key>pfm_name</key>
Expand Down
10 changes: 8 additions & 2 deletions XCredsLoginPlugIn/LoginWindow/LoginWebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,16 @@ class LoginWebViewController: WebViewController {

//if prefs define smaller, then resize window
if UserDefaults.standard.object(forKey: PrefKeys.loginWindowWidth.rawValue) != nil {
loginWindowWidth = CGFloat(UserDefaults.standard.float(forKey: PrefKeys.loginWindowWidth.rawValue))
let val = CGFloat(UserDefaults.standard.float(forKey: PrefKeys.loginWindowWidth.rawValue))
if val > 100 {
loginWindowWidth = val
}
}
if UserDefaults.standard.object(forKey: PrefKeys.loginWindowHeight.rawValue) != nil {
loginWindowHeight = CGFloat(UserDefaults.standard.float(forKey: PrefKeys.loginWindowHeight.rawValue))
let val = CGFloat(UserDefaults.standard.float(forKey: PrefKeys.loginWindowHeight.rawValue))
if val > 100 {
loginWindowHeight = val
}
}

self.window?.setFrame(screenRect, display: true, animate: false)
Expand Down
12 changes: 6 additions & 6 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3400;
CURRENT_PROJECT_VERSION = 3401;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -934,7 +934,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3400;
CURRENT_PROJECT_VERSION = 3401;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -995,7 +995,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3400;
CURRENT_PROJECT_VERSION = 3401;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -1027,7 +1027,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3400;
CURRENT_PROJECT_VERSION = 3401;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -1172,7 +1172,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3400;
CURRENT_PROJECT_VERSION = 3401;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -1203,7 +1203,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3400;
CURRENT_PROJECT_VERSION = 3401;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down
Binary file not shown.

0 comments on commit 6090d5e

Please sign in to comment.