summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/ios/iosinst.cxx4
-rw-r--r--vcl/source/window/dialog.cxx20
2 files changed, 22 insertions, 2 deletions
diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx
index 8f58c239a677..35d1f400745f 100644
--- a/vcl/ios/iosinst.cxx
+++ b/vcl/ios/iosinst.cxx
@@ -28,7 +28,7 @@
#include <vcl/layout.hxx>
#include <vcl/settings.hxx>
-// Horrible hack
+// Totally wrong of course but doesn't seem to harm much in the iOS app.
static int viewWidth = 1, viewHeight = 1;
class IosSalData : public GenericUnixSalData
@@ -107,7 +107,7 @@ public:
virtual void UpdateSettings( AllSettings &rSettings ) override
{
// Clobber the UI fonts
- vcl::Font aFont( OUString::fromUtf8( [[[UIFont systemFontOfSize:7] familyName] UTF8String] ), Size( 0, 7 ) );
+ vcl::Font aFont( OUString::fromUtf8( [[[UIFont systemFontOfSize:10] familyName] UTF8String] ), Size( 0, 10 ) );
StyleSettings aStyleSet = rSettings.GetStyleSettings();
aStyleSet.SetAppFont( aFont );
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 2bc62fbc00ee..84d98914fd74 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -19,6 +19,12 @@
#include <config_features.h>
+#ifdef IOS
+#include <premac.h>
+#include <UIKit/UIKit.h>
+#include <postmac.h>
+#endif
+
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/util/thePathSettings.hpp>
#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
@@ -679,6 +685,7 @@ bool Dialog::EventNotify( NotifyEvent& rNEvt )
//taskbar, menus, etc.
Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize)
{
+#ifndef IOS
long w = rScreenSize.Width();
if (w <= 800)
w -= 15;
@@ -695,6 +702,19 @@ Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize)
return Size(std::max<long>(w, 640 - 15),
std::max<long>(h, 480 - 50));
+#else
+ // Don't bother with ancient magic numbers of unclear relevance on non-desktop apps anyway. It
+ // seems that at least currently in the iOS app, this function is called just once per dialog,
+ // with a rScreenSize parameter of 1x1 (!). This would lead to always returning 625x430 which is
+ // a bit random and needlessly small on an iPad at least. We want something that closely will
+ // just fit on the display in either orientation.
+
+ // We ignore the rScreenSize as it will be the dummy 1x1 from iosinst.cxx (see "Totally wrong of course").
+ (void) rScreenSize;
+
+ const int n = std::min<CGFloat>([[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height);
+ return Size(n-10, n-10);
+#endif
}
void Dialog::StateChanged( StateChangedType nType )