[vlc-devel] [PATCH 1/9] qml: add column width and margin to VLCStyle

Pierre Lamot pierre at videolabs.io
Wed Jun 3 09:10:22 CEST 2020


OK for the set


On 2020-06-02 17:17, jagannatharjun wrote:
> ---
>  modules/gui/qt/style/VLCStyle.qml | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/modules/gui/qt/style/VLCStyle.qml
> b/modules/gui/qt/style/VLCStyle.qml
> index 664d83b4dd..99bdba7e54 100644
> --- a/modules/gui/qt/style/VLCStyle.qml
> +++ b/modules/gui/qt/style/VLCStyle.qml
> @@ -145,6 +145,8 @@ Item {
>      property int gridItem_video_height: VLCStyle.video_normal_height
> + VLCStyle.fontHeight_normal + VLCStyle.fontHeight_small  +
> VLCStyle.margin_xxsmall * 4
>      property int gridItem_video_width: VLCStyle.video_normal_width +
> VLCStyle.margin_xxsmall * 4
> 
> +    property int column_width: 114 * scale
> +    property int column_margin_width: 32 * scale
> 
>      //global application margin "safe area"
>      property int applicationHorizontalMargin: 0
> @@ -164,5 +166,13 @@ Item {
>      property url noArtArtist: "qrc:///noart_artist.svg";
>      property url noArtArtistSmall: "qrc:///noart_artist_small.svg";
> 
> +    function colWidth(nb) {
> +      return nb * VLCStyle.column_width + ( nb - 1 ) *
> VLCStyle.column_margin_width;
> +    }
> +
> +    //Returns the number columns fitting in given width
> +    function gridColumnsForWidth(width) {
> +        return Math.floor((width + column_margin_width) /
> (column_width + column_margin_width))
> +    }
> 
>  }


More information about the vlc-devel mailing list