Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
f5f8c0b0
Commit
f5f8c0b0
authored
Jun 05, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweaks for small screens on iOS.
parent
e6cf9822
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
8 deletions
+32
-8
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+1
-1
FlightMap.qml
src/FlightMap/FlightMap.qml
+1
-1
QGroundControlQmlGlobal.cc
src/QmlControls/QGroundControlQmlGlobal.cc
+1
-1
ScreenTools.qml
src/QmlControls/ScreenTools.qml
+11
-5
ScreenToolsController.cc
src/QmlControls/ScreenToolsController.cc
+15
-0
ScreenToolsController.h
src/QmlControls/ScreenToolsController.h
+3
-0
No files found.
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
f5f8c0b0
...
...
@@ -38,7 +38,7 @@ Item {
function
getGadgetWidth
()
{
if
(
ScreenTools
.
isMobile
)
{
return
mainWindow
.
width
*
0.15
return
ScreenTools
.
isTinyScreen
?
mainWindow
.
width
*
0.2
:
mainWindow
.
width
*
0.15
}
var
w
=
mainWindow
.
width
*
0.15
return
Math
.
min
(
w
,
200
)
...
...
src/FlightMap/FlightMap.qml
View file @
f5f8c0b0
...
...
@@ -157,7 +157,7 @@ Map {
*/
Item
{
id
:
scale
visible
:
_map
.
showScale
&&
scaleText
.
text
!==
"
0 m
"
visible
:
!
ScreenTools
.
isTinyScreen
&&
_map
.
showScale
&&
scaleText
.
text
!==
"
0 m
"
z
:
_map
.
z
+
20
width
:
scaleImageLeft
.
width
+
scaleImage
.
width
+
scaleImageRight
.
width
anchors
{
...
...
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
f5f8c0b0
...
...
@@ -25,7 +25,7 @@ SettingsFact* QGroundControlQmlGlobal::_speedUnitsFact =
FactMetaData
*
QGroundControlQmlGlobal
::
_speedUnitsMetaData
=
NULL
;
const
char
*
QGroundControlQmlGlobal
::
_virtualTabletJoystickKey
=
"VirtualTabletJoystick"
;
const
char
*
QGroundControlQmlGlobal
::
_baseFontPointSizeKey
=
"BaseFontPointSize"
;
const
char
*
QGroundControlQmlGlobal
::
_baseFontPointSizeKey
=
"Base
Device
FontPointSize"
;
QGroundControlQmlGlobal
::
QGroundControlQmlGlobal
(
QGCApplication
*
app
)
:
QGCTool
(
app
)
...
...
src/QmlControls/ScreenTools.qml
View file @
f5f8c0b0
...
...
@@ -83,13 +83,19 @@ Item {
if
(
baseSize
<
6
||
baseSize
>
48
)
{
//-- Init base size base on the platform
if
(
ScreenToolsController
.
isMobile
)
{
// Small Devices
if
((
Screen
.
width
/
Screen
.
pixelDensity
)
<
120
)
baseSize
=
11
;
// iOS
//-- Check iOS really tiny screens (iPhone 4s/5/5s)
if
(
ScreenToolsController
.
isiOS
&&
Screen
.
width
<
570
)
baseSize
=
9
;
//-- iPhone 6/6s)
else
if
(
ScreenToolsController
.
isiOS
&&
Screen
.
width
<
670
)
baseSize
=
10
;
// Larger iOS (6/6s Plus or iPad)
else
if
(
ScreenToolsController
.
isiOS
)
baseSize
=
13
;
// Android
// Small Android Devices
else
if
((
Screen
.
width
/
Screen
.
pixelDensity
)
<
120
)
baseSize
=
11
;
// Other Android
else
baseSize
=
14
;
}
else
{
...
...
src/QmlControls/ScreenToolsController.cc
View file @
f5f8c0b0
...
...
@@ -13,8 +13,23 @@
#include "ScreenToolsController.h"
#include <QScreen>
#if defined(__ios__)
#include <sys/utsname.h>
#endif
ScreenToolsController
::
ScreenToolsController
()
{
}
QString
ScreenToolsController
::
iOSDevice
()
{
#if defined(__ios__)
struct
utsname
systemInfo
;
uname
(
&
systemInfo
);
return
QString
(
systemInfo
.
machine
);
#else
return
QString
();
#endif
}
src/QmlControls/ScreenToolsController.h
View file @
f5f8c0b0
...
...
@@ -36,6 +36,7 @@ public:
Q_PROPERTY
(
bool
isDebug
READ
isDebug
CONSTANT
)
Q_PROPERTY
(
bool
isMacOS
READ
isMacOS
CONSTANT
)
Q_PROPERTY
(
bool
isLinux
READ
isLinux
CONSTANT
)
Q_PROPERTY
(
QString
iOSDevice
READ
iOSDevice
CONSTANT
)
// Returns current mouse position
Q_INVOKABLE
int
mouseX
(
void
)
{
return
QCursor
::
pos
().
x
();
}
...
...
@@ -81,6 +82,8 @@ public:
bool
testHighDPI
()
{
return
false
;
}
#endif
QString
iOSDevice
();
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment