Skip to content

Commit

Permalink
UI: Changed how "Follow" button works, now it spawns a menu with list…
Browse files Browse the repository at this point in the history
… of links

Added Mastodon!
  • Loading branch information
vashpan committed Sep 26, 2023
1 parent 2758cb0 commit efef779
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 47 deletions.

This file was deleted.

Binary file not shown.
Binary file not shown.
60 changes: 38 additions & 22 deletions DevCleaner/View Controllers/Main Window/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@
<objects>
<viewController id="XfG-lQ-9wD" customClass="MainViewController" customModule="DevCleaner" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" wantsLayer="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="516" height="670"/>
<rect key="frame" x="0.0" y="0.0" width="496" height="686"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qY4-v6-aG6" userLabel="Clean Button">
<rect key="frame" x="423" y="13" width="80" height="32"/>
<rect key="frame" x="363" y="13" width="80" height="32"/>
<buttonCell key="cell" type="push" title="Clean..." bezelStyle="rounded" alignment="center" enabled="NO" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="wpS-RA-DUz">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -218,12 +218,12 @@ DQ
</connections>
</button>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="eBx-hh-WZ7" userLabel="Main Views Container">
<rect key="frame" x="20" y="94" width="476" height="400"/>
<rect key="frame" x="20" y="94" width="416" height="400"/>
<subviews>
<scrollView autohidesScrollers="YES" horizontalLineScroll="21" horizontalPageScroll="10" verticalLineScroll="21" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ynz-vf-S6e">
<rect key="frame" x="0.0" y="0.0" width="476" height="400"/>
<rect key="frame" x="0.0" y="0.0" width="416" height="400"/>
<clipView key="contentView" drawsBackground="NO" id="dr2-Zy-P8I">
<rect key="frame" x="1" y="1" width="474" height="398"/>
<rect key="frame" x="1" y="1" width="414" height="398"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" rowHeight="18" rowSizeStyle="automatic" headerView="v75-Hl-aeO" viewBased="YES" indentationPerLevel="18" outlineTableColumn="WoQ-aT-xsT" id="xU2-il-hl0">
Expand Down Expand Up @@ -341,7 +341,7 @@ DQ
<nil key="backgroundColor"/>
</clipView>
<scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="p1y-QG-xIv">
<rect key="frame" x="1" y="383" width="474" height="16"/>
<rect key="frame" x="1" y="383" width="414" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="3Uz-J4-Lkn">
Expand All @@ -354,7 +354,7 @@ DQ
</tableHeaderView>
</scrollView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Ck5-KW-Rls" userLabel="Access Warnings View">
<rect key="frame" x="-45" y="138" width="566" height="124"/>
<rect key="frame" x="-75" y="138" width="566" height="124"/>
<subviews>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="WG2-fv-9kB">
<rect key="frame" x="18" y="80" width="530" height="24"/>
Expand Down Expand Up @@ -396,7 +396,7 @@ DQ
</constraints>
</customView>
<progressIndicator hidden="YES" wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="kWj-vG-o6z">
<rect key="frame" x="222" y="184" width="32" height="32"/>
<rect key="frame" x="192" y="184" width="32" height="32"/>
</progressIndicator>
</subviews>
<constraints>
Expand All @@ -412,15 +412,15 @@ DQ
</constraints>
</customView>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="8Gh-Ea-jZF">
<rect key="frame" x="20" y="564" width="67" height="67"/>
<rect key="frame" x="20" y="580" width="67" height="67"/>
<constraints>
<constraint firstAttribute="width" constant="67" id="HEL-Qg-Gzh"/>
<constraint firstAttribute="height" constant="67" id="t77-jf-oZ9"/>
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="DevCleanerIcon" id="guH-2t-Xph"/>
</imageView>
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="RaE-kH-QJe">
<rect key="frame" x="93" y="514" width="405" height="112"/>
<rect key="frame" x="93" y="514" width="345" height="128"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="AcK-WQ-6Fn">
<font key="font" metaFont="system"/>
<string key="title">Xcode generates large amount of cached data that could be beneficial to development speed but also tends to consume large amount of data on your hard drive. This tool allows to clean those caches allowing you to decide what you need and what not.

There's absolutely no warranty and you're using this tool for your responsibility!</string>
Expand All @@ -429,7 +429,7 @@ DQ
</textFieldCell>
</textField>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="pF6-87-JUR" userLabel="Info Header Label">
<rect key="frame" x="93" y="634" width="405" height="16"/>
<rect key="frame" x="93" y="650" width="345" height="16"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Clean your Xcode cache files" id="8Ix-rm-3dw">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -445,10 +445,10 @@ DQ
</textFieldCell>
</textField>
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="0Yp-uh-F76">
<rect key="frame" x="20" y="58" width="476" height="5"/>
<rect key="frame" x="20" y="58" width="416" height="5"/>
</box>
<button horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="S06-6o-y2V">
<rect key="frame" x="17" y="16" width="25" height="25"/>
<rect key="frame" x="17" y="16" width="13" height="25"/>
<buttonCell key="cell" type="help" bezelStyle="helpButton" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="pba-GW-CWa">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -458,15 +458,15 @@ DQ
</connections>
</button>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lXf-LO-pmC">
<rect key="frame" x="412" y="69" width="86" height="17"/>
<rect key="frame" x="352" y="69" width="86" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Total: 0 bytes" id="4fM-lu-IeX">
<font key="font" metaFont="system"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nSL-jb-aDV">
<rect key="frame" x="48" y="10" width="84" height="19"/>
<rect key="frame" x="36" y="10" width="84" height="19"/>
<buttonCell key="cell" type="roundRect" title="🤓 Tip me..." bezelStyle="roundedRect" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="pdM-2l-xC7">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/>
Expand All @@ -476,7 +476,7 @@ DQ
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Jk9-Oc-a0l">
<rect key="frame" x="140" y="10" width="58" height="19"/>
<rect key="frame" x="128" y="10" width="58" height="19"/>
<buttonCell key="cell" type="roundRect" title="Share..." bezelStyle="roundedRect" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="3Q1-Dr-Ffd">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/>
Expand All @@ -486,17 +486,18 @@ DQ
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Mia-rv-zCw">
<rect key="frame" x="206" y="10" width="70" height="19"/>
<buttonCell key="cell" type="roundRect" title="Follow" bezelStyle="roundedRect" image="TwitterIcon" imagePosition="leading" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="kAe-M1-9nY">
<rect key="frame" x="194" y="10" width="64" height="19"/>
<buttonCell key="cell" type="roundRect" title="Follow..." bezelStyle="roundedRect" imagePosition="leading" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="kAe-M1-9nY">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/>
</buttonCell>
<connections>
<action selector="followMeOnTwitter:" target="XfG-lQ-9wD" id="Bri-Er-OWJ"/>
<action selector="openFollowMenu:" target="XfG-lQ-9wD" id="dUa-yl-Qbo"/>
<outlet property="menu" destination="OsU-g0-uj3" id="uw0-Jd-qb0"/>
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jjO-ih-b0v">
<rect key="frame" x="284" y="10" width="64" height="19"/>
<rect key="frame" x="266" y="10" width="64" height="19"/>
<buttonCell key="cell" type="roundRect" title="Review..." bezelStyle="roundedRect" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Ee3-8t-HIR">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/>
Expand All @@ -506,7 +507,7 @@ DQ
</connections>
</button>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qHE-u2-bEP">
<rect key="frame" x="46" y="37" width="404" height="15"/>
<rect key="frame" x="34" y="37" width="404" height="15"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="400" id="Njh-fQ-xCA"/>
</constraints>
Expand Down Expand Up @@ -578,6 +579,22 @@ DQ
</connections>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
<menu title="Follow Menu" id="OsU-g0-uj3" userLabel="Follow Menu">
<items>
<menuItem title="Mastodon" id="FWi-c7-FUc">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="followMeOnMastodon:" target="XfG-lQ-9wD" id="ao9-I1-qPE"/>
</connections>
</menuItem>
<menuItem title="Twitter (X)" id="wBT-HD-bfl">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="followMeOnTwitter:" target="XfG-lQ-9wD" id="aW6-LV-8tN"/>
</connections>
</menuItem>
</items>
</menu>
<menu title="Entries Menu" autoenablesItems="NO" id="JKM-eE-XhK" userLabel="Entries Menu">
<items>
<menuItem title="Show in Finder" tag="1001" enabled="NO" id="me3-fP-eUu">
Expand Down Expand Up @@ -753,6 +770,5 @@ DQ
<resources>
<image name="DevCleanerIcon" width="256" height="256"/>
<image name="NSFolder" width="32" height="32"/>
<image name="TwitterIcon" width="12.5" height="10"/>
</resources>
</document>
20 changes: 20 additions & 0 deletions DevCleaner/View Controllers/Main Window/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,18 @@ final class MainViewController: NSViewController {
ReviewRequests.shared.showReviewOnTheAppStore()
}

@IBAction func openFollowMenu(_ sender: NSButton) {
guard let followMenu = sender.menu else {
return
}

guard let event = NSApplication.shared.currentEvent else {
return
}

NSMenu.popUpContextMenu(followMenu, with: event, for: sender)
}

@IBAction func followMeOnTwitter(_ sender: Any) {
guard let myTwitterUrl = URL(string: "https://twitter.com/intent/follow?screen_name=vashpan") else {
return
Expand All @@ -436,6 +448,14 @@ final class MainViewController: NSViewController {
NSWorkspace.shared.open(myTwitterUrl)
}

@IBAction func followMeOnMastodon(_ sender: Any) {
guard let myMastodonUrl = URL(string: "https://mastodon.social/@kkolakowski") else {
return
}

NSWorkspace.shared.open(myMastodonUrl)
}

@IBAction func downloadXcode(_ sender: Any) {
guard let xcodeUrl = URL(string: "https://apps.apple.com/pl/app/xcode/id497799835?") else {
return
Expand Down

0 comments on commit efef779

Please sign in to comment.