client: Add a small margin instead of manual clipping

This commit is contained in:
Cédric Bellegarde 2023-03-02 11:54:49 +01:00
parent c6576c0627
commit e275b37343
2 changed files with 3 additions and 30 deletions

View file

@ -196,34 +196,6 @@ public class ConversationWebView : Components.WebView {
return ret;
}
// Clip round bottom corner
// This is based on
// https://gitlab.gnome.org/GNOME/gnome-weather/-/commit/9b6336454cc90669d1ee8387bdfc6627e3659e83
public override bool draw(Cairo.Context cr) {
var frameWidth = this.get_allocated_width();
var frameHeight = this.get_allocated_height();
var styleContext = this.get_style_context();
int borderRadius = (int) styleContext.get_property("border-radius", styleContext.get_state());
var arc0 = 0.0;
var arc1 = Math.PI * 0.5;
var arc2 = Math.PI;
cr.new_sub_path();
cr.line_to(frameWidth, 0);
cr.arc(frameWidth - borderRadius, frameHeight - borderRadius, borderRadius, arc0, arc1);
cr.arc(borderRadius, frameHeight - borderRadius, borderRadius, arc1, arc2);
cr.line_to(0, 0);
cr.close_path();
cr.clip();
cr.fill();
base.draw(cr);
return Gdk.EVENT_PROPAGATE;
}
public override void get_preferred_height(out int minimum_height,
out int natural_height) {
// XXX clamp height to something not too outrageous so we

View file

@ -213,8 +213,9 @@ row.geary-folder-popover-list-row > label {
margin-bottom: 6px
}
.geary-expanded webkitwebview {
border-radius: 8px;
/* Update this to match any change in above radius value */
.geary-message-body {
margin: 2px;
}
/* ConversationEmail */