[vlc-commits] qml: add column width and margin to VLCStyle
jagannatharjun
git at videolan.org
Wed Jun 3 12:07:02 CEST 2020
vlc | branch: master | jagannatharjun <guptaprince8832 at gmail.com> | Thu May 14 19:32:36 2020 +0530| [d10065db795229af54295f23d61bff1a7504251f] | committer: Pierre Lamot
qml: add column width and margin to VLCStyle
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d10065db795229af54295f23d61bff1a7504251f
---
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-commits
mailing list