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

std-widgets: added LayoutSettings global #6711

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

FloVanGH
Copy link
Member

@FloVanGH FloVanGH commented Nov 4, 2024

Fixes #6698

Copy link
Member

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think it make sense to expose the layout margin and padding through a global.

I don't think the text-cursor-width make sense to be exposed though. This is also not related to layout.

As for the name LayoutSettings, this means it is specific to layout, but could it be used for other settings in the future?
Also are these really "Settings"? Settings implies that you can change them. Maybe they are StyleParameters or StyleProperties?

docs/reference/src/language/builtins/globals.md Outdated Show resolved Hide resolved
internal/compiler/widgets/cosmic/styling.slint Outdated Show resolved Hide resolved
@FloVanGH
Copy link
Member Author

FloVanGH commented Nov 4, 2024

Thanks, I think it make sense to expose the layout margin and padding through a global.

I don't think the text-cursor-width make sense to be exposed though. This is also not related to layout.

As for the name LayoutSettings, this means it is specific to layout, but could it be used for other settings in the future? Also are these really "Settings"? Settings implies that you can change them. Maybe they are StyleParameters or StyleProperties?

@ogoffart the text-cursor-width is removed now.

For the name I'm open for an alternative. LayoutSettings is just a suggestion from my side. I would like to make the name more layout specific. Because we will have also something for the font settings.

Suggestion

// Brushes
global Palette { ... }

// Font settings e.g. TextStyles.header.font-size, TextStyles.header.font-weight
global TextStyles { ... }

global LayoutParameters { ... }

What you you think?

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.

Using StyleMetrics shows warning without alternative being available
2 participants