fixed blur on high dpi systems
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
2596
|
||||
2602
|
||||
@@ -46,4 +46,20 @@ typedef UIContextMenuOption = {
|
||||
var ?icon:Int;
|
||||
var ?onSelect:Void->Void;
|
||||
var ?childs:Array<UIContextMenuOption>;
|
||||
}
|
||||
|
||||
class UIContextMenuOptionSpr extends UISpliceSprite {
|
||||
public var label:UIText;
|
||||
public function new(x:Float, y:Float, t:String) {
|
||||
label = new UIText(20, 2, 0, t);
|
||||
|
||||
super(x, y, label.frameWidth + 22, label.frameHeight + 4, 'editors/ui/button');
|
||||
members.push(label);
|
||||
}
|
||||
|
||||
public override function draw() {
|
||||
alpha = hovered ? 1 : 0;
|
||||
label.follow(this, 20, 2);
|
||||
super.draw();
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,12 @@ class WindowsAPI {
|
||||
native.WinAPI.registerAudio();
|
||||
#end
|
||||
}
|
||||
|
||||
@:dox(hide) public static function registerAsDPICompatible() {
|
||||
#if windows
|
||||
native.WinAPI.registerAsDPICompatible();
|
||||
#end
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocates a new console. The console will automatically be opened
|
||||
|
||||
@@ -529,6 +529,7 @@ class System
|
||||
// executes first!!
|
||||
|
||||
#if sys
|
||||
funkin.windows.WindowsAPI.registerAsDPICompatible();
|
||||
funkin.system.CommandLineHandler.parseCommandLine(Sys.args());
|
||||
#end
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import funkin.windows.WindowsAPI.MessageBoxIcon;
|
||||
<lib name="gdi32.lib" if="windows" />
|
||||
<lib name="ole32.lib" if="windows" />
|
||||
<lib name="uxtheme.lib" if="windows" />
|
||||
<lib name="Shcore.lib" if="windows" />
|
||||
</target>
|
||||
')
|
||||
|
||||
@@ -26,6 +27,7 @@ import funkin.windows.WindowsAPI.MessageBoxIcon;
|
||||
#include <wingdi.h>
|
||||
#include <shellapi.h>
|
||||
#include <uxtheme.h>
|
||||
#include <ShellScalingApi.h>
|
||||
|
||||
#define SAFE_RELEASE(punk) \\
|
||||
if ((punk) != NULL) \\
|
||||
@@ -150,34 +152,33 @@ class WinAPI {
|
||||
}
|
||||
|
||||
|
||||
#if windows
|
||||
@:functionCode('
|
||||
HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
SetConsoleTextAttribute(console, color);
|
||||
')
|
||||
#end
|
||||
public static function setConsoleColors(color:Int) {
|
||||
|
||||
}
|
||||
|
||||
#if windows
|
||||
@:functionCode('
|
||||
system("CLS");
|
||||
std::cout<< "" <<std::flush;
|
||||
')
|
||||
#end
|
||||
public static function clearScreen() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
#if windows
|
||||
@:functionCode('
|
||||
MessageBox(GetActiveWindow(), message, caption, icon | MB_SETFOREGROUND);
|
||||
')
|
||||
#end
|
||||
public static function showMessageBox(caption:String, message:String, icon:MessageBoxIcon = MSG_WARNING) {
|
||||
|
||||
}
|
||||
|
||||
@:functionCode('
|
||||
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE);
|
||||
')
|
||||
public static function registerAsDPICompatible() {}
|
||||
}
|
||||
#end
|
||||
Reference in New Issue
Block a user