[UI] Implemented Host Notifications

Splitted clases into:
 - ImGuiNotification
 - ImGuiHostNotification
 - ImGuiGuestNotification

To differentiate between Xenia toast notifications and notifications from titles itself

Adhoc:
Changed Screenshot into toast notification and switched from being binded to F10 to F12
This commit is contained in:
Gliniak
2024-08-25 14:00:34 +02:00
parent 4abbfa0b04
commit d6f0ab6a7e
9 changed files with 470 additions and 218 deletions

View File

@@ -0,0 +1,49 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2023 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_UI_IMGUI_HOST_NOTIFICATION_H_
#define XENIA_UI_IMGUI_HOST_NOTIFICATION_H_
#include "third_party/imgui/imgui.h"
#include "xenia/ui/imgui_dialog.h"
#include "xenia/ui/imgui_drawer.h"
#include "xenia/ui/imgui_notification.h"
namespace xe {
namespace ui {
class ImGuiHostNotification : public ImGuiNotification {
public:
ImGuiHostNotification(ui::ImGuiDrawer* imgui_drawer, std::string& title,
std::string& description, uint8_t user_index,
uint8_t position_id = 10);
~ImGuiHostNotification();
protected:
const ImVec2 CalculateNotificationSize(ImVec2 text_size,
float scale) override;
virtual void OnDraw(ImGuiIO& io) {}
};
class HostNotificationWindow final : ImGuiHostNotification {
public:
HostNotificationWindow(ui::ImGuiDrawer* imgui_drawer, std::string title,
std::string description, uint8_t user_index,
uint8_t position_id = 10)
: ImGuiHostNotification(imgui_drawer, title, description, user_index,
position_id) {};
void OnDraw(ImGuiIO& io) override;
};
} // namespace ui
} // namespace xe
#endif