Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.

Restyle wild menu/add commandline cursor #1191

Merged
merged 33 commits into from
Jan 4, 2018
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6666f80
Rework styling to match quickopen menu
akinsho Dec 23, 2017
8e5624b
Render wild menu into the stack layer
akinsho Dec 23, 2017
5279e25
Reduce padding
akinsho Dec 23, 2017
ebea06d
Compose wild menu with commandline
akinsho Dec 23, 2017
686f823
Configure wild menu and commandline
akinsho Dec 23, 2017
a20d048
Render components separately inside of common
akinsho Dec 23, 2017
132e7f4
Attempt to manually place external menus not working
akinsho Dec 23, 2017
343ad5b
add space to constructor
akinsho Dec 23, 2017
8f00c2a
Add timeout to prevent flickering of cmdline
akinsho Dec 23, 2017
d22090f
revert changes to neovim surface
akinsho Dec 24, 2017
24f6491
Merge branch 'master' of github.com:onivim/oni into restyle-wild-menu
akinsho Dec 24, 2017
21c3c0a
wire up setcursor actions
akinsho Dec 24, 2017
8f59329
Add a cursor to commandline
akinsho Dec 24, 2017
627bae0
Remove excess space
akinsho Dec 24, 2017
4c7b902
Remove refs from commandline components
akinsho Dec 24, 2017
909c72b
re-add focus as this is essential for functionality
akinsho Dec 24, 2017
02533be
important: fix html trimming whitespace bug
akinsho Dec 24, 2017
38a4f39
add in the prompt segment
akinsho Dec 25, 2017
207e3eb
fix overflow styling
akinsho Dec 25, 2017
1de13c0
add pointer events but not selection
akinsho Dec 25, 2017
66deb2f
Add overflow handling for command line
akinsho Dec 25, 2017
07889c7
minor change to comment position
akinsho Dec 25, 2017
252a087
adjust cursor position
akinsho Dec 26, 2017
e8d1a1d
re-add missing max width
akinsho Dec 26, 2017
d2104c4
re-arrange css to rerun tests
akinsho Dec 26, 2017
9530640
re-arrange css again..
akinsho Dec 26, 2017
ae0a496
Merge branch 'master' of github.com:onivim/oni into restyle-wild-menu
akinsho Jan 3, 2018
059ec25
reduce timeout to 80ms
akinsho Jan 3, 2018
189ee2b
Add spurious CR to rerun test
akinsho Jan 3, 2018
9346cf9
Merge branch 'master' into restyle-wild-menu
akinsho Jan 4, 2018
fa48142
merge upstream fix neovimeditor reducer conflicts
akinsho Jan 4, 2018
ec1ba62
merge upstream branch
akinsho Jan 4, 2018
01ac2c3
Merge branch 'master' into restyle-wild-menu
akinsho Jan 4, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Render wild menu into the stack layer
  • Loading branch information
akinsho committed Dec 23, 2017
commit 8e5624b36716beee4f7da790a2cc888e1d7d83f6
32 changes: 22 additions & 10 deletions browser/src/UI/components/WildMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as React from "react"
import * as ReactDOM from "react-dom"
import { connect } from "react-redux"
import styled, { css } from "styled-components"
import { Icon } from "./../../UI/Icon"
import { Icon } from "./../../UI/Icon"

import * as State from "./../../Editor/NeovimEditor/NeovimEditorStore"
import { fadeInAndDown } from "./animations"
Expand All @@ -25,7 +26,7 @@ const WildMenuList = styled.ul`
position: relative;
width: 75%;
margin-top: 16px;
max-height: 500px;
max-height: 30em;
max-width: 900px;
${boxShadow};
animation: ${fadeInAndDown} 0.05s ease-in-out;
Expand Down Expand Up @@ -58,7 +59,7 @@ const WildMenuItem = withProps<{ selected: boolean }>(styled.li)`
`

const WildMenuText = styled.span`
margin-left: 1rem;
margin-left: 1rem;
`

interface Props {
Expand All @@ -73,12 +74,19 @@ interface State {
}

class WildMenu extends React.Component<Props, State> {
public state = {
currentPage: 1,
itemsPerPage: 10,
}
private selectedElement: HTMLUListElement
private containerElement: HTMLUListElement
private stackLayer: HTMLDivElement

public constructor(props: Props) {
super(props)
this.stackLayer = document.querySelector(".stack .layer")

this.state = {
currentPage: 1,
itemsPerPage: 10,
}
}

public componentWillReceiveProps(next: Props) {
if (next.selected !== this.props.selected) {
Expand All @@ -93,7 +101,8 @@ class WildMenu extends React.Component<Props, State> {
const { currentItems, current } = this.calculateCurrentItems()

return (
visible && (
visible &&
ReactDOM.createPortal(
<WildMenuContainer>
<WildMenuList innerRef={e => (this.containerElement = e)}>
{currentItems &&
Expand All @@ -105,12 +114,15 @@ class WildMenu extends React.Component<Props, State> {
selected={i === current}
key={option + i}
>
<span><Icon name="file-text" /></span>
<span>
<Icon name="file-text" />
</span>
<WildMenuText>{option}</WildMenuText>
</WildMenuItem>
))}
</WildMenuList>
</WildMenuContainer>
</WildMenuContainer>,
this.stackLayer,
)
)
}
Expand Down