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
21cff51c
Commit
21cff51c
authored
Nov 10, 2017
by
Jacob Walser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix instrument widget width issues for 4k screens
parent
ad7c55c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+2
-0
ScreenTools.qml
src/QmlControls/ScreenTools.qml
+5
-0
No files found.
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
21cff51c
...
@@ -41,6 +41,8 @@ Item {
...
@@ -41,6 +41,8 @@ Item {
function
getPreferredInstrumentWidth
()
{
function
getPreferredInstrumentWidth
()
{
if
(
ScreenTools
.
isMobile
)
{
if
(
ScreenTools
.
isMobile
)
{
return
mainWindow
.
width
*
0.25
return
mainWindow
.
width
*
0.25
}
else
if
(
ScreenTools
.
isHugeScreen
)
{
return
mainWindow
.
width
*
0.11
}
}
return
ScreenTools
.
defaultFontPixelWidth
*
30
return
ScreenTools
.
defaultFontPixelWidth
*
30
}
}
...
...
src/QmlControls/ScreenTools.qml
View file @
21cff51c
...
@@ -60,6 +60,7 @@ Item {
...
@@ -60,6 +60,7 @@ Item {
property
bool
isDebug
:
ScreenToolsController
.
isDebug
property
bool
isDebug
:
ScreenToolsController
.
isDebug
property
bool
isTinyScreen
:
(
Screen
.
width
/
Screen
.
pixelDensity
)
<
120
// 120mm
property
bool
isTinyScreen
:
(
Screen
.
width
/
Screen
.
pixelDensity
)
<
120
// 120mm
property
bool
isShortScreen
:
ScreenToolsController
.
isMobile
&&
((
Screen
.
height
/
Screen
.
width
)
<
0.6
)
// Nexus 7 for example
property
bool
isShortScreen
:
ScreenToolsController
.
isMobile
&&
((
Screen
.
height
/
Screen
.
width
)
<
0.6
)
// Nexus 7 for example
property
bool
isHugeScreen
:
Screen
.
width
>=
1920
*
2
readonly
property
real
minTouchMillimeters
:
10
///< Minimum touch size in millimeters
readonly
property
real
minTouchMillimeters
:
10
///< Minimum touch size in millimeters
property
real
minTouchPixels
:
0
///< Minimum touch size in pixels
property
real
minTouchPixels
:
0
///< Minimum touch size in pixels
...
@@ -90,6 +91,10 @@ Item {
...
@@ -90,6 +91,10 @@ Item {
}
}
}
}
function
printScreenStats
()
{
console
.
log
(
'
ScreenTools: Screen.width:
'
+
Screen
.
width
+
'
Screen.height:
'
+
Screen
.
height
+
'
Screen.pixelDensity:
'
+
Screen
.
pixelDensity
)
}
/// Returns the current x position of the mouse in global screen coordinates.
/// Returns the current x position of the mouse in global screen coordinates.
function
mouseX
()
{
function
mouseX
()
{
return
ScreenToolsController
.
mouseX
()
return
ScreenToolsController
.
mouseX
()
...
...
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