Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elius94/issue41 #42

Merged
merged 6 commits into from May 30, 2022
Merged

Elius94/issue41 #42

merged 6 commits into from May 30, 2022

Conversation

Elius94
Copy link
Owner

@Elius94 Elius94 commented May 30, 2022

Changed Layouts

The application instance needs to output the content through a layout class.
In the "layoutOptions" provided to the ConsoleManager, we can set the layout:

  • boxed: Set to true to enable boxed layout mode (default: true)
    image "boxed"
    image "not boxed"
  • showTitle: Set to false to hide titles (default: true, on title per page)
  • changeFocusKey: The key or the combination that will change the focus between the pages of the layout (default: 'ctrl+l')
  • type: Can be "single", "double" or "quad" to choose the layout type (default: "double")
    image "single"
    image "double"
    image "quad"
  • direction: Set to 'horizontal' to enable horizontal layout (only for "double" layout)
    image "horizontal" example
  • boxColor: The color of the box (default: 'yellow')
  • boxStyle: The style of the box (default: 'bold')

To draw multiple pages, we need to use the setPage or setPages methods:

GUI.setPage(p, 0) // Add the first page without explicit name (default: application title)

const p1 = new PageBuilder()
p1.addRow({ text: "SECOND PAGE", color: "green" })

const P2 = new PageBuilder()
P2.addRow({ text: "THIRD PAGE", color: "cyan" })

GUI.setPage(p1, 1, "Top Right")
GUI.setPage(P2, 2, "Bottom Left")

// Or if we want to add the pages in the same order (only one render):
GUI.setPages([p, p1, P2], ["App Title", "Top Right", "Bottom Left"])

If we are in quad layout mode or double horizontal layout, we can change the aspect ratio of the layout rows by pressing the "left" and "right" keys:
changeratio

If you are using the quad layout mode the arrow keys will change the aspect ratio of the layout selected row (the top or the bottom row, depending on the selected page)

…responsive (also the existing Double Layout)

Fixes #41

Added SingleLayout (to be tested)
…responsive (also the existing Double Layout)

Fixes #41

Added LayoutManager to manage other type of layout.
Currently we can use: SingleLayout and DoubleLayout.

Fixed small issues
…responsive (also the existing Double Layout)

Fixes #41

Updated documentation
…responsive (also the existing Double Layout)

Fixes #41

Added QuadLayout but it need to be fixed
…responsive (also the existing Double Layout)

Fixes #41

Now we have:
 - SingleLayout
 - DoubleLayout
 - QuadLayout

Double (if horizontal) and Quad (always) can chage the row proportions
of cells by pressing left and right arrows.
@Elius94 Elius94 merged commit e9e6179 into main May 30, 2022
@Elius94 Elius94 deleted the Elius94/issue41 branch May 30, 2022 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant