MCPcopy Create free account
hub / github.com/averne/Fizeau / new_times

Function new_times

application/src/gui.cpp:76–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74};
75
76bool new_times(auto name, auto labelh, auto labelm, Time &t) {
77 auto [width, height] = im::GetIO().DisplaySize;
78 im::PushItemWidth(im::GetWindowWidth() * 0.2f);
79 FZ_SCOPEGUARD([] { im::PopItemWidth(); });
80
81 bool ret = false;
82 im::TextUnformatted(name);
83 im::SameLine(); im::SetCursorPosX(0.08f * width);
84 int int_h = t.h, int_m = t.m;
85 ret |= im::DragInt(labelh, &int_h, 0.05f, 0, 23, "%02dh");
86 ret |= swkbd::handle(labelh, &int_h, 0, 23);
87 im::SameLine();
88 ret |= im::DragInt(labelm, &int_m, 0.05f, 0, 59, "%02dm");
89 ret |= swkbd::handle(labelm, &int_m, 0, 59);
90 t.h = static_cast<std::uint8_t>(int_h), t.m = static_cast<std::uint8_t>(int_m);
91
92 return ret;
93};
94
95bool new_range(auto name, auto labelcb, auto labello, auto labelhi, ColorRange &range) {
96 auto [width, height] = im::GetIO().DisplaySize;

Callers 1

draw_time_tabFunction · 0.85

Calls 1

handleFunction · 0.85

Tested by

no test coverage detected