Skip to content

Commit

Permalink
updates from master
Browse files Browse the repository at this point in the history
  • Loading branch information
zeke committed Nov 9, 2017
2 parents 5e0fe57 + 9bf950a commit 387ed21
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 8 deletions.
44 changes: 44 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
pipeline {
agent none
stages {
stage('Build') {
parallel {
stage('electron-osx-x64') {
agent {
label 'osx'
}
steps {
sh 'script/bootstrap.py --target_arch=x64 --dev'
sh 'npm run lint'
sh 'script/build.py -c D'
sh 'script/test.py --ci --rebuild_native_modules'
}
post {
always {
cleanWs()
}
}
}
stage('electron-mas-x64') {
agent {
label 'osx'
}
environment {
MAS_BUILD = '1'
}
steps {
sh 'script/bootstrap.py --target_arch=x64 --dev'
sh 'npm run lint'
sh 'script/build.py -c D'
sh 'script/test.py --ci --rebuild_native_modules'
}
post {
always {
cleanWs()
}
}
}
}
}
}
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ forums
- [`Atom`](http://atom-slack.herokuapp.com/) channel on Slack
- [`electron-ru`](https://telegram.me/electron_ru) *(Russian)*
- [`electron-br`](https://electron-br.slack.com) *(Brazilian Portuguese)*
- [`electron-kr`](http://www.meetup.com/electron-kr/) *(Korean)*
- [`electron-jp`](https://electron-jp.slack.com) *(Japanese)*
- [`electron-tr`](http://electron-tr.herokuapp.com) *(Turkish)*
- [`electron-id`](https://electron-id.slack.com) *(Indonesia)*
Expand Down
2 changes: 1 addition & 1 deletion atom/browser/ui/cocoa/atom_touch_bar.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "native_mate/constructor.h"
#include "native_mate/persistent_dictionary.h"

@interface AtomTouchBar : NSObject<NSScrubberDelegate, NSScrubberDataSource> {
@interface AtomTouchBar : NSObject<NSScrubberDelegate, NSScrubberDataSource, NSScrubberFlowLayoutDelegate> {
@protected
std::vector<mate::PersistentDictionary> ordered_settings_;
std::map<std::string, mate::PersistentDictionary> settings_;
Expand Down
36 changes: 36 additions & 0 deletions atom/browser/ui/cocoa/atom_touch_bar.mm
Original file line number Diff line number Diff line change
Expand Up @@ -667,4 +667,40 @@ - (NSScrubberItemView*)scrubber:(NSScrubber*)scrubber
return itemView;
}

- (NSSize)scrubber:(NSScrubber *)scrubber layout:(NSScrubberFlowLayout *)layout sizeForItemAtIndex:(NSInteger)itemIndex
{
NSInteger width = 50;
NSInteger height = 30;
NSInteger margin = 15;
NSSize defaultSize = NSMakeSize(width, height);

std::string s_id([[scrubber identifier] UTF8String]);
if (![self hasItemWithID:s_id]) return defaultSize;

mate::PersistentDictionary settings = settings_[s_id];
std::vector<mate::PersistentDictionary> items;
if (!settings.Get("items", &items)) return defaultSize;

if (itemIndex >= static_cast<NSInteger>(items.size())) return defaultSize;

mate::PersistentDictionary item = items[itemIndex];
std::string title;

if (item.Get("label", &title)) {
NSSize size = NSMakeSize(CGFLOAT_MAX, CGFLOAT_MAX);
NSRect textRect = [base::SysUTF8ToNSString(title) boundingRectWithSize:size
options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading
attributes:@{ NSFontAttributeName: [NSFont systemFontOfSize:0]}];

width = textRect.size.width + margin;
} else {
gfx::Image image;
if (item.Get("icon", &image)) {
width = image.AsNSImage().size.width;
}
}

return NSMakeSize(width, height);
}

@end
11 changes: 10 additions & 1 deletion atom/browser/ui/cocoa/touch_bar_forward_declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

@class NSTouchBar, NSTouchBarItem;
@class NSScrubber, NSScrubberItemView, NSScrubberArrangedView, NSScrubberTextItemView, NSScrubberImageItemView, NSScrubberSelectionStyle;
@protocol NSTouchBarDelegate, NSScrubberDelegate, NSScrubberDataSource;
@protocol NSTouchBarDelegate, NSScrubberDelegate, NSScrubberDataSource, NSScrubberFlowLayoutDelegate, NSScrubberFlowLayout;

typedef float NSTouchBarItemPriority;
static const NSTouchBarItemPriority NSTouchBarItemPriorityHigh = 1000;
Expand Down Expand Up @@ -149,6 +149,9 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =

@end

@interface NSScrubberFlowLayout: NSObject
@end

@interface NSScrubberSelectionStyle : NSObject<NSCoding>

@property(class, strong, readonly) NSScrubberSelectionStyle* outlineOverlayStyle;
Expand Down Expand Up @@ -229,6 +232,12 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =

@end

@protocol NSScrubberFlowLayoutDelegate<NSObject>

- (NSSize)scrubber:(NSScrubber *)scrubber layout:(NSScrubberFlowLayout *)layout sizeForItemAtIndex:(NSInteger)itemIndex;

@end

#pragma clang assume_nonnull end

#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_1
Expand Down
2 changes: 1 addition & 1 deletion docs/api/browser-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `defaultEncoding` String (optional) - Defaults to `ISO-8859-1`.
* `backgroundThrottling` Boolean (optional) - Whether to throttle animations and timers
when the page becomes background. This also affects the
[Page Visibility API][#page-visibility]. Defaults to `true`.
[Page Visibility API](#page-visibility). Defaults to `true`.
* `offscreen` Boolean (optional) - Whether to enable offscreen rendering for the browser
window. Defaults to `false`. See the
[offscreen rendering tutorial](../tutorial/offscreen-rendering.md) for
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ Specification][notification-spec], including Cinnamon, Enlightenment, Unity,
GNOME, KDE.

[notification-spec]: https://developer.gnome.org/notification-spec/
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dugite": "^1.45.0",
"electabul": "~0.0.4",
"electron-docs-linter": "^2.3.3",
"electron-typescript-definitions": "^1.2.7",
"electron-typescript-definitions": "^1.2.10",
"github": "^9.2.0",
"husky": "^0.14.3",
"minimist": "^1.2.0",
Expand Down
4 changes: 1 addition & 3 deletions spec/api-browser-window-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1528,9 +1528,7 @@ describe('BrowserWindow module', () => {
})
})

// FIXME(alexeykuzmin): Temporary disabled to unblock master.
// https://github.com/electron/electron/issues/10988
xdescribe('document.visibilityState/hidden', () => {
describe('document.visibilityState/hidden', () => {
beforeEach(() => { w.destroy() })

function onVisibilityChange (callback) {
Expand Down

0 comments on commit 387ed21

Please sign in to comment.