yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
implot_support.h
Go to the documentation of this file.
1#ifndef YAZE_APP_GUI_PLOTS_IMPLOT_SUPPORT_H
2#define YAZE_APP_GUI_PLOTS_IMPLOT_SUPPORT_H
3
4#include <string>
5
7#include "imgui/imgui.h"
8#include "implot.h"
9
10namespace yaze {
11namespace gui {
12namespace plotting {
13
15 float line_weight = 2.0f;
16 float marker_size = 4.0f;
17 float marker_weight = 1.25f;
18 float fill_alpha = 0.35f;
19 float grid_alpha = 0.35f;
20 float background_alpha = 0.9f;
21 bool use_iso_8601 = true;
22 bool use_24h_clock = true;
23};
24
25struct PlotConfig {
26 std::string id;
27 const char* x_label = nullptr;
28 const char* y_label = nullptr;
29 ImVec2 size = ImVec2(0, 0);
30 ImPlotFlags flags = ImPlotFlags_NoLegend;
31 ImPlotAxisFlags x_axis_flags = ImPlotAxisFlags_AutoFit;
32 ImPlotAxisFlags y_axis_flags = ImPlotAxisFlags_AutoFit;
33};
34
36ImPlotStyle BuildStyleFromTheme(const Theme& theme,
37 const PlotStyleConfig& config = {});
38
40 public:
41 PlotStyleScope(const Theme& theme,
42 const PlotStyleConfig& config = {});
44
45 private:
46 ImPlotStyle previous_style_{};
47};
48
49class PlotGuard {
50 public:
51 explicit PlotGuard(const PlotConfig& config);
52 ~PlotGuard();
53
54 bool IsOpen() const { return should_end_; }
55 explicit operator bool() const { return IsOpen(); }
56
57 private:
58 bool should_end_ = false;
59};
60
61} // namespace plotting
62} // namespace gui
63} // namespace yaze
64
65#endif // YAZE_APP_GUI_PLOTS_IMPLOT_SUPPORT_H
PlotGuard(const PlotConfig &config)
PlotStyleScope(const Theme &theme, const PlotStyleConfig &config={})
ImPlotStyle BuildStyleFromTheme(const Theme &theme, const PlotStyleConfig &config)
Comprehensive theme structure for YAZE.