mirror of
https://github.com/HackPlan/quark-shell-mac.git
synced 2026-01-13 07:01:18 +08:00
setAutoStart and fix borderView
This commit is contained in:
@@ -232,7 +232,12 @@ static const NSInteger kPreferencesDefaultHeight = 192;
|
||||
|
||||
- (void)setLaunchAtLogin:(NSArray *)args
|
||||
{
|
||||
BOOL launchAtLogin = args[0];
|
||||
BOOL launchAtLogin;
|
||||
if ([args[0] isEqual: @"true"]){
|
||||
launchAtLogin = true;
|
||||
}else{
|
||||
launchAtLogin = false;
|
||||
}
|
||||
|
||||
StartAtLoginController *loginController = [[StartAtLoginController alloc] initWithIdentifier:@"com.hackplan.quark-shell-helper"];
|
||||
loginController.startAtLogin = launchAtLogin;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#import "QSHWindowBorderView.h"
|
||||
|
||||
static const CGFloat marginTop = -5;
|
||||
static const CGFloat marginTop = 5;
|
||||
static const CGFloat roundedRectangleCornerRadius = 5;
|
||||
static const CGFloat arrowHeight = 10;
|
||||
static const CGFloat arrowWidth = 20;
|
||||
@@ -25,14 +25,14 @@ static const CGFloat arrowWidth = 20;
|
||||
|
||||
- (NSRect)innerFrame
|
||||
{
|
||||
return NSMakeRect(0, marginTop, NSWidth(self.bounds), NSHeight(self.bounds) - arrowHeight);
|
||||
return NSMakeRect(0, 0, NSWidth(self.bounds), NSHeight(self.bounds) - arrowHeight - marginTop);
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)dirtyRect
|
||||
{
|
||||
[super drawRect:dirtyRect];
|
||||
|
||||
NSRect roundedRectangleRect = NSMakeRect(0, marginTop, NSWidth(self.bounds), NSHeight(self.bounds) - arrowHeight);
|
||||
|
||||
NSRect roundedRectangleRect = NSMakeRect(0, 0, NSWidth(self.bounds), NSHeight(self.bounds) - arrowHeight - marginTop);
|
||||
NSRect roundedRectangleInnerRect = NSInsetRect(roundedRectangleRect, roundedRectangleCornerRadius, roundedRectangleCornerRadius);
|
||||
NSBezierPath *roundedRectanglePath = [NSBezierPath bezierPath];
|
||||
[roundedRectanglePath appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(roundedRectangleInnerRect), NSMinY(roundedRectangleInnerRect)) radius: roundedRectangleCornerRadius startAngle:180 endAngle:270];
|
||||
|
||||
@@ -53,7 +53,7 @@ function setupQuarkWithBridge(bridge) {
|
||||
|
||||
window.quark.setLaunchAtLogin = function (shouldLaunchAtLogin) {
|
||||
shouldLaunchAtLogin = !!shouldLaunchAtLogin
|
||||
bridge.callHandler('quark', {'method': 'setLaunchAtLogin', 'args': [shouldLaunchAtLogin]})
|
||||
bridge.callHandler('quark', {'method': 'setLaunchAtLogin', 'args': [shouldLaunchAtLogin.toString()]})
|
||||
}
|
||||
|
||||
window.quark.emit = function (options) {
|
||||
|
||||
@@ -95,6 +95,9 @@
|
||||
<button onclick="showPrompt()">Prompt</button>
|
||||
<button onclick="quark.quit()">Quit</button>
|
||||
</p>
|
||||
<p>
|
||||
<button onclick="setupPref()">Set Pref</button>
|
||||
</p>
|
||||
</div>
|
||||
<canvas id="icon"></canvas>
|
||||
<canvas id="highlighted-icon"></canvas>
|
||||
|
||||
@@ -150,6 +150,10 @@ function showPrompt() {
|
||||
quark.notify({title: 'Quark Shell', content: content, popupOnClick: true})
|
||||
}
|
||||
|
||||
function setAutoStart(){
|
||||
quark.setLaunchAtLogin(true)
|
||||
}
|
||||
|
||||
function setIcon() {
|
||||
var iconCanvas = document.getElementById('icon')
|
||||
iconCanvas.width = 40
|
||||
|
||||
Reference in New Issue
Block a user