Last active
July 24, 2021 06:17
-
-
Save steventroughtonsmith/ad7eda38c797dfddc394 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