mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-21 21:40:32 -04:00
172d06f38d
* template setup * get most colors working * add lantern, midna, and heart colors * fix PaneCache naming conflict * add UI colors * fix pane cache again * override colors for items on other models * recolor heart piece models * cleanup * add support for ordon sword recoloring * recolor epona's eyelids * move option descriptions * fix mod.json * constexpr descriptions * gx.h instead of dolphin/gx/GXstruct.h * fix default midna hair color * use TextureService instead of overwriting model file data on load * update descriptions * manual cleanup * fix includes * remove unneeded include and const qualifier * UI: Add Popover, ColorInput & more; mod cleanup * Make it a bundled mod --------- Co-authored-by: Luke Street <luke@street.dev>
45 lines
1004 B
C++
45 lines
1004 B
C++
#pragma once
|
|
|
|
#include "document.hpp"
|
|
|
|
namespace dusk::ui {
|
|
|
|
class Popover : public Document {
|
|
public:
|
|
enum class Side {
|
|
Below,
|
|
Above,
|
|
Left,
|
|
Right,
|
|
};
|
|
|
|
Popover(Rml::Element* anchor, Side side, const Rml::String& windowClass = "");
|
|
|
|
void show() override;
|
|
void hide(bool close) override;
|
|
bool focus() override;
|
|
bool visible() const override;
|
|
void update() override;
|
|
|
|
Rml::Element* body() const { return mBody; }
|
|
|
|
void dismiss();
|
|
void on_close(std::function<void()> callback) { mOnClose = std::move(callback); }
|
|
void on_focus(std::function<bool()> callback) { mOnFocus = std::move(callback); }
|
|
|
|
protected:
|
|
bool handle_nav_command(Rml::Event& event, NavCommand cmd) override;
|
|
|
|
private:
|
|
void reposition();
|
|
void notify_close();
|
|
|
|
Rml::Element* mAnchor = nullptr;
|
|
Side mSide;
|
|
Rml::Element* mBody = nullptr;
|
|
std::function<void()> mOnClose;
|
|
std::function<bool()> mOnFocus;
|
|
};
|
|
|
|
} // namespace dusk::ui
|