forked from tslocum/cview
parent
1ee8d9874d
commit
b61132eddf
@ -0,0 +1,14 @@
|
||||
arch: amd64
|
||||
environment:
|
||||
PROJECT_NAME: 'cview'
|
||||
CGO_ENABLED: '1'
|
||||
GO111MODULE: 'on'
|
||||
image: freebsd/latest
|
||||
packages:
|
||||
- go
|
||||
sources:
|
||||
- https://git.sr.ht/~tslocum/cview
|
||||
tasks:
|
||||
- test: |
|
||||
cd $PROJECT_NAME
|
||||
go test ./...
|
@ -0,0 +1,14 @@
|
||||
arch: x86_64
|
||||
environment:
|
||||
PROJECT_NAME: 'cview'
|
||||
CGO_ENABLED: '1'
|
||||
GO111MODULE: 'on'
|
||||
image: alpine/edge
|
||||
packages:
|
||||
- go
|
||||
sources:
|
||||
- https://git.sr.ht/~tslocum/cview
|
||||
tasks:
|
||||
- test: |
|
||||
cd $PROJECT_NAME
|
||||
go test ./...
|
@ -0,0 +1,4 @@
|
||||
.idea/
|
||||
dist/
|
||||
*.sh
|
||||
vendor/
|
@ -1,73 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
education, socio-economic status, nationality, personal appearance, race,
|
||||
religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at https://rentafounder.com/page/about-me/. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
@ -1,35 +1,19 @@
|
||||
# Contributing to tview
|
||||
This document assists cview users and developers with sharing issues,
|
||||
suggestions and patches.
|
||||
|
||||
First of all, thank you for taking the time to contribute.
|
||||
# Issues and suggestions
|
||||
|
||||
The following provides you with some guidance on how to contribute to this project. Mainly, it is meant to save us all some time so please read it, it's not long.
|
||||
Please include as much relevant information as possible.
|
||||
|
||||
Please note that this document is work in progress so I might add to it in the future.
|
||||
Review project [documentation](https://godoc.org/git.sr.ht/~tslocum/cview)
|
||||
before submitting an issue.
|
||||
|
||||
## Issues
|
||||
Share issues and suggestions on the [issue tracker](https://todo.sr.ht/~tslocum/cview).
|
||||
|
||||
- Please include enough information so everybody understands your request.
|
||||
- Screenshots or code that illustrates your point always helps.
|
||||
- It's fine to ask for help. But you should have checked out the [documentation](https://godoc.org/github.com/rivo/tview) first in any case.
|
||||
- If you request a new feature, state your motivation and share a use case that you faced where you needed that new feature. It should be something that others will also need.
|
||||
# Patches (pull requests)
|
||||
|
||||
## Pull Requests
|
||||
Send patches to the [cview-dev](https://lists.sr.ht/~tslocum/cview-dev) mailing
|
||||
list.
|
||||
|
||||
In my limited time I can spend on this project, I will always go through issues first before looking at pull requests. It takes a _lot_ of time to look at code that you submitted and I may not have that time. So be prepared to have your pull requests lying around for a long time.
|
||||
|
||||
Therefore, if you have a feature request, open an issue first before sending me a pull request, and allow for some discussion. It may save you from writing code that will get rejected. If your case is strong, there is a good chance that I will add the feature for you.
|
||||
|
||||
I'm very picky about the code that goes into this repo. So if you violate any of the following guidelines, there is a good chance I won't merge your pull request.
|
||||
|
||||
- There must be a strong case for your additions/changes, such as:
|
||||
- Bug fixes
|
||||
- Features that are needed (see "Issues" above; state your motivation)
|
||||
- Improvements in stability or performance (if readability does not suffer)
|
||||
- Your code must follow the structure of the existing code. Don't just patch something on. Try to understand how `tview` is currently designed and follow that design. Your code needs to be consistent with existing code.
|
||||
- If you're adding code that increases the work required to maintain the project, you must be willing to take responsibility for that extra work. I will ask you to maintain your part of the code in the long run.
|
||||
- Function/type/variable/constant names must be as descriptive as they are right now. Follow the conventions of the package.
|
||||
- All functions/types/variables/constants, even private ones, must have comments in good English. These comments must be elaborate enough so that new users of the package understand them and can follow them. Provide examples if you have to. Start all sentences upper-case, as is common in English, and end them with a period.
|
||||
- A new function should be located close to related functions in the file. For example, `GetColor()` should come after (or before) `SetColor()`.
|
||||
- Your changes must not decrease the project's [Go Report](https://goreportcard.com/report/github.com/rivo/tview) rating.
|
||||
- No breaking changes unless there is absolutely no other way.
|
||||
- If an issue accompanies your pull request, reference it in the PR's comments, e.g. "Fixes #123", so it is closed automatically when the PR is closed.
|
||||
See [git-send-email.io](https://git-send-email.io) for information on sending
|
||||
patches via email.
|
||||
|
@ -0,0 +1,28 @@
|
||||
This document explains why [tview](https://github.com/rivo/tview) was forked to
|
||||
create [cview](https://git.sr.ht/~tslocum/cview). It also tracks which
|
||||
tview pull requests have been merged into cview.
|
||||
|
||||
# Why fork?
|
||||
|
||||
[rivo](https://github.com/rivo), the creator and sole maintainer of tview,
|
||||
explains his reviewing and merging process in a [a GitHub comment](https://github.com/rivo/tview/pull/298#issuecomment-559373851).
|
||||
|
||||
He states that he does not have the necessary time or interest to review,
|
||||
discuss and merge pull requests:
|
||||
|
||||
>this project is quite low in priority. It doesn't generate any income for me
|
||||
>and, unfortunately, reviewing issues and PRs is also not much "fun".
|
||||
|
||||
>But some other people submitted large PRs which will cost me many hours to
|
||||
>review. (I had to chuckle a bit when I saw [this comment](https://github.com/rivo/tview/pull/363#issuecomment-555484734).)
|
||||
|
||||
>Lastly, I'm the one who ends up maintaining this code. I have to be 100%
|
||||
>behind it, understand it 100%, and be able to make changes to it later if
|
||||
> necessary.
|
||||
|
||||
cview aims to solve these issues by increasing the number of project
|
||||
maintainers and allowing code changes which may be outside of tview's scope.
|
||||
|
||||
# Merged pull requests
|
||||
|
||||
*Coming soon*
|
@ -0,0 +1,59 @@
|
||||
cview forked tview at the following commit:
|
||||
|
||||
1ee8d9874dcfca377e638a1572ef3718f416ee0d
|
||||
Sun Dec 29 17:56:09 2019 +0100
|
||||
Merge pull request #292 from mikeschinkel/box_gettitle
|
||||
|
||||
The tview license applies to the above commit and all prior commits.
|
||||
|
||||
----------
|
||||
|
||||
cview license:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Trevor Slocum <trevor@rocketnine.space>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
----------
|
||||
|
||||
tview license:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Oliver Kuederle
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Oliver Kuederle
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 2.1 MiB |
@ -1,16 +1,16 @@
|
||||
package main
|
||||
|
||||
import "github.com/rivo/tview"
|
||||
import "git.sr.ht/~tslocum/cview"
|
||||
|
||||
// Center returns a new primitive which shows the provided primitive in its
|
||||
// center, given the provided primitive's size.
|
||||
func Center(width, height int, p tview.Primitive) tview.Primitive {
|
||||
return tview.NewFlex().
|
||||
AddItem(tview.NewBox(), 0, 1, false).
|
||||
AddItem(tview.NewFlex().
|
||||
SetDirection(tview.FlexRow).
|
||||
AddItem(tview.NewBox(), 0, 1, false).
|
||||
func Center(width, height int, p cview.Primitive) cview.Primitive {
|
||||
return cview.NewFlex().
|
||||
AddItem(cview.NewBox(), 0, 1, false).
|
||||
AddItem(cview.NewFlex().
|
||||
SetDirection(cview.FlexRow).
|
||||
AddItem(cview.NewBox(), 0, 1, false).
|
||||
AddItem(p, height, 1, true).
|
||||
AddItem(tview.NewBox(), 0, 1, false), width, 1, true).
|
||||
AddItem(tview.NewBox(), 0, 1, false)
|
||||
AddItem(cview.NewBox(), 0, 1, false), width, 1, true).
|
||||
AddItem(cview.NewBox(), 0, 1, false)
|
||||
}
|
||||
|