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
b4ac871c
Commit
b4ac871c
authored
Aug 22, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump font size on Windows
parent
7a8d574e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
ScreenTools.qml
src/QmlControls/ScreenTools.qml
+1
-1
ScreenToolsController.cc
src/QmlControls/ScreenToolsController.cc
+6
-1
ScreenToolsController.h
src/QmlControls/ScreenToolsController.h
+7
-3
No files found.
src/QmlControls/ScreenTools.qml
View file @
b4ac871c
...
...
@@ -8,7 +8,7 @@ import QGroundControl.ScreenToolsController 1.0
Item
{
signal
repaintRequested
readonly
property
real
defaultFontPixelSize
:
_textMeasure
.
contentHeight
*
0.8
readonly
property
real
defaultFontPixelSize
:
_textMeasure
.
contentHeight
*
ScreenToolsController
.
defaultFontPixelSizeRatio
readonly
property
real
defaultFontPixelHeight
:
defaultFontPixelSize
readonly
property
real
defaultFontPixelWidth
:
_textMeasure
.
contentWidth
readonly
property
real
smallFontPixelSize
:
defaultFontPixelSize
*
ScreenToolsController
.
smallFontPixelSizeRatio
...
...
src/QmlControls/ScreenToolsController.cc
View file @
b4ac871c
...
...
@@ -29,7 +29,12 @@
int
ScreenToolsController
::
_qmlDefaultFontPixelSize
=
-
1
;
const
double
ScreenToolsController
::
_smallFontPixelSizeRatio
=
0.75
;
#ifdef Q_OS_WIN
const
double
ScreenToolsController
::
_defaultFontPixelSizeRatio
=
1.0
;
#else
const
double
ScreenToolsController
::
_defaultFontPixelSizeRatio
=
0.8
;
#endif
const
double
ScreenToolsController
::
_smallFontPixelSizeRatio
=
0.75
;
const
double
ScreenToolsController
::
_mediumFontPixelSizeRatio
=
1.22
;
const
double
ScreenToolsController
::
_largeFontPixelSizeRatio
=
1.66
;
...
...
src/QmlControls/ScreenToolsController.h
View file @
b4ac871c
...
...
@@ -82,7 +82,10 @@ public:
Q_INVOKABLE
int
mouseX
(
void
)
{
return
QCursor
::
pos
().
x
();
}
Q_INVOKABLE
int
mouseY
(
void
)
{
return
QCursor
::
pos
().
y
();
}
// Used to calculate font sizes based on default font size
// Used to adjust default font size on an OS basis
Q_PROPERTY
(
double
defaultFontPixelSizeRatio
MEMBER
_defaultFontPixelSizeRatio
CONSTANT
)
// Used to calculate font sizes based on default font size
Q_PROPERTY
(
double
smallFontPixelSizeRatio
MEMBER
_smallFontPixelSizeRatio
CONSTANT
)
Q_PROPERTY
(
double
mediumFontPixelSizeRatio
MEMBER
_mediumFontPixelSizeRatio
CONSTANT
)
Q_PROPERTY
(
double
largeFontPixelSizeRatio
MEMBER
_largeFontPixelSizeRatio
CONSTANT
)
...
...
@@ -92,7 +95,7 @@ public:
static
double
getQmlDefaultFontPixelSize
(
void
);
static
int
defaultFontPixelSize_s
()
{
return
(
int
)
getQmlDefaultFontPixelSize
();
}
static
int
smallFontPixelSize_s
()
{
return
(
int
)((
double
)
defaultFontPixelSize_s
()
*
_smallFontPixelSizeRatio
);
}
static
int
smallFontPixelSize_s
()
{
return
(
int
)((
double
)
defaultFontPixelSize_s
()
*
_smallFontPixelSizeRatio
);
}
static
int
mediumFontPixelSize_s
()
{
return
(
int
)((
double
)
defaultFontPixelSize_s
()
*
_mediumFontPixelSizeRatio
);
}
static
int
largeFontPixelSize_s
()
{
return
(
int
)((
double
)
defaultFontPixelSize_s
()
*
_largeFontPixelSizeRatio
);
}
...
...
@@ -117,7 +120,8 @@ private slots:
void
_updateCanvas
();
private:
static
const
double
_smallFontPixelSizeRatio
;
static
const
double
_defaultFontPixelSizeRatio
;
static
const
double
_smallFontPixelSizeRatio
;
static
const
double
_mediumFontPixelSizeRatio
;
static
const
double
_largeFontPixelSizeRatio
;
...
...
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