]> git.saurik.com Git - cydia.git/commitdiff
Fix viewport issues with landscape and web document view's frame.y property becoming...
authorRyan Petrich <rpetrich@gmail.com>
Thu, 23 Sep 2010 02:17:41 +0000 (20:17 -0600)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Sep 2010 10:42:37 +0000 (10:42 +0000)
Cydia.mm
UICaboodle/BrowserView.mm

index a204e88709c786055ff15ee9a276638aaed1d057..01258df475993edbedaa1f5d1cd8f62e86fa9814 100644 (file)
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -5295,7 +5295,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 
         if (special_ != NULL) {
             CGRect frame([document_ frame]);
-            frame.size.width = 320;
             frame.size.height = 0;
             [document_ setFrame:frame];
 
index 9bfeb7901737251ab1f09f55adfef7c4c867efab..4523f91b37226c0269db9f31a3605fa95605609f 100644 (file)
@@ -148,6 +148,30 @@ static Class $UIWebBrowserView;
 
 @end
 
+@interface BrowserViewActualView : UIView {
+@private
+    UIWebDocumentView *documentView;
+}
+@property (nonatomic, retain) UIWebDocumentView *documentView;
+@end
+
+@implementation BrowserViewActualView
+
+@synthesize documentView;
+
+- (void)dealloc {
+    [documentView release];
+    [super dealloc];
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    if ([documentView respondsToSelector:@selector(setMinimumSize:)])
+        [documentView setMinimumSize:documentView.bounds.size];
+}
+
+@end
+
 #define ShowInternals 0
 #define LogBrowser 1
 
@@ -1258,6 +1282,9 @@ static Class $UIWebBrowserView;
         loading_ = [[NSMutableSet alloc] initWithCapacity:3];
         popup_ = false;
 
+        BrowserViewActualView *actualView = [[BrowserViewActualView alloc] initWithFrame:CGRectZero];
+        [self setView:actualView];
+        
         struct CGRect bounds = [[self view] bounds];
 
         scroller_ = [[objc_getClass(Wildcat_ ? "UIScrollView" : "UIScroller") alloc] initWithFrame:bounds];
@@ -1377,6 +1404,9 @@ static Class $UIWebBrowserView;
             else
                 [preferences _setLayoutInterval:0];
         }
+        
+        actualView.documentView = document_;
+        [actualView release];
 
         [self setViewportWidth:width];
 
@@ -1411,7 +1441,7 @@ static Class $UIWebBrowserView;
 
         [scroller_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
         [indicator_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];
-        [document_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
+        [document_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
 
         /*UIWebView *test([[[UIWebView alloc] initWithFrame:[[self view] bounds]] autorelease]);
         [test loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.saurik.com/"]]];