-
Notifications
You must be signed in to change notification settings - Fork 84
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 new button label positions along with new vertical tasklist mode when labelpos is set to top or bottom #615
Add new button label positions along with new vertical tasklist mode when labelpos is set to top or bottom #615
Conversation
I think this should probably be a configuration option on the tray or maybe it should use the tray width to decide what to do. I suspect there are users who want trays to show up with the icon and text as they would appear in a menu. Otherwise I think this looks good. |
Yeah, I was thinking of having this as an alternative tray mode you can toggle on, otherwise it will use the original logic for the tray when vertical. |
…st. By default it is set to false and will use the previous vertical tasklist logic. Also did some minor refactoring of the ComputeItemSize function.
@joewing By default, it is set to false and will use the previous vertical tasklist logic. I also did some minor refactoring of the ComputeItemSize function. It already uses the tray width to automatically calculate the tasklist item size. Now, since this is a vertical tray things get swapped around since the actual width is the tray height and the real height is the tray width if that makes any sense. Basically, everything is automatically calculated the same way it's done normally when the tray is horizontal, but with some height and width swapped. I'm going to try to adjust the vertical button so it prioritizes the label when it's enabled so it doesn't disappear so early when room starts running out in the tray. |
For the configuration, it might make it easier to use if it was more explicit... Maybe something like <TaskListStyle labelpos="right" ...> and <TaskListStyle labelpos="bottom" ...> That way there is also an obvious path to placing the label above or to the left. |
Yeah, that looks way more clear. |
@joewing |
Yeah, having it as part of the tray or TaskList probably makes more sense. It's more a layout thing than a style thing anyway. |
…to <TaskList/> as part of the tray.
@joewing You can now also have buttons of different styles regardless of tray orientation. bottom labels on horizontal tray. bottom labels on vertical tray. top labels on horizontal tray. top labels on vertical tray. By default the button label position is |
I might rename the PR to reflect the new changes. |
@joewing I can put the logic for drawing the border and background into their separate functions. |
Looks good, thanks! I think the only thing left to do would be to document the new feature in |
|
@joewing |
Thank you! |
Glad to get this merged! |
This is a WIP prototype of vertical buttons. They are now utilized for the tasklist when the tray is vertical. I'm not quite yet satisfied with it yet since there are still some issues with resizing and the text disappearing too early when the task icon is too big. But I plan to address those issues.
It will currently try to center the text if the text width is less than or equal to the icon width, otherwise, it will have the text on the left.
To avoid too many changes I just made another Button function that handles drawing instead of adding new logic to the existing DrawButton function.
I did take out some of the existing logic that was in DrawButton and move them into their own functions but I only did that for some parts of it since the parts that use preprocessor macros didn't end up working for me. So I just left them as is.
I posted my results in an existing issue over at #457
But I don't think too many people noticed it so I'm posting it here for further feedback/ideas.
FYI: The User defined height attribute for the tasklist is ignored for now.