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

add footer below workspace bottom drawer #29

Open
SKeeneCode opened this issue Apr 1, 2021 · 0 comments · May be fixed by #30
Open

add footer below workspace bottom drawer #29

SKeeneCode opened this issue Apr 1, 2021 · 0 comments · May be fixed by #30
Assignees
Labels
new Something that does not exist yet

Comments

@SKeeneCode
Copy link
Collaborator

SKeeneCode commented Apr 1, 2021

This feature would add a footer below the bottom drawer of the workspace - giving the developer another option in where to place controls in their workspace application.

A footer like this is used in IntelliJ to display various information underneath its own bottom drawer:

image

Another example, of how Microsoft Word uses this space:

image

My understanding is the use of a footer like this is to hold controls and information that is not important or suitable to be displayed in the main toolbar, but are important enough to be visible on screen and not hidden inside some menu.

I've created a WIP pull request that gives a first draft implementation.

This implementation includes a togglable property in the workspace to show/hide the footer. It also allows the dynamic adding/removing of controls much like the normal header does.

If you checkout the PR, you can play with it with the following minimal example:

Example

class MyWorkspace : Workspace(navigationMode = NavigationMode.Tabs) {
    init {
        primaryStage.width = 800.0
        primaryStage.height = 600.0
    }

    init {
        with(leftDrawer) {
            item("Left Drawer Item", expanded = true) {
                vbox {
                    button("new page") {
                        action {
                            dockInNewScope<Page>()
                        }
                    }
                }
            }
        }
        with(bottomDrawer) {
            item("Bottom Drawer Item", expanded = false) {
                vbox {
                    label("Hello I am a label")
                }
            }
        }
        with(footer) {
            button("Static Button Added In Custom Workspace init")
        }
    }
}

class Page : View("My Page") {

    val myTitle = UUID.randomUUID().toString().take(4)

    init { title = myTitle }

    override fun onDock() {
        with(workspace.rightDrawer) {
            item("Right Drawer Item $title", expanded = false) {
                label(this.toString())
            }
        }
        with(workspace.footer) {
            button("Dynamic button added inside ondock of page $title")
            label("Dynamic Label: $title")
        }
    }

    override val root = flowpane {
        button("toggle footer") {
            action {
                workspace.showFooter = !workspace.showFooter
            }
        }
    }
}

class MyApp : App(MyWorkspace::class) {
}

fun main() {
    launch<MyApp>()
}

image

Happy to have a discussion of the usefulness of this feature (feature creep?). Suggestions on enhancements etc welcome.

@SKeeneCode SKeeneCode added the new Something that does not exist yet label Apr 1, 2021
@SKeeneCode SKeeneCode self-assigned this Apr 1, 2021
@SKeeneCode SKeeneCode linked a pull request Apr 1, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new Something that does not exist yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant