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

Using StyleMetrics shows warning without alternative being available #6698

Closed
Enyium opened this issue Nov 1, 2024 · 1 comment · Fixed by #6711
Closed

Using StyleMetrics shows warning without alternative being available #6698

Enyium opened this issue Nov 1, 2024 · 1 comment · Fixed by #6711
Assignees
Labels
a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) enhancement New feature or request

Comments

@Enyium
Copy link
Contributor

Enyium commented Nov 1, 2024

Consider this SlintPad demo (see comments):

import { StyleMetrics, Palette } from "std-widgets.slint";

export component Demo {
    width: 200px;

    VerticalLayout {
        // Generates a deprecation warning without an alternative
        // being available.
        /*
        */
        padding: StyleMetrics.layout-padding;
        spacing: StyleMetrics.layout-spacing;

        // Not available.
        /*
        padding: Palette.layout-padding;
        spacing: Palette.layout-spacing;
        */

        Rectangle {
            height: 20px;
            background: skyblue;
        }

        Rectangle {
            height: 20px;
            background: lightpink;
        }
    }
}

I know, of course, that you don't need StyleMetrics for VerticalLayout, but can use VerticalBox instead. In my app, I need StyleMetrics.layout-padding and StyleMetrics.layout-spacing for other purposes, and have no way to get rid of the deprecation warnings without copying the literal values, which wouldn't adhere to the single-source-of-truth principle.

@ogoffart ogoffart added a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) need triaging Issue that the owner of the area still need to triage labels Nov 1, 2024
@FloVanGH FloVanGH added enhancement New feature or request and removed need triaging Issue that the owner of the area still need to triage labels Nov 4, 2024
@FloVanGH FloVanGH self-assigned this Nov 4, 2024
@FloVanGH
Copy link
Member

FloVanGH commented Nov 4, 2024

Hi, and thanks again for your request :-).

There is a common issue for the public styling resources #3687.

I will start with the layout settings yet. It's true because of StylingMetrics is deprecated now we should at least provide everything public that is available by StyleMetrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants