aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/util
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/util')
-rw-r--r--main/src/ui/util/accounts_combo_box.vala3
-rw-r--r--main/src/ui/util/helper.vala2
-rw-r--r--main/src/ui/util/scaling_image.vala15
3 files changed, 3 insertions, 17 deletions
diff --git a/main/src/ui/util/accounts_combo_box.vala b/main/src/ui/util/accounts_combo_box.vala
index 5fdd18e6..1c708eac 100644
--- a/main/src/ui/util/accounts_combo_box.vala
+++ b/main/src/ui/util/accounts_combo_box.vala
@@ -24,7 +24,8 @@ class AccountComboBox : ComboBox {
do {
Value val;
list_store.get_value(iter, 1, out val);
- if ((val as Account).equals(value)) {
+ Account? account = val as Account;
+ if (account != null && account.equals(value)) {
active = i;
break;
}
diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala
index 888dc66e..de4896d9 100644
--- a/main/src/ui/util/helper.vala
+++ b/main/src/ui/util/helper.vala
@@ -441,7 +441,7 @@ public string summarize_whitespaces_to_space(string s) {
}
public bool use_csd() {
- return (GLib.Application.get_default() as Application).use_csd();
+ return ((Application) GLib.Application.get_default()).use_csd();
}
}
diff --git a/main/src/ui/util/scaling_image.vala b/main/src/ui/util/scaling_image.vala
index 7813ff9b..477432c5 100644
--- a/main/src/ui/util/scaling_image.vala
+++ b/main/src/ui/util/scaling_image.vala
@@ -148,21 +148,6 @@ class ScalingImage : Misc {
return buffer;
}
- private static Gdk.Pixbuf crop_corners(Gdk.Pixbuf pixbuf, double radius = 3) {
- Cairo.Context ctx = new Cairo.Context(new Cairo.ImageSurface(Cairo.Format.ARGB32, pixbuf.width, pixbuf.height));
- Gdk.cairo_set_source_pixbuf(ctx, pixbuf, 0, 0);
- double degrees = Math.PI / 180.0;
- ctx.new_sub_path();
- ctx.arc(pixbuf.width - radius, radius, radius, -90 * degrees, 0 * degrees);
- ctx.arc(pixbuf.width - radius, pixbuf.height - radius, radius, 0 * degrees, 90 * degrees);
- ctx.arc(radius, pixbuf.height - radius, radius, 90 * degrees, 180 * degrees);
- ctx.arc(radius, radius, radius, 180 * degrees, 270 * degrees);
- ctx.close_path();
- ctx.clip();
- ctx.paint();
- return Gdk.pixbuf_get_from_surface(ctx.get_target(), 0, 0, pixbuf.width, pixbuf.height);
- }
-
public override void get_preferred_width(out int minimum_width, out int natural_width) {
minimum_width = int.max(0, min_width);
double exact_width = -1, exact_height = -1;