[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:
49
src/xenia/ui/imgui_host_notification.h
Normal file
49
src/xenia/ui/imgui_host_notification.h
Normal 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
|
||||
Reference in New Issue
Block a user