Commit Graph

7603 Commits

Author SHA1 Message Date
probablycorey
067bbb966d 💄
This is a totally subjective style change. I just prefer keeping code
that is rarely changed tight and dense. Another option would be to 
move the menu templates into a separate file.
2013-05-17 10:51:12 -07:00
Cheng Zhao
6260d350ac Should always show devtools instead of toggling when getting error. 2013-05-17 23:07:34 +08:00
Cheng Zhao
26c89f71b2 Use BrowserWindow's 'close' event instead of 'beforeunload' to control closing.
Ideally both window closing and reloading should use 'beforeunload' to
control whether the unloading should continue, however since the save as
dialog is asynchronous, we have to prevent unloading first and then
continue after user's confirmation. And since we can not distinguish
whether the window is reloading or closing in the 'beforeunload'
handler, we do not know what to continue after user's confirmation. So I
have to rely on BrowserWindow's 'close' event to let user decide whether
window should be closed.
2013-05-17 22:30:14 +08:00
Cheng Zhao
2d14f6e768 Replace default menu with custom built menu. 2013-05-17 22:14:09 +08:00
Cheng Zhao
b27cd33116 Implement atom.confirm with atom-shell's dialog API.
Note that the dialog.showMessageBox is blocking, so we don't need to use
the '@presentModal'.
2013-05-17 20:39:37 +08:00
Cheng Zhao
f0448ba231 Trigger 'window:close' command in the 'beforeunload' event handler.
When user wants to close the window, the 'beforeunload' event would be
called, then the closing would be cancelled and the 'window:close'
command would be triggered. In the 'window:close' handler, a confirm
dialog could be showed if there are unsaved contents, and if the window
is really meant to be closed, the window would be tried to be closed
again and this time 'beforeunload' handler wont't prevent it.
2013-05-17 20:17:06 +08:00
Cheng Zhao
acf5e21f50 Do unload work in 'unload' event handler instead of 'beforeunload'.
In Atom, the 'beforeunload' event never prevents window from closing so
it in fact has the same effect with 'unload' event, I guess using
'beforeunload' instead of 'unload' is because the 'beforeunload' is
guarrenteed to happen when window is closing or application is quiting.
However in Atom Shell the 'unload' event is guarrenteed to happen on
both conditions, just like the 'beforeunload' in Atom, so it's safe to
replace the 'beforeunload' with 'unload' here.

And in Atom Shell, the 'beforeunload' event is mainly used for
preventing window from closing, just like the 'window:close' command in
Atom.
2013-05-17 20:17:03 +08:00
Cheng Zhao
d1ca0a8f8f Use toggleDevTools instead of showDevTools. Fixes atom/atom-shell#8.
Currently the toggleDevTools of atom-shell is simulated by keeping state
of devtools, because there is no way to know the state of devtools in
brightray, so it could not behave correctly sometimes.

This problem will be solved when brightray is patched and atom-shel gets
updated.
2013-05-17 19:02:03 +08:00
Cheng Zhao
e7b35d27e7 Revert ae7dce4575.
Now require('package') won't wrong resolve to the package.json, so
reverting previous workaround.
2013-05-17 18:48:02 +08:00
Cheng Zhao
02e3f4cd9c Enable harmony collections, also revert previous WeakMap hack.
Fixed atom/atom-shell#7.
2013-05-17 16:21:01 +08:00
probablycorey
8487536280 Store parsed command line args in BrowserMain 2013-05-16 17:33:12 -07:00
probablycorey
0c96b30053 Move setupNodePaths method to BrowserMain 2013-05-16 17:28:54 -07:00
probablycorey
27bd476b12 Moving logic into BrowserMain class 2013-05-16 17:25:39 -07:00
probablycorey
8f17889f7f Open dialog creates new atom window 2013-05-16 16:38:47 -07:00
probablycorey
f713429674 Remove unused params 2013-05-16 16:21:29 -07:00
probablycorey
92ec78cd8a Show dev tools when toggleDevTools is triggered
Eventually want make toggle work as expected. Related to https://github.com/atom/atom-shell/issues/8
2013-05-16 15:14:50 -07:00
probablycorey
889ccdb58d Throw error when sendMessageToBrowserProcess is called 2013-05-16 15:13:31 -07:00
probablycorey
09ab319328 Atom.show no longer used
The window is shown automatically when it is created.
2013-05-16 14:19:53 -07:00
probablycorey
bc854afead Make messageIdCounter an instance var of window.atom 2013-05-16 13:48:16 -07:00
probablycorey
1e0b734734 Add hacked interface for WeakMap
We need to add the `--harmony_collections` flag to atom-shell.
Related to issue https://github.com/atom/atom-shell/issues/7
2013-05-16 13:46:17 -07:00
probablycorey
ae7dce4575 Rename package.coffee to base-package.coffee
Related to https://github.com/atom/atom-shell/issues/6
2013-05-16 10:57:41 -07:00
probablycorey
ee12977a9f Use ipc to store and retrieve windowState
I'll want to change the interface in the future. For now I am trying
to keep the code as simple and small as possible.
2013-05-16 09:57:07 -07:00
probablycorey
f65a2826f2 Make atom a global object 2013-05-15 15:32:51 -07:00
probablycorey
94a8c44d39 Remove AtomWindow params that are not in use yet
I pulled these out to keep the code simpler until we something running
2013-05-15 15:18:43 -07:00
probablycorey
16f8402d36 The resource path can be set with a command arg 2013-05-15 15:03:59 -07:00
probablycorey
d397bd5c4f Add optimist npm (an option parser) 2013-05-15 11:22:40 -07:00
Cheng Zhao
8a3ee0515c 'window' module is renamed to 'browser_window'. 2013-05-15 22:27:28 +08:00
Cheng Zhao
e9a4d9cafe 💄 2013-05-13 20:08:43 +08:00
Cheng Zhao
bb114932ea Correctly set NODE_PATH before opening window. 2013-05-13 19:57:07 +08:00
Cheng Zhao
3b87c5d84b Set bootstrapScript and resourcePath params in URL. 2013-05-13 18:32:15 +08:00
Cheng Zhao
30b635527c Show the static/index.html on startup. 2013-05-13 16:47:16 +08:00
Cheng Zhao
77963aaf88 Keep symbol links when copying atom-shell bundle. 2013-05-13 16:46:48 +08:00
Cheng Zhao
02d5ca78d5 Clean unused native build scripts. 2013-05-13 15:16:42 +08:00
Cheng Zhao
e99fe93029 Don't build native code and use atom-shell's binary instead. 2013-05-13 13:49:31 +08:00
Cheng Zhao
548021dd40 Download atom-shell and remove cefode. 2013-05-12 19:51:31 +08:00
Cheng Zhao
0f528c4811 Remove prebuilt-cef submodule. 2013-05-12 19:18:06 +08:00
Nathan Sobo
c876876d5e Upgrade the icon 2013-05-11 10:35:45 -06:00
Nathan Sobo
7dde2fec55 Fix wrap guide spec again. Previously it only passed w/ a wide window. 2013-05-11 09:08:10 -06:00
Nathan Sobo
49cf92c2a2 Fix perf regression: Don't update line numbers for single line changes 2013-05-10 19:39:33 -06:00
Nathan Sobo
60319c30ac Fix wrap guide specs after panes css change 2013-05-10 18:30:01 -06:00
Nathan Sobo
191e8ab240 Fix perf regression caused by flex-flow: column on pane item views
For some reason, having flex-flow column on the pane item views
container was forcing the entire view to be repainted on cursor
movement and line edits. Allowing the container to flow row-wise and
setting the min-height to 0 instead of min-content-height achieves
the same layout effect without the huge repaint cost. Flexbox is a
fragile bitch.
2013-05-10 18:19:41 -06:00
Nathan Sobo
b4dec8ccbb In Editor.updateRenderedLines, cap renderFrom to the last screen row
If we remove a large number of screen lines when we are scrolled down,
the current @firstRenderedScreenRow may end up being larger than the
number of screen rows we now have. Setting renderFrom to the
@firstRenderedScreenRow in this case was causing the renderFrom to be
larger than the renderTo, which was causing problems downstream with
the new mapping code.
2013-05-10 13:20:43 -06:00
Nathan Sobo
7d28edc116 Rename ScreenLine -> TokenizedLine
Now that ScreenLines don't contain the bufferRows property, which was
essential to the functioning of the LineMap, they're just containers
for tokens. Since they're stored in the TokenizedBuffer in a form that
doesn't necessarily match what ends up on screen, it makes more sense
to call them tokenized lines. A tokenized line is a screen line if it's
in the `.screenLines` array of the DisplayBuffer, but "screenness" is
not an inherent property, so it shouldn't be in the name of the class.
2013-05-10 13:20:43 -06:00
Nathan Sobo
4d314f99ac Eliminate ScreenLine.bufferRows property
Previously, we used bufferRows to determine how many buffer rows were
spanned by the screen line in the event it was folded. Now that we have
RowMap, screen lines don't need to serve this purpose. We still need
to know if a screen line is wrapped, which we solve via setting the
lineEnd property to null for a soft-wrapped screen line.
2013-05-10 13:20:43 -06:00
Nathan Sobo
1d146640e5 Break some methods out of DisplayBuffer.updateScreenLines 2013-05-10 13:20:43 -06:00
Nathan Sobo
b4c95d4fc9 Merge adjacent isomorphic regions after adding new regions 2013-05-10 13:20:42 -06:00
Nathan Sobo
d9c258f27e Handle new regions overlapping screen wise but not buffer wise 2013-05-10 13:20:42 -06:00
Nathan Sobo
4a56cc3693 Kick docs threshold down again because I removed public methods 2013-05-10 13:20:42 -06:00
Nathan Sobo
8b149ff827 Delete LineMap 2013-05-10 13:20:42 -06:00
Nathan Sobo
f3145e671a Declare screenLines ivar in DisplayBuffer 2013-05-10 13:20:42 -06:00