Skip to content

Commit

Permalink
Support resize of music mode window, and other fixes & improvements:
Browse files Browse the repository at this point in the history
- Enforce separate resize logic when showing vs. not showing the playlist. When showing the playlist, playlist cannot be reduced to less than its minimum size.  When not showing the playlist, resizing alone will not show the playlist.
- Save & restore the size & position of the music mode window between launches. Save state of playlist visibility after resize. Save playlist height in prefs. Make max width of music mode window into pref. Fix bugs preventing restore of window size & position when videoView not shown.
- Fix "toggle playlist" button logic so it works more reliably.
- Add logic to prevent play controls from being pushed off screen during resize.
- Fix unwanted highlight of tabs
- Fix incorrect aspect ratio of video when changing tracks
- Refactor ScrollingTextField to support variable window width.
  • Loading branch information
svobs committed Aug 3, 2023
1 parent 63353c7 commit 4bc5ce6
Show file tree
Hide file tree
Showing 6 changed files with 396 additions and 292 deletions.
254 changes: 126 additions & 128 deletions iina/Base.lproj/MiniPlayerWindowController.xib

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions iina/Base.lproj/PlaylistViewController.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -29,14 +29,14 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Hz6-mo-xeY" customClass="PlaylistView" customModule="IINA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="241" height="285"/>
<rect key="frame" x="0.0" y="0.0" width="241" height="284"/>
<subviews>
<stackView distribution="fillEqually" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="250" verticalStackHuggingPriority="250" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EHy-pe-5wJ">
<rect key="frame" x="0.0" y="237" width="241" height="48"/>
<stackView distribution="fillEqually" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="250" verticalStackHuggingPriority="250" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EHy-pe-5wJ" userLabel="TabButtons Stack View">
<rect key="frame" x="0.0" y="235" width="241" height="48"/>
<subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="5Zq-JQ-XO4">
<rect key="frame" x="8" y="0.0" width="109" height="48"/>
<buttonCell key="cell" type="square" title="PLAYLIST" bezelStyle="shadowlessSquare" alignment="center" lineBreakMode="truncatingMiddle" imageScaling="proportionallyDown" inset="2" id="fAq-Pq-ThP">
<buttonCell key="cell" type="square" title="PLAYLIST" bezelStyle="shadowlessSquare" alignment="center" lineBreakMode="truncatingMiddle" refusesFirstResponder="YES" imageScaling="proportionallyDown" inset="2" id="fAq-Pq-ThP">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="systemBold"/>
</buttonCell>
Expand All @@ -46,9 +46,9 @@
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="SOR-3l-PFj">
<rect key="frame" x="125" y="0.0" width="108" height="48"/>
<buttonCell key="cell" type="square" title="CHAPTERS" bezelStyle="shadowlessSquare" alignment="center" lineBreakMode="truncatingMiddle" imageScaling="proportionallyDown" inset="2" id="jUF-xa-uRI">
<buttonCell key="cell" type="square" title="CHAPTERS" bezelStyle="shadowlessSquare" alignment="center" lineBreakMode="truncatingMiddle" refusesFirstResponder="YES" imageScaling="proportionallyDown" inset="2" id="jUF-xa-uRI">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<font key="font" metaFont="systemBold"/>
</buttonCell>
<connections>
<action selector="chaptersBtnAction:" target="-2" id="Gpo-6e-oRu"/>
Expand All @@ -71,25 +71,25 @@
</customSpacing>
</stackView>
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="glW-5x-LJr">
<rect key="frame" x="0.0" y="235" width="241" height="5"/>
<rect key="frame" x="0.0" y="233" width="241" height="5"/>
</box>
<tabView drawsBackground="NO" type="noTabsNoBorder" translatesAutoresizingMaskIntoConstraints="NO" id="Yym-Zw-Hd8">
<rect key="frame" x="0.0" y="0.0" width="241" height="238"/>
<rect key="frame" x="0.0" y="0.0" width="241" height="236"/>
<font key="font" metaFont="system"/>
<tabViewItems>
<tabViewItem label="Playlist" identifier="1" id="rjs-Qf-mT6">
<view key="view" id="BXH-zz-cse">
<rect key="frame" x="0.0" y="0.0" width="241" height="241"/>
<rect key="frame" x="0.0" y="0.0" width="241" height="236"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="28" horizontalPageScroll="10" verticalLineScroll="28" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="n5h-uy-hbd">
<rect key="frame" x="0.0" y="24" width="236" height="217"/>
<rect key="frame" x="0.0" y="24" width="236" height="212"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="2M9-8L-veI">
<rect key="frame" x="0.0" y="0.0" width="236" height="217"/>
<rect key="frame" x="0.0" y="0.0" width="236" height="212"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" tableStyle="fullWidth" columnResizing="NO" autosaveColumns="NO" rowHeight="26" viewBased="YES" id="xIa-sI-0Xn">
<rect key="frame" x="0.0" y="0.0" width="236" height="217"/>
<rect key="frame" x="0.0" y="0.0" width="236" height="212"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.080000000000000002" colorSpace="calibratedRGB"/>
Expand Down Expand Up @@ -379,7 +379,7 @@
<rect key="frame" x="0.0" y="0.0" width="241" height="288"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="6tr-hz-bdD">
<rect key="frame" x="0.0" y="0.0" width="241" height="288"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="fullWidth" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="31" rowSizeStyle="automatic" viewBased="YES" id="BvG-MR-6LX">
<rect key="frame" x="0.0" y="0.0" width="241" height="288"/>
Expand Down
Loading

0 comments on commit 4bc5ce6

Please sign in to comment.