MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / trackRect

Method trackRect

pj_widgets/src/ToggleSwitch.cpp:131–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131QRect ToggleSwitch::trackRect() const {
132 if (text_.isEmpty()) {
133 return rect();
134 }
135 // Fixed-width pill flush to the edge opposite the label; full height.
136 const int track_w = kDefaultWidth;
137 const int x = (label_side_ == LabelSide::Left) ? width() - track_w : 0;
138 return {x, 0, track_w, height()};
139}
140
141QRect ToggleSwitch::labelRect() const {
142 if (text_.isEmpty()) {

Callers

nothing calls this directly

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected