mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-24 01:54:22 +00:00
Default desktop scaling for win32.
This commit is contained in:
parent
bd3a75e726
commit
cbe2777656
7 changed files with 25 additions and 2 deletions
|
|
@ -26,7 +26,7 @@ Desktop::Desktop()
|
|||
: mouseClickCounter (0), mouseWheelCounter (0),
|
||||
kioskModeComponent (nullptr),
|
||||
allowedOrientations (allOrientations),
|
||||
masterScaleFactor (1.0f)
|
||||
masterScaleFactor ((float) getDefaultMasterScale())
|
||||
{
|
||||
displays = new Displays (*this);
|
||||
addMouseInputSource();
|
||||
|
|
|
|||
|
|
@ -448,6 +448,8 @@ private:
|
|||
void triggerFocusCallback();
|
||||
void handleAsyncUpdate() override;
|
||||
|
||||
static double getDefaultMasterScale();
|
||||
|
||||
Desktop();
|
||||
~Desktop();
|
||||
|
||||
|
|
|
|||
|
|
@ -572,6 +572,11 @@ bool Desktop::canUseSemiTransparentWindows() noexcept
|
|||
return true;
|
||||
}
|
||||
|
||||
double Desktop::getDefaultMasterScale()
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
|
||||
{
|
||||
// TODO
|
||||
|
|
|
|||
|
|
@ -297,6 +297,11 @@ void MouseInputSource::setRawMousePosition (Point<int>)
|
|||
{
|
||||
}
|
||||
|
||||
double Desktop::getDefaultMasterScale()
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
|
||||
{
|
||||
return Orientations::convertToJuce ([[UIApplication sharedApplication] statusBarOrientation]);
|
||||
|
|
|
|||
|
|
@ -3124,6 +3124,11 @@ void MouseInputSource::setRawMousePosition (Point<int> newPosition)
|
|||
XWarpPointer (display, None, root, 0, 0, 0, 0, newPosition.getX(), newPosition.getY());
|
||||
}
|
||||
|
||||
double Desktop::getDefaultMasterScale()
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
|
||||
{
|
||||
return upright;
|
||||
|
|
|
|||
|
|
@ -226,6 +226,11 @@ void MouseInputSource::setRawMousePosition (Point<int> newPosition)
|
|||
CGAssociateMouseAndMouseCursorPosition (true);
|
||||
}
|
||||
|
||||
double Desktop::getDefaultMasterScale()
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
|
||||
{
|
||||
return upright;
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ static inline Rectangle<int> rectangleFromRECT (const RECT& r) noexcept
|
|||
return Rectangle<int>::leftTopRightBottom ((int) r.left, (int) r.top, (int) r.right, (int) r.bottom);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
static void setDPIAwareness()
|
||||
{
|
||||
if (JUCEApplication::isStandaloneApp())
|
||||
|
|
@ -162,7 +163,7 @@ inline double getDPI()
|
|||
return dpi;
|
||||
}
|
||||
|
||||
inline double getDisplayScale()
|
||||
double Desktop::getDefaultMasterScale()
|
||||
{
|
||||
return getDPI() / 96.0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue