[vlc-commits] [Git][videolan/vlc][master] 5 commits: macosx: Make information window resizeable

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sat Mar 8 12:50:37 UTC 2025


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


Commits:
f4d2284d by Claudio Cambra at 2025-03-08T11:52:42+00:00
macosx: Make information window resizeable

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

- - - - -
3fef15c0 by Claudio Cambra at 2025-03-08T11:52:42+00:00
macosx: Convert information window codec details outline view into a view-based outline view

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

egwg

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

afefa

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

- - - - -
eeebd99d by Claudio Cambra at 2025-03-08T11:52:42+00:00
macosx: Use modern dot syntax in property access in information window

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

- - - - -
0cd16bfb by Claudio Cambra at 2025-03-08T11:52:42+00:00
macosx: Ensure last column of codec info view always takes largest available width

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

- - - - -
35efb88e by Claudio Cambra at 2025-03-08T11:52:42+00:00
macosx: Fix indentation in NSOutlineView for codecs in information window

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

- - - - -


2 changed files:

- modules/gui/macosx/UI/VLCInformationWindow.xib
- modules/gui/macosx/panels/VLCInformationWindowController.m


Changes:

=====================================
modules/gui/macosx/UI/VLCInformationWindow.xib
=====================================
@@ -89,7 +89,7 @@
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <window title="Media Information" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="mediainfo" animationBehavior="default" id="2" userLabel="Media Information" customClass="NSPanel">
-            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" utility="YES" HUD="YES"/>
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" utility="YES" HUD="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="34" width="506" height="476"/>
             <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
@@ -599,14 +599,14 @@
                                                 <rect key="frame" x="0.0" y="0.0" width="510" height="440"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <subviews>
-                                                    <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" indentationPerLevel="16" autoresizesOutlineColumn="YES" outlineTableColumn="521" id="519">
-                                                        <rect key="frame" x="0.0" y="0.0" width="510" height="440"/>
+                                                    <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="16" indentationMarkerFollowsCell="NO" autoresizesOutlineColumn="YES" outlineTableColumn="521" id="519">
+                                                        <rect key="frame" x="0.0" y="0.0" width="494" height="440"/>
                                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                         <size key="intercellSpacing" width="3" height="2"/>
                                                         <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                         <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
                                                         <tableColumns>
-                                                            <tableColumn identifier="0" editable="NO" width="241.91015625" minWidth="16" maxWidth="1000" id="521">
+                                                            <tableColumn identifier="0" editable="NO" width="242" minWidth="16" maxWidth="1000" id="521">
                                                                 <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
                                                                     <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
                                                                     <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
@@ -617,8 +617,28 @@
                                                                     <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                                 </textFieldCell>
                                                                 <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+                                                                <prototypeCellViews>
+                                                                    <tableCellView id="sWh-xo-F0z">
+                                                                        <rect key="frame" x="11" y="1" width="254" height="17"/>
+                                                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                                        <subviews>
+                                                                            <textField identifier="VLCInformationWindowPropertyNameCell" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="aQy-jV-OVS">
+                                                                                <rect key="frame" x="0.0" y="1" width="254" height="16"/>
+                                                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+                                                                                <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="S8v-2v-4vD">
+                                                                                    <font key="font" usesAppearanceFont="YES"/>
+                                                                                    <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                                                </textFieldCell>
+                                                                            </textField>
+                                                                        </subviews>
+                                                                        <connections>
+                                                                            <outlet property="textField" destination="aQy-jV-OVS" id="hPV-Nv-lEm"/>
+                                                                        </connections>
+                                                                    </tableCellView>
+                                                                </prototypeCellViews>
                                                             </tableColumn>
-                                                            <tableColumn identifier="1" editable="NO" width="233" minWidth="10" maxWidth="3.4028234663852886e+38" id="644">
+                                                            <tableColumn identifier="1" editable="NO" width="217" minWidth="16" maxWidth="3.4028234663852886e+38" id="644">
                                                                 <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
                                                                     <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
                                                                     <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
@@ -629,6 +649,26 @@
                                                                     <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                                 </textFieldCell>
                                                                 <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+                                                                <prototypeCellViews>
+                                                                    <tableCellView id="AiZ-f9-liR">
+                                                                        <rect key="frame" x="261" y="1" width="227" height="17"/>
+                                                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                                        <subviews>
+                                                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oPm-Le-K3W">
+                                                                                <rect key="frame" x="0.0" y="1" width="227" height="16"/>
+                                                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+                                                                                <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="F2n-nI-GbZ">
+                                                                                    <font key="font" usesAppearanceFont="YES"/>
+                                                                                    <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                                                </textFieldCell>
+                                                                            </textField>
+                                                                        </subviews>
+                                                                        <connections>
+                                                                            <outlet property="textField" destination="oPm-Le-K3W" id="WSP-1y-2Ac"/>
+                                                                        </connections>
+                                                                    </tableCellView>
+                                                                </prototypeCellViews>
                                                             </tableColumn>
                                                         </tableColumns>
                                                     </outlineView>


=====================================
modules/gui/macosx/panels/VLCInformationWindowController.m
=====================================
@@ -88,7 +88,7 @@ actionCallback(encodedBy);
 
 #pragma mark - window controller
 
- at interface VLCInformationWindowController () <NSOutlineViewDataSource>
+ at interface VLCInformationWindowController () <NSOutlineViewDataSource, NSOutlineViewDelegate>
 {
     VLCCodecInformationTreeItem *_rootCodecInformationItem;
     NSImage *_artwork;
@@ -119,6 +119,8 @@ actionCallback(encodedBy);
     [self.window setInitialFirstResponder: _decodedMRLLabel];
 
     self.outlineView.dataSource = self;
+    self.outlineView.delegate = self;
+    self.outlineView.tableColumns.lastObject.resizingMask = NSTableColumnAutoresizingMask;
 
     NSNotificationCenter * const notificationCenter = NSNotificationCenter.defaultCenter;
     if (_mainMenuInstance && _statisticsEnabled) {
@@ -603,8 +605,9 @@ _##field##TextField.originalStateString = @"";
         [self updateStreamsForInputItems:_representedInputItems];
     }
 
-    [_outlineView reloadData];
-    [_outlineView expandItem:nil expandChildren:YES];
+    [self.outlineView reloadData];
+    [self.outlineView expandItem:nil expandChildren:YES];
+    [self.outlineView sizeLastColumnToFit];
 }
 
 - (void)controlTextDidChange:(NSNotification *)notification
@@ -709,25 +712,25 @@ SET_INPUTITEM_PROP(field, field)                \
 
 @end
 
- at implementation VLCInformationWindowController (NSTableDataSource)
+ at implementation VLCInformationWindowController (NSOutlineViewDataSource)
 
 - (NSInteger)outlineView:(NSOutlineView *)outlineView
   numberOfChildrenOfItem:(id)item
 {
-    return (item == nil) ? [_rootCodecInformationItem children].count : [item children].count;
+    return (item == nil) ? _rootCodecInformationItem.children.count : [item children].count;
 }
 
 - (BOOL)outlineView:(NSOutlineView *)outlineView
    isItemExpandable:(id)item
 {
-    return ([item children].count > 0);
+    return [item children].count > 0;
 }
 
 - (id)outlineView:(NSOutlineView *)outlineView
             child:(NSInteger)index
            ofItem:(id)item
 {
-    return (item == nil) ? [_rootCodecInformationItem children][index] : [item children][index];
+    return (item == nil) ? _rootCodecInformationItem.children[index] : [item children][index];
 }
 
 - (id)outlineView:(NSOutlineView *)outlineView
@@ -745,3 +748,20 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
 }
 
 @end
+
+ at implementation VLCInformationWindowController (NSOutlineViewDelegate)
+
+- (NSView *)outlineView:(NSTableView *)outlineView
+     viewForTableColumn:(nullable NSTableColumn *)tableColumn
+                   item:(nonnull id)item
+{
+    NSTextField * const cellView = [[NSTextField alloc] initWithFrame:NSZeroRect];
+    cellView.objectValue =
+        [self outlineView:self.outlineView objectValueForTableColumn:tableColumn byItem:item];
+    cellView.editable = NO;
+    cellView.bordered = NO;
+    cellView.drawsBackground = NO;
+    return cellView;
+}
+
+ at end



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2564699fa2c51bb969a2ca0ff76788005dc1968b...35efb88e555a750ad767f4e2b7e33547b6aae556

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2564699fa2c51bb969a2ca0ff76788005dc1968b...35efb88e555a750ad767f4e2b7e33547b6aae556
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