mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
overlay: helper modal dialog for picking option values (#561)
## Link to GitHub Issue or related Pull Request, if one exists ## Description of change Introduce a new modal dialog for picking out some of the options to improve UX. Implemented a few for now: 1. UI for picking ASIO drivers from a list (for -iidxasio, -sdvxasio, -asioconvert, etc) 2. Button to generate card numbers for -card0 and card1 3. Processor Affinity selector (very similar to what's in Windows Task Manager, list of checkboxes) 4. file selector (file open dialog for various file path overrides like log file) 5. folder selector (folder override) I wrote a selector for COM ports as well but how we use the value was inconsistent (\\\\.\\COMx vs. COMx) and didn't see a huge point in it so I didn't check it in. ## Testing
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "device.h"
|
||||
#include "hotplug.h"
|
||||
#include "util/scope_guard.h"
|
||||
|
||||
namespace rawinput {
|
||||
|
||||
@@ -31,6 +32,15 @@ namespace rawinput {
|
||||
extern bool NAIVE_REQUIRE_FOCUS;
|
||||
extern bool RAWINPUT_REQUIRE_FOCUS;
|
||||
|
||||
// while active, prevents overlay from accepting any input
|
||||
// can be used while OS modal dialog is shown on top of overlay/spicecfg
|
||||
// always prefer RAII set_os_window_focus_guard instead of the global bool
|
||||
extern bool OS_WINDOW_ACTIVE;
|
||||
inline scope_guard set_os_window_focus_guard() {
|
||||
rawinput::OS_WINDOW_ACTIVE = true;
|
||||
return scope_guard {[]() { rawinput::OS_WINDOW_ACTIVE = false; }};
|
||||
}
|
||||
|
||||
struct DeviceCallback {
|
||||
void *data;
|
||||
std::function<void(void*, Device*)> f;
|
||||
|
||||
Reference in New Issue
Block a user