[vlc-commits] [Git][videolan/vlc][master] 20 commits: macosx: Reimplement details in media item supplementary detail view as a...

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Tue Jan 14 16:39:04 UTC 2025



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
edd982fb by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Reimplement details in media item supplementary detail view as a grid-like combination of stack views

Since we cannot use NSGridView on OS X 10.10, this will have to do

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
0b48839d by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Fix hiding media item labels text fields when no labels present

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
15284b7f by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Reorder placement of labels in suplementary detail view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
364a485b by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Add field for displaying last played date

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
89f0d312 by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Hide last played textfield stuff if the item ahs not been played

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
1bdfa9f6 by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Add text field to display input item copyright in media item supplementary detail view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
119faf7e by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Hide copyright text fields in media item supplementary detail view if copyright string empty

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
8279b709 by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Present content description of input item in media item supplementary detail view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
2ba418aa by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Hide content description items in media item supplementary detail view when it is empty

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
29517515 by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Tighten up heights of some items in media item supplementary detail view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
d7268f6b by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Add favourite button to media item supplementary detail view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
e28b769b by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Set favorite button state on updating represented item in detail view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
ec2df159 by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Make favorite button a toggle button

Fixes the on/off state not switching images

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
e6e48568 by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Make targets of detail buttons self in detail view, making action setting work correctly

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
f7266186 by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Make favorite button functional in media item detail view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
a0066418 by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Update current represented item when favorite is toggled

This ensures the underlying media item is updated so that its current
favorite state reflects the media library state

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
f1012ef6 by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Apply top/bottom constraints for all elements in detail view labels

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
73f6b03c by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Add rating control to media item supplementary detail view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
639d8620 by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Set rating on rating indicator on update representation

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
a9026c78 by Claudio Cambra at 2025-01-14T16:26:28+00:00
macosx: Make rating control functional

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


3 changed files:

- modules/gui/macosx/UI/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.xib
- modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.h
- modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.m


Changes:

=====================================
modules/gui/macosx/UI/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.xib
=====================================
@@ -90,10 +90,10 @@
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                     </textFieldCell>
                                 </textField>
-                                <stackView distribution="fill" orientation="horizontal" alignment="top" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="JzZ-K9-xaP">
-                                    <rect key="frame" x="0.0" y="84" width="417" height="16"/>
+                                <stackView distribution="fill" orientation="horizontal" alignment="top" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="JzZ-K9-xaP">
+                                    <rect key="frame" x="0.0" y="147" width="877" height="16"/>
                                     <subviews>
-                                        <button verticalHuggingPriority="750" horizontalCompressionResistancePriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="S5i-gd-zkt">
+                                        <button horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="S5i-gd-zkt">
                                             <rect key="frame" x="0.0" y="0.0" width="196" height="16"/>
                                             <buttonCell key="cell" type="bevel" title="Media item primary detail string" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" truncatesLastVisibleLine="YES" imageScaling="proportionallyDown" inset="2" id="zkC-9p-xFn">
                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -108,7 +108,7 @@
                                             </connections>
                                         </button>
                                         <button verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="9CH-03-Iu3">
-                                            <rect key="frame" x="204" y="0.0" width="213" height="16"/>
+                                            <rect key="frame" x="201" y="0.0" width="655" height="16"/>
                                             <buttonCell key="cell" type="bevel" title="Media item secondary detail string" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" truncatesLastVisibleLine="YES" imageScaling="proportionallyDown" inset="2" id="wPH-tu-Uw1">
                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                 <font key="font" metaFont="system"/>
@@ -121,18 +121,38 @@
                                                 <action selector="secondaryDetailAction:" target="HAc-or-XD8" id="IAX-VG-Kpd"/>
                                             </connections>
                                         </button>
+                                        <button horizontalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="5Ul-IA-Mco">
+                                            <rect key="frame" x="861" y="-2.5" width="16" height="21"/>
+                                            <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="heart" catalog="system" imagePosition="only" alignment="center" alternateImage="heart.fill" imageScaling="proportionallyUpOrDown" inset="2" id="Gzu-E8-QAA">
+                                                <behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
+                                                <font key="font" metaFont="system"/>
+                                            </buttonCell>
+                                            <color key="contentTintColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
+                                            <connections>
+                                                <action selector="favoriteAction:" target="HAc-or-XD8" id="bPB-XU-9uc"/>
+                                            </connections>
+                                        </button>
                                     </subviews>
+                                    <constraints>
+                                        <constraint firstItem="5Ul-IA-Mco" firstAttribute="centerY" secondItem="JzZ-K9-xaP" secondAttribute="centerY" id="7R4-k6-KYR"/>
+                                        <constraint firstAttribute="height" constant="16" id="Xhb-lh-AxX"/>
+                                    </constraints>
                                     <visibilityPriorities>
                                         <integer value="1000"/>
                                         <integer value="1000"/>
+                                        <integer value="1000"/>
                                     </visibilityPriorities>
                                     <customSpacing>
                                         <real value="3.4028234663852886e+38"/>
                                         <real value="3.4028234663852886e+38"/>
+                                        <real value="3.4028234663852886e+38"/>
                                     </customSpacing>
                                 </stackView>
                                 <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QuO-3G-BMT">
-                                    <rect key="frame" x="-2" y="63" width="94" height="16"/>
+                                    <rect key="frame" x="-2" y="126" width="94" height="16"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="16" id="8hg-2f-fip"/>
+                                    </constraints>
                                     <textFieldCell key="cell" lineBreakMode="clipping" title="Year · Duration" id="JBg-wo-ZeE">
                                         <font key="font" metaFont="system"/>
                                         <color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
@@ -140,88 +160,196 @@
                                     </textFieldCell>
                                 </textField>
                                 <stackView distribution="fill" orientation="horizontal" alignment="top" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fiJ-9f-ecF">
-                                    <rect key="frame" x="0.0" y="42" width="106" height="16"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="870" height="142"/>
                                     <subviews>
-                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="NZk-WW-Uay">
-                                            <rect key="frame" x="-2" y="0.0" width="72" height="16"/>
-                                            <textFieldCell key="cell" lineBreakMode="clipping" title="File Name:" id="CyQ-Ao-mup">
-                                                <font key="font" metaFont="systemBold"/>
-                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                            </textFieldCell>
-                                        </textField>
-                                        <textField focusRingType="none" verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="VxL-BW-3eh">
-                                            <rect key="frame" x="71" y="0.0" width="37" height="16"/>
-                                            <textFieldCell key="cell" title="Label" id="Pzf-s3-rHC">
-                                                <font key="font" usesAppearanceFont="YES"/>
-                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                            </textFieldCell>
-                                        </textField>
-                                    </subviews>
-                                    <visibilityPriorities>
-                                        <integer value="1000"/>
-                                        <integer value="1000"/>
-                                    </visibilityPriorities>
-                                    <customSpacing>
-                                        <real value="3.4028234663852886e+38"/>
-                                        <real value="3.4028234663852886e+38"/>
-                                    </customSpacing>
-                                </stackView>
-                                <stackView distribution="fill" orientation="horizontal" alignment="top" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ebw-bB-VfF">
-                                    <rect key="frame" x="0.0" y="21" width="85" height="16"/>
-                                    <subviews>
-                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="uhm-9P-6qk">
-                                            <rect key="frame" x="-2" y="0.0" width="51" height="16"/>
-                                            <textFieldCell key="cell" lineBreakMode="clipping" title="Labels:" id="FCe-hT-5o4">
-                                                <font key="font" metaFont="systemBold"/>
-                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                            </textFieldCell>
-                                        </textField>
-                                        <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HyO-9K-R7L">
-                                            <rect key="frame" x="50" y="0.0" width="37" height="16"/>
-                                            <textFieldCell key="cell" title="Label" id="eIz-b2-2PE">
-                                                <font key="font" usesAppearanceFont="YES"/>
-                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                            </textFieldCell>
-                                        </textField>
-                                    </subviews>
-                                    <constraints>
-                                        <constraint firstAttribute="height" secondItem="HyO-9K-R7L" secondAttribute="height" id="a6R-zu-2jO"/>
-                                    </constraints>
-                                    <visibilityPriorities>
-                                        <integer value="1000"/>
-                                        <integer value="1000"/>
-                                    </visibilityPriorities>
-                                    <customSpacing>
-                                        <real value="3.4028234663852886e+38"/>
-                                        <real value="3.4028234663852886e+38"/>
-                                    </customSpacing>
-                                </stackView>
-                                <stackView distribution="fill" orientation="horizontal" alignment="top" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="B2d-Zo-xAO">
-                                    <rect key="frame" x="0.0" y="0.0" width="72" height="16"/>
-                                    <subviews>
-                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="hEf-79-49a">
-                                            <rect key="frame" x="-2" y="0.0" width="38" height="16"/>
-                                            <textFieldCell key="cell" lineBreakMode="clipping" title="Path:" id="a9t-Zw-74U">
-                                                <font key="font" metaFont="systemBold"/>
-                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                            </textFieldCell>
-                                        </textField>
-                                        <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7gY-3s-Kay">
-                                            <rect key="frame" x="37" y="0.0" width="37" height="16"/>
-                                            <textFieldCell key="cell" title="Label" id="3XB-SJ-5ia">
-                                                <font key="font" usesAppearanceFont="YES"/>
-                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                            </textFieldCell>
-                                        </textField>
+                                        <stackView distribution="fill" orientation="vertical" alignment="leading" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fRH-zv-BlF">
+                                            <rect key="frame" x="0.0" y="0.0" width="79" height="142"/>
+                                            <subviews>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="jeT-l1-TZw">
+                                                    <rect key="frame" x="-2" y="126" width="83" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Rating:" id="vin-X5-wQH">
+                                                        <font key="font" metaFont="systemBold"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="uhm-9P-6qk">
+                                                    <rect key="frame" x="-2" y="105" width="83" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Labels:" id="FCe-hT-5o4">
+                                                        <font key="font" metaFont="systemBold"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="HYi-e3-j6K">
+                                                    <rect key="frame" x="-2" y="84" width="83" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Copyright:" id="FTb-8c-Kqq">
+                                                        <font key="font" metaFont="systemBold"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="F6B-1v-Bg2">
+                                                    <rect key="frame" x="-2" y="63" width="83" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Last played:" id="LfQ-yR-UiL">
+                                                        <font key="font" metaFont="systemBold"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="O20-fr-lHb">
+                                                    <rect key="frame" x="-2" y="42" width="83" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Content:" id="LdZ-IF-3FI">
+                                                        <font key="font" metaFont="systemBold"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="NZk-WW-Uay">
+                                                    <rect key="frame" x="-2" y="21" width="83" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="File name:" id="CyQ-Ao-mup">
+                                                        <font key="font" metaFont="systemBold"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="hEf-79-49a">
+                                                    <rect key="frame" x="-2" y="0.0" width="83" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Path:" id="a9t-Zw-74U">
+                                                        <font key="font" metaFont="systemBold"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="trailing" secondItem="O20-fr-lHb" secondAttribute="trailing" id="Avk-mZ-kvV"/>
+                                                <constraint firstAttribute="trailing" secondItem="HYi-e3-j6K" secondAttribute="trailing" id="B2m-08-6Of"/>
+                                                <constraint firstAttribute="trailing" secondItem="jeT-l1-TZw" secondAttribute="trailing" id="Bn3-s2-Uym"/>
+                                                <constraint firstAttribute="trailing" secondItem="hEf-79-49a" secondAttribute="trailing" id="DCM-2G-n54"/>
+                                                <constraint firstAttribute="trailing" secondItem="F6B-1v-Bg2" secondAttribute="trailing" id="HeU-cb-dP6"/>
+                                                <constraint firstAttribute="trailing" secondItem="uhm-9P-6qk" secondAttribute="trailing" id="qug-q4-wUc"/>
+                                                <constraint firstAttribute="trailing" secondItem="NZk-WW-Uay" secondAttribute="trailing" id="r3e-pC-d3V"/>
+                                            </constraints>
+                                            <visibilityPriorities>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                            </visibilityPriorities>
+                                            <customSpacing>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                            </customSpacing>
+                                        </stackView>
+                                        <stackView distribution="fill" orientation="vertical" alignment="leading" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="B2d-Zo-xAO">
+                                            <rect key="frame" x="84" y="0.0" width="786" height="142"/>
+                                            <subviews>
+                                                <levelIndicator verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lYc-WP-hlc">
+                                                    <rect key="frame" x="0.0" y="126" width="60" height="16"/>
+                                                    <levelIndicatorCell key="cell" editable="YES" alignment="left" doubleValue="5" maxValue="5" levelIndicatorStyle="rating" id="bi9-yf-v6w"/>
+                                                    <color key="fillColor" name="systemYellowColor" catalog="System" colorSpace="catalog"/>
+                                                    <connections>
+                                                        <action selector="ratingAction:" target="HAc-or-XD8" id="K0H-Ga-hji"/>
+                                                    </connections>
+                                                </levelIndicator>
+                                                <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HyO-9K-R7L">
+                                                    <rect key="frame" x="-2" y="105" width="790" height="16"/>
+                                                    <textFieldCell key="cell" title="Label" id="eIz-b2-2PE">
+                                                        <font key="font" usesAppearanceFont="YES"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ebt-AQ-LWK">
+                                                    <rect key="frame" x="-2" y="84" width="37" height="16"/>
+                                                    <textFieldCell key="cell" title="Label" id="e2M-0W-dC5">
+                                                        <font key="font" usesAppearanceFont="YES"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YBs-Jb-5di">
+                                                    <rect key="frame" x="-2" y="63" width="37" height="16"/>
+                                                    <textFieldCell key="cell" title="Label" id="LfQ-cN-QlF">
+                                                        <font key="font" usesAppearanceFont="YES"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2wD-n8-ITx">
+                                                    <rect key="frame" x="-2" y="42" width="37" height="16"/>
+                                                    <textFieldCell key="cell" title="Label" id="d5Z-Y4-LbO">
+                                                        <font key="font" usesAppearanceFont="YES"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="VxL-BW-3eh">
+                                                    <rect key="frame" x="-2" y="21" width="790" height="16"/>
+                                                    <textFieldCell key="cell" title="Label" id="Pzf-s3-rHC">
+                                                        <font key="font" usesAppearanceFont="YES"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" verticalHuggingPriority="750" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="7gY-3s-Kay">
+                                                    <rect key="frame" x="-2" y="0.0" width="790" height="16"/>
+                                                    <textFieldCell key="cell" title="Label" id="3XB-SJ-5ia">
+                                                        <font key="font" usesAppearanceFont="YES"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="trailing" secondItem="HyO-9K-R7L" secondAttribute="trailing" id="cCG-L1-mXP"/>
+                                                <constraint firstAttribute="trailing" secondItem="VxL-BW-3eh" secondAttribute="trailing" id="pfn-eL-Fht"/>
+                                                <constraint firstAttribute="trailing" secondItem="7gY-3s-Kay" secondAttribute="trailing" id="r8P-vM-Um5"/>
+                                            </constraints>
+                                            <visibilityPriorities>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                                <integer value="1000"/>
+                                            </visibilityPriorities>
+                                            <customSpacing>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                                <real value="3.4028234663852886e+38"/>
+                                            </customSpacing>
+                                        </stackView>
                                     </subviews>
                                     <constraints>
-                                        <constraint firstAttribute="height" secondItem="7gY-3s-Kay" secondAttribute="height" id="IFE-XB-miB"/>
+                                        <constraint firstItem="uhm-9P-6qk" firstAttribute="bottom" secondItem="HyO-9K-R7L" secondAttribute="bottom" id="0vs-gO-P5e"/>
+                                        <constraint firstItem="uhm-9P-6qk" firstAttribute="top" secondItem="HyO-9K-R7L" secondAttribute="top" id="3dP-TU-v2E"/>
+                                        <constraint firstItem="hEf-79-49a" firstAttribute="bottom" secondItem="7gY-3s-Kay" secondAttribute="bottom" id="Bvn-kU-xuu"/>
+                                        <constraint firstItem="jeT-l1-TZw" firstAttribute="top" secondItem="lYc-WP-hlc" secondAttribute="top" id="Ffu-Mn-19g"/>
+                                        <constraint firstItem="O20-fr-lHb" firstAttribute="bottom" secondItem="2wD-n8-ITx" secondAttribute="bottom" id="G7j-y4-CwL"/>
+                                        <constraint firstItem="NZk-WW-Uay" firstAttribute="top" secondItem="VxL-BW-3eh" secondAttribute="top" id="QOE-m7-Pdx"/>
+                                        <constraint firstItem="HYi-e3-j6K" firstAttribute="top" secondItem="ebt-AQ-LWK" secondAttribute="top" id="TiH-vu-J5J"/>
+                                        <constraint firstItem="HYi-e3-j6K" firstAttribute="bottom" secondItem="ebt-AQ-LWK" secondAttribute="bottom" id="XCf-hC-7Hi"/>
+                                        <constraint firstItem="F6B-1v-Bg2" firstAttribute="top" secondItem="YBs-Jb-5di" secondAttribute="top" id="cza-bY-cLb"/>
+                                        <constraint firstItem="F6B-1v-Bg2" firstAttribute="bottom" secondItem="YBs-Jb-5di" secondAttribute="bottom" id="hJz-J5-u8P"/>
+                                        <constraint firstItem="hEf-79-49a" firstAttribute="top" secondItem="7gY-3s-Kay" secondAttribute="top" id="sdd-55-2C8"/>
+                                        <constraint firstItem="NZk-WW-Uay" firstAttribute="bottom" secondItem="VxL-BW-3eh" secondAttribute="bottom" id="uLS-za-6mQ"/>
+                                        <constraint firstItem="jeT-l1-TZw" firstAttribute="bottom" secondItem="lYc-WP-hlc" secondAttribute="bottom" id="wPe-Gj-Utf"/>
+                                        <constraint firstItem="O20-fr-lHb" firstAttribute="top" secondItem="2wD-n8-ITx" secondAttribute="top" id="ysc-b4-DWV"/>
                                     </constraints>
                                     <visibilityPriorities>
                                         <integer value="1000"/>
@@ -233,21 +361,21 @@
                                     </customSpacing>
                                 </stackView>
                             </subviews>
+                            <constraints>
+                                <constraint firstAttribute="trailing" secondItem="fiJ-9f-ecF" secondAttribute="trailing" id="EBV-Hj-CYR"/>
+                                <constraint firstAttribute="trailing" secondItem="JzZ-K9-xaP" secondAttribute="trailing" id="sIb-Sq-XfX"/>
+                            </constraints>
                             <visibilityPriorities>
                                 <integer value="1000"/>
                                 <integer value="1000"/>
                                 <integer value="1000"/>
                                 <integer value="1000"/>
-                                <integer value="1000"/>
-                                <integer value="1000"/>
                             </visibilityPriorities>
                             <customSpacing>
                                 <real value="3.4028234663852886e+38"/>
                                 <real value="3.4028234663852886e+38"/>
                                 <real value="3.4028234663852886e+38"/>
                                 <real value="3.4028234663852886e+38"/>
-                                <real value="3.4028234663852886e+38"/>
-                                <real value="3.4028234663852886e+38"/>
                             </customSpacing>
                         </stackView>
                     </subviews>
@@ -281,11 +409,19 @@
                 <outlet property="contentViewRightConstraint" destination="cPm-6m-umY" id="T0p-C1-a7l"/>
                 <outlet property="contentViewTopConstraint" destination="Mr1-w0-CQK" id="T0p-C1-1nv"/>
                 <outlet property="mediaItemArtworkImageView" destination="xZd-Hk-h2M" id="J8l-V9-P06"/>
+                <outlet property="mediaItemContentDescriptionTextField" destination="2wD-n8-ITx" id="TJC-Gc-enx"/>
+                <outlet property="mediaItemContentDescriptionTitleTextField" destination="O20-fr-lHb" id="S8d-Tr-M60"/>
+                <outlet property="mediaItemCopyrightTextField" destination="ebt-AQ-LWK" id="W6S-an-ehZ"/>
+                <outlet property="mediaItemCopyrightTitleTextField" destination="HYi-e3-j6K" id="D0s-mZ-NaH"/>
+                <outlet property="mediaItemFavoriteButton" destination="5Ul-IA-Mco" id="akl-sV-Fon"/>
                 <outlet property="mediaItemFileNameTextField" destination="VxL-BW-3eh" id="fiL-3N-m3P"/>
-                <outlet property="mediaItemLabelsStackView" destination="ebw-bB-VfF" id="nNJ-gF-ib6"/>
                 <outlet property="mediaItemLabelsTextField" destination="HyO-9K-R7L" id="5V0-iU-KA0"/>
+                <outlet property="mediaItemLabelsTitleTextField" destination="uhm-9P-6qk" id="9bz-MW-v1p"/>
+                <outlet property="mediaItemLastPlayedTextField" destination="YBs-Jb-5di" id="K2d-OZ-i3h"/>
+                <outlet property="mediaItemLastPlayedTitleTextField" destination="F6B-1v-Bg2" id="Pla-nv-R8R"/>
                 <outlet property="mediaItemPathTextField" destination="7gY-3s-Kay" id="P4t-h1-m3P"/>
                 <outlet property="mediaItemPrimaryDetailButton" destination="S5i-gd-zkt" id="ssB-Jg-jcf"/>
+                <outlet property="mediaItemRatingIndicator" destination="lYc-WP-hlc" id="PHd-Ka-eS7"/>
                 <outlet property="mediaItemSecondaryDetailButton" destination="9CH-03-Iu3" id="J8O-hB-tHb"/>
                 <outlet property="mediaItemTitleTextField" destination="nCe-dY-YMM" id="h3l-p0-w3e"/>
                 <outlet property="mediaItemYearAndDurationTextField" destination="QuO-3G-BMT" id="y34-rD-uR"/>
@@ -295,6 +431,8 @@
         </view>
     </objects>
     <resources>
+        <image name="heart" catalog="system" width="16" height="14"/>
+        <image name="heart.fill" catalog="system" width="16" height="14"/>
         <image name="no-art" width="128" height="128"/>
         <image name="play.fill" catalog="system" width="12" height="13"/>
         <image name="plus" catalog="system" width="14" height="13"/>


=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.h
=====================================
@@ -35,11 +35,19 @@ extern NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMe
 @property (readwrite, weak) IBOutlet NSTextField *mediaItemTitleTextField;
 @property (readwrite, weak) IBOutlet NSButton *mediaItemPrimaryDetailButton;
 @property (readwrite, weak) IBOutlet NSButton *mediaItemSecondaryDetailButton;
+ at property (readwrite, weak) IBOutlet NSButton *mediaItemFavoriteButton;
 @property (readwrite, weak) IBOutlet NSTextField *mediaItemYearAndDurationTextField;
+ at property (readwrite, weak) IBOutlet NSLevelIndicator *mediaItemRatingIndicator;
 @property (readwrite, weak) IBOutlet NSTextField *mediaItemFileNameTextField;
 @property (readwrite, weak) IBOutlet NSTextField *mediaItemPathTextField;
- at property (readwrite, weak) IBOutlet NSStackView *mediaItemLabelsStackView;
+ at property (readwrite, weak) IBOutlet NSTextField *mediaItemLabelsTitleTextField;
 @property (readwrite, weak) IBOutlet NSTextField *mediaItemLabelsTextField;
+ at property (readwrite, weak) IBOutlet NSTextField *mediaItemLastPlayedTextField;
+ at property (readwrite, weak) IBOutlet NSTextField *mediaItemLastPlayedTitleTextField;
+ at property (readwrite, weak) IBOutlet NSTextField *mediaItemCopyrightTextField;
+ at property (readwrite, weak) IBOutlet NSTextField *mediaItemCopyrightTitleTextField;
+ at property (readwrite, weak) IBOutlet NSTextField *mediaItemContentDescriptionTextField;
+ at property (readwrite, weak) IBOutlet NSTextField *mediaItemContentDescriptionTitleTextField;
 @property (readwrite, weak) IBOutlet VLCImageView *mediaItemArtworkImageView;
 @property (readwrite, weak) IBOutlet NSButton *playMediaItemButton;
 


=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.m
=====================================
@@ -110,15 +110,51 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem
         self.mediaItemPrimaryDetailButton.contentTintColor = primaryDetailButtonColor;
         self.mediaItemSecondaryDetailButton.contentTintColor = secondaryDetailButtonColor;
     }
+    self.mediaItemFavoriteButton.state = actualItem.favorited ? NSOnState : NSOffState;
+
+    self.mediaItemPrimaryDetailButton.target = self;
+    self.mediaItemSecondaryDetailButton.target = self;
+    self.mediaItemFavoriteButton.target = self;
+
     self.mediaItemPrimaryDetailButton.action = @selector(primaryDetailAction:);
     self.mediaItemSecondaryDetailButton.action = @selector(secondaryDetailAction:);
+    self.mediaItemFavoriteButton.action = @selector(favoriteAction:);
+
+    const double ratingControlMax = self.mediaItemRatingIndicator.maxValue;
+    const double proportionOfMaxRating = 100 / ratingControlMax;
+    self.mediaItemRatingIndicator.doubleValue = (double)actualItem.rating / proportionOfMaxRating;
 
     NSArray<NSString *> * const mediaItemLabels = self.representedItem.item.labels;
-    self.mediaItemLabelsStackView.hidden = mediaItemLabels.count == 0;
-    if (!self.mediaItemLabelsStackView.hidden) {
+    self.mediaItemLabelsTextField.hidden = mediaItemLabels.count == 0;
+    self.mediaItemLabelsTitleTextField.hidden = self.mediaItemLabelsTextField.hidden;
+    if (!self.mediaItemLabelsTextField.hidden) {
         self.mediaItemLabelsTextField.stringValue = [mediaItemLabels componentsJoinedByString:@", "];
     }
 
+    self.mediaItemLastPlayedTextField.hidden = actualItem.lastPlayedDate == 0;
+    self.mediaItemLastPlayedTitleTextField.hidden = self.mediaItemLastPlayedTextField.hidden;
+    if (actualItem.lastPlayedDate > 0) {
+        NSDate * const lastPlayedDate =
+            [NSDate dateWithTimeIntervalSince1970:actualItem.lastPlayedDate];
+        NSDateFormatter * const formatter = [[NSDateFormatter alloc] init];
+        formatter.dateStyle = NSDateFormatterFullStyle;
+        formatter.timeStyle = NSDateFormatterFullStyle;
+        NSString * const lastPlayedString = [formatter stringFromDate:lastPlayedDate];
+        self.mediaItemLastPlayedTextField.stringValue = lastPlayedString;
+    }
+
+    VLCInputItem * const inputItem = actualItem.inputItem;
+
+    NSString * const copyright = inputItem.copyright;
+    self.mediaItemCopyrightTextField.hidden = [copyright isEqualToString:@""];
+    self.mediaItemCopyrightTitleTextField.hidden = self.mediaItemCopyrightTextField.hidden;
+    self.mediaItemCopyrightTextField.stringValue = copyright;
+
+    NSString * const contentDescription = inputItem.contentDescription;
+    self.mediaItemContentDescriptionTextField.hidden = [contentDescription isEqualToString:@""];
+    self.mediaItemContentDescriptionTitleTextField.hidden = self.mediaItemContentDescriptionTextField.hidden;
+    self.mediaItemContentDescriptionTextField.stringValue = contentDescription;
+
     [VLCLibraryImageCache thumbnailForLibraryItem:actualItem withCompletion:^(NSImage * const thumbnail) {
         if (self.representedItem.item != actualItem) {
             return;
@@ -161,4 +197,36 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem
     [libraryWindow presentLibraryItem:libraryItem];
 }
 
+- (IBAction)favoriteAction:(id)sender
+{
+    VLCMediaLibraryMediaItem * const mediaItem = self.representedItem.item;
+    const int64_t mediaItemId = mediaItem.libraryID;
+    const bool b_favorite = mediaItem.favorited;
+    vlc_medialibrary_t * const p_ml = vlc_ml_instance_get(getIntf());
+    const int result = vlc_ml_media_set_favorite(p_ml, mediaItemId, !b_favorite);
+
+    if (result == VLC_SUCCESS) {
+        VLCMediaLibraryMediaItem * const updatedItem =
+            [VLCMediaLibraryMediaItem mediaItemForLibraryID:mediaItemId];
+        self.representedItem =
+            [[VLCLibraryRepresentedItem alloc] initWithItem:updatedItem
+                                                 parentType:self.representedItem.parentType];
+
+    } else {
+        NSLog(@"Unable to set favorite status of media item: %lli", mediaItemId);
+    }
+}
+
+- (IBAction)ratingAction:(id)sender
+{
+    NSLevelIndicator * const control = (NSLevelIndicator *)sender;
+    if (control == nil) {
+        return;
+    }
+
+    const double proportion = 100 / control.maxValue;
+    const double rating = control.doubleValue * proportion;
+    ((VLCMediaLibraryMediaItem *)self.representedItem.item).rating = (int)rating;
+}
+
 @end



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9e5e5ca6125de7b086f12c6cacb99d9a493106b1...a9026c7868c5875bf0aa8683facbb5fe0955a376

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9e5e5ca6125de7b086f12c6cacb99d9a493106b1...a9026c7868c5875bf0aa8683facbb5fe0955a376
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list