8000 [Feature request] Add option to not rotate the sidebar in Drawer view · Issue #1267 · edvin/tornadofx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Sep 28, 2024. It is now read-only.
This repository was archived by the owner on Sep 28, 2024. It is now read-only.
[Feature request] Add option to not rotate the sidebar in Drawer view #1267
Open
@Huy-Ngo

Description

@Huy-Ngo

For the Drawer view, the items are automatically rotated if they're placed on either side, and I suppose it is done by this method:

private fun configureRotation(button: ToggleButton) {
button.rotate = when (dockingSide) {
Side.LEFT -> -90.0
Side.RIGHT -> 90.0
else -> 0.0
}
}

I would like these items to be put horizontally so it can be read more easily. Basically, I want my drawer to look like this:

image

instead of this:

image

Since the method is private, I can't override it. I suppose that I can do that with CSS, but I don't know how. Here are the approaches I tried:

drawer {
    item("Item 1", expanded = true) {
        addClass(DrawerViewStyle.horizontalDrawerItem)  // no effect
        style { rotate = 0.deg } // no effect
    }
    style { rotate = 0.deg } // no effect
    addClass(DrawerViewStyle.horizontalDrawerItem)  // no effect
}

Stylesheet class:

class DrawerViewStyle: Stylesheet() {
    companion object {
        val horizontalDrawerItem by cssclass()
        val item by css class()
    }
    init {
        horizontalDrawerItem {
            rotate = 0.deg
        }
        button {  // no effect
            rotate = 0.deg
        }
        item {  // no effect
            rotate = 0.deg
        }
        toggleButton {  // no effect
            rotate = 0.deg
        }
    }
}

I didn't find any guide on this and the document doesn't really help. Is there any simple way I can handle this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0