Forked from steventroughtonsmith/Show Tab Overview.py
Created
November 4, 2020 05:24
-
-
Save esprengle/2be02f45dfc9f6cc19bd3a88aaf780b4 to your computer and use it in GitHub Desktop.
'Show Tab Overview' script for Pythonista - adds button to toolbar to show tab overview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf-8 | |
| from objc_util import * | |
| UIApplication = ObjCClass('UIApplication') | |
| UIBarButtonItem = ObjCClass('UIBarButtonItem') | |
| @on_main_thread | |
| def main(): | |
| rootVC = UIApplication.sharedApplication().keyWindow().rootViewController() | |
| tabVC = rootVC.detailViewController() | |
| tabVC.tabCollectionView().collectionViewLayout().itemSize = CGSize(328,200) | |
| tabVC.tabCollectionView().contentInset = UIEdgeInsets(58,0,0,0) | |
| overviewItem = UIBarButtonItem.alloc().initWithImage_style_target_action_(UIImage.imageNamed_('ShowTabs'), 0, tabVC, sel('showTabOverview:')) | |
| tabVC.persistentLeftBarButtonItems = [overviewItem] | |
| tabVC.reloadBarButtonItemsForSelectedTab() | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment