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

Nice to have: vertical slider and table wizard #494

Open
zappfinger opened this issue Sep 24, 2018 · 12 comments
Open

Nice to have: vertical slider and table wizard #494

zappfinger opened this issue Sep 24, 2018 · 12 comments

Comments

@zappfinger
Copy link

I really would like to see a vertical slider. A table wizard would also be handy. Although the latter could probably be created easily with a label and som HTML code...

@almarklein
Copy link
Member

Thanks for the suggestions. I think the slider should probably become vertical when its height is larger than its width.

@zappfinger
Copy link
Author

That is likely to work. But how do I set these properties?

@almarklein
Copy link
Member

Sorry, what properties do you mean?

@zappfinger
Copy link
Author

zappfinger commented Sep 25, 2018 via email

@almarklein
Copy link
Member

Oh, right. The layout generally determines the size of a widget, e.g. depending on the flex values. But also the DEFAULT_MIN_SIZE class property is taken into account, which is (40, 20) for the slider, so indeed it is geared to be more horizontal. That said, in this example, the slider on the right could be made to become vertical:

from flexx import flx

class Example(flx.Widget):
    def init(self):
        with flx.HSplit():
            with flx.VBox():
                flx.Widget(flex=1, style='background:#f00')
                flx.Slider()
            with flx.HBox():
                flx.Widget(flex=1, style='background:#0f0')
                flx.Slider()

flx.launch(Example)
flx.run()

@zappfinger
Copy link
Author

This does not work at all. I also tried with CSS, but this gives a very strange result: a mix of a horizontal and vertical slider:

class Example(flx.Widget):
	CSS = """
	.flx-Slider {
		-webkit-appearance: slider-vertical;
		width: 20px;
		height: 100px;
	}
	"""
	def init(self):
		flx.Slider()

@almarklein
Copy link
Member

almarklein commented Sep 25, 2018

Ooh! I think we have a misunderstanding :) I wrote "I think the slider should probably become vertical when its height is larger than its width.". What I meant with that this should be the behavior when we implement a vertical slider. At this point in time, Flexx does not have a vertical slider. Sorry for the confusion!

@zappfinger
Copy link
Author

Ok, I see. But would it not be easier and consistent to implement this behaviour via (raw) HTML/CSS properties?

@almarklein
Copy link
Member

As in turn a slider horizontal/vertical? Yes this could well be. Maybe auto-mode by default, and an ability to explicitly set it. But I have not thought about it much yet. And I don't know yet how hard it would be implementation-wise.

@drafter250
Copy link

Doesn't phosphor.js have a really good table widget that they have shown off in the Jupyter lab demo's ?

@almarklein
Copy link
Member

Yes, they have. Flexx does no longer depend on Phosphor, but it should be possible to load it as an asset and use the table that way.

We should distinguish between different kinds of table widgets though :) I was thinking about a widget to layout child widgets in a table, a bit like the FormLayout. The Phosphor thing is a leaf widget for tabular data :)

@zappfinger
Copy link
Author

Sounds good! Since a table element could also contain an another element, like a button. Also, any table cell should be clickable...
I managed to hack a (static) table by using only Labels and HTML, but it is not so nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants