def draw_dish_key_background(self, context, alpha = 1.0, layer_id = None): """ Black background following the contours of key clusters to simulate the opening in the keyboard plane. """ if config.theme_settings.key_style == "dish": context.push_group() context.set_source_rgba(0, 0, 0, 1) enlargement = self.layout.context.scale_log_to_canvas((0.8, 0.8)) corner_radius = self.layout.context.scale_log_to_canvas_x(2.4) if layer_id is None: generator = self.layout.iter_visible_items() else: generator = self.layout.iter_layer_items(layer_id) for item in generator: if item.is_key(): rect = item.get_canvas_fullsize_rect() rect = rect.inflate(*enlargement) roundrect_curve(context, rect, corner_radius) context.fill() context.pop_group_to_source() context.paint_with_alpha(alpha);
def _build_rect_path(self, context, rect): roundness = config.theme_settings.roundrect_radius if roundness: roundrect_curve(context, rect, roundness) else: context.rectangle(*rect)
def build_rect_path(self, context, rect, radius_scale=1.0): roundness = config.theme_settings.roundrect_radius * radius_scale if roundness: roundrect_curve(context, rect, roundness) else: context.rectangle(*rect)