62 ctx->arc(x +
width - radius, y + radius, radius, -M_PI_2, 0);
63 ctx->arc(x +
width - radius, y +
height - radius, radius, 0, M_PI_2);
64 ctx->arc(x + radius, y +
height - radius, radius, M_PI_2, M_PI);
65 ctx->arc(x + radius, y + radius, radius, M_PI, 3 * M_PI_2);
77 int const widget_width,
int const widget_height)
79 double width = widget_width;
80 double height = widget_height;
84 double degrees = M_PI / 180.0;
87 std::uint32_t outline_color = 0x00000000;
88 std::uint32_t border_color = 0xffffff00;
90 auto style = get_style_context();
92 bool found = style->lookup_color(
"theme_bg_color", bgnd);
95 auto state = get_state_flags();
96 auto disabled = (state & Gtk::StateFlags::INSENSITIVE) == Gtk::StateFlags::INSENSITIVE;
97 auto backdrop = (state & Gtk::StateFlags::BACKDROP) == Gtk::StateFlags::BACKDROP;
99 std::swap(outline_color, border_color);
106 int alpha = disabled || backdrop ? 0x2f : 0x5f;
122 cr->set_source(checkers);
131 auto opacity = color.stealOpacity();
137 width = rect.width() / 2;
143 cairo_new_sub_path(cr->cobj());
146 cairo_arc(cr->cobj(), x + radius, y +
height - radius, radius, 90 * degrees, 180 * degrees);
147 cairo_arc(cr->cobj(), x + radius, y + radius, radius, 180 * degrees, 270 * degrees);
148 cairo_close_path(cr->cobj());
154 cairo_new_sub_path(cr->cobj());
155 cairo_arc(cr->cobj(), x +
width - radius, y + radius, radius, -90 * degrees, 0 * degrees);
156 cairo_arc(cr->cobj(), x +
width - radius, y +
height - radius, radius, 0 * degrees, 90 * degrees);
159 cairo_close_path(cr->cobj());
162 cr->set_source(checkers);
165 color.setOpacity(opacity);
171 constexpr double side = 7.5;
172 constexpr double line = 1.5;
173 const auto right = rect.right();
174 const auto bottom = rect.bottom();
177 cr->move_to(right, bottom - side);
178 cr->line_to(right, bottom - side + line);
179 cr->line_to(right - side + line, bottom);
180 cr->line_to(right - side, bottom);
181 cr->set_source_rgb(1, 1, 1);
183 cr->move_to(right, bottom - side + line);
184 cr->line_to(right, bottom);
185 cr->line_to(right - side + line, bottom);
186 cr->set_source_rgb(0, 0, 0);
191 cr->move_to(right, bottom);
192 cr->line_to(right, bottom - side);
193 cr->line_to(right - side, bottom);
194 cr->set_source_rgb(1, 1, 1);
196 constexpr double r = 2;
197 cr->arc(right - r, bottom - r, r, 0, 2*M_PI);
198 cr->set_source_rgb(0, 0, 0);