[UI] Set fullscreen on double left mouse click
This commit is contained in:
@@ -38,6 +38,8 @@ struct RecentTitleEntry {
|
||||
|
||||
class EmulatorWindow {
|
||||
public:
|
||||
using steady_clock = std::chrono::steady_clock; // stdlib steady clock
|
||||
|
||||
enum : size_t {
|
||||
// The UI is on top of the game and is open in special cases, so
|
||||
// lowest-priority.
|
||||
@@ -57,7 +59,17 @@ class EmulatorWindow {
|
||||
std::unique_ptr<xe::threading::Thread> Gamepad_HotKeys_Listener;
|
||||
|
||||
int32_t selected_title_index = -1;
|
||||
|
||||
|
||||
static constexpr int64_t diff_in_ms(
|
||||
const steady_clock::time_point t1,
|
||||
const steady_clock::time_point t2) noexcept {
|
||||
using ms = std::chrono::milliseconds;
|
||||
return std::chrono::duration_cast<ms>(t1 - t2).count();
|
||||
}
|
||||
|
||||
steady_clock::time_point last_mouse_up = steady_clock::now();
|
||||
steady_clock::time_point last_mouse_down = steady_clock::now();
|
||||
|
||||
Emulator* emulator() const { return emulator_; }
|
||||
ui::WindowedAppContext& app_context() const { return app_context_; }
|
||||
ui::Window* window() const { return window_.get(); }
|
||||
@@ -131,6 +143,9 @@ class EmulatorWindow {
|
||||
|
||||
void OnKeyDown(ui::KeyEvent& e) override;
|
||||
|
||||
void OnMouseDown(ui::MouseEvent& e) override;
|
||||
void OnMouseUp(ui::MouseEvent& e) override;
|
||||
|
||||
private:
|
||||
EmulatorWindow& emulator_window_;
|
||||
};
|
||||
@@ -184,7 +199,10 @@ class EmulatorWindow {
|
||||
void ApplyDisplayConfigForCvars();
|
||||
|
||||
void OnKeyDown(ui::KeyEvent& e);
|
||||
void OnMouseDown(const ui::MouseEvent& e);
|
||||
void ToggleFullscreenOnDoubleClick();
|
||||
void FileDrop(const std::filesystem::path& filename);
|
||||
void OnMouseUp(const ui::MouseEvent& e);
|
||||
void FileOpen();
|
||||
void FileClose();
|
||||
void InstallContent();
|
||||
|
||||
Reference in New Issue
Block a user