[vlc-commits] macosx: fix resizing issue when updating lua extension dialogs ( close #14457)

Felix Paul Kühne git at videolan.org
Mon Sep 28 16:12:24 CEST 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Sep 28 16:09:57 2015 +0200| [456ec97fdab16c049f472266a841fa27c14eec87] | committer: Felix Paul Kühne

macosx: fix resizing issue when updating lua extension dialogs (close #14457)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=456ec97fdab16c049f472266a841fa27c14eec87
---

 modules/gui/macosx/ExtensionsDialogProvider.m |    4 ++--
 modules/gui/macosx/VLCUIWidgets.h             |    7 ++++++-
 modules/gui/macosx/VLCUIWidgets.m             |   20 +++++++++++++++++++-
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/ExtensionsDialogProvider.m b/modules/gui/macosx/ExtensionsDialogProvider.m
index 407edb8..6d6bb57 100644
--- a/modules/gui/macosx/ExtensionsDialogProvider.m
+++ b/modules/gui/macosx/ExtensionsDialogProvider.m
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * ExtensionsDialogProvider.m: Mac OS X Extensions Dialogs
  *****************************************************************************
- * Copyright (C) 2010-2013 VLC authors and VideoLAN
+ * Copyright (C) 2010-2015 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Pierre d'Herbemont <pdherbemont # videolan org>
@@ -407,7 +407,7 @@ static int extensionDialogCallback(vlc_object_t *p_this, const char *psz_variabl
             }
 
             VLCDialogGridView *gridView = (VLCDialogGridView *)[dialogWindow contentView];
-            [gridView addSubview:control atRow:row column:col rowSpan:vsp colSpan:hsp];
+            [gridView updateSubview:control atRow:row column:col rowSpan:vsp colSpan:hsp];
 
             widget->b_update = false;
         }
diff --git a/modules/gui/macosx/VLCUIWidgets.h b/modules/gui/macosx/VLCUIWidgets.h
index 714e100..3bb11ad 100644
--- a/modules/gui/macosx/VLCUIWidgets.h
+++ b/modules/gui/macosx/VLCUIWidgets.h
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * VLCUIWidgets.h: Widgets for VLC's extensions dialogs for Mac OS X
  *****************************************************************************
- * Copyright (C) 2009-2014 the VideoLAN team and authors
+ * Copyright (C) 2009-2015 the VideoLAN team and authors
  * $Id$
  *
  * Authors: Pierre d'Herbemont <pdherbemont # videolan dot>,
@@ -54,6 +54,11 @@
 
 - (void)addSubview:(NSView *)view atRow:(NSUInteger)row column:(NSUInteger)column rowSpan:(NSUInteger)rowSpan colSpan:(NSUInteger)colSpan;
 - (NSSize)flexSize:(NSSize)size;
+- (void)updateSubview:(NSView *)view
+                atRow:(NSUInteger)row
+               column:(NSUInteger)column
+              rowSpan:(NSUInteger)rowSpan
+              colSpan:(NSUInteger)colSpan;
 - (void)removeSubview:(NSView *)view;
 
 @property (readonly) NSUInteger numViews;
diff --git a/modules/gui/macosx/VLCUIWidgets.m b/modules/gui/macosx/VLCUIWidgets.m
index 9157d9b..2cddcb4 100644
--- a/modules/gui/macosx/VLCUIWidgets.m
+++ b/modules/gui/macosx/VLCUIWidgets.m
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * VLCUIWidgets.m: Widgets for VLC's extensions dialogs for Mac OS X
  *****************************************************************************
- * Copyright (C) 2009-2014 the VideoLAN team and authors
+ * Copyright (C) 2009-2015 the VideoLAN team and authors
  * $Id$
  *
  * Authors: Pierre d'Herbemont <pdherbemont # videolan dot>,
@@ -329,6 +329,24 @@
     [self performSelector:@selector(recomputeWindowSize) withObject:nil afterDelay:0.1];
 }
 
+- (void)updateSubview:(NSView *)view
+                atRow:(NSUInteger)row
+               column:(NSUInteger)column
+              rowSpan:(NSUInteger)rowSpan
+              colSpan:(NSUInteger)colSpan
+{
+    NSDictionary *oldDict = [self objectForView:view];
+    if (!oldDict) {
+        [self addSubview:view
+                   atRow:row
+                  column:column
+                 rowSpan:rowSpan
+                 colSpan:colSpan];
+        return;
+    }
+    [self relayout];
+}
+
 - (void)removeSubview:(NSView *)view
 {
     NSDictionary *dict = [self objectForView:view];



More information about the vlc-commits mailing list