From a32a8870eead4bedb592b7f455f14115b23a5f03 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 26 Feb 2018 16:14:59 +0000 Subject: [PATCH] linux note: Fix default avatar image --- SparkleShare/Linux/Note.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SparkleShare/Linux/Note.cs b/SparkleShare/Linux/Note.cs index ecbdbe16..8afb46fb 100644 --- a/SparkleShare/Linux/Note.cs +++ b/SparkleShare/Linux/Note.cs @@ -15,6 +15,7 @@ // along with this program. If not, see (http://www.gnu.org/licenses/). +using System.IO; using Gtk; namespace SparkleShare { @@ -64,14 +65,17 @@ namespace SparkleShare { Controller.UpdateTitleEvent += delegate (string title) { Application.Invoke (delegate { Title = title; }); }; - - CreateNote (); } private void CreateNote () { - var user_image = new Image (Controller.AvatarFilePath); + Image user_image; + + if (File.Exists (Controller.AvatarFilePath)) + user_image = new Image (Controller.AvatarFilePath); + else + user_image = UserInterfaceHelpers.GetImage ("user-icon-default.png"); /* TODO: Style the entry neatly, multiple lines, and add placeholder text string balloon_image_path = new string [] { UserInterface.AssetsPath, "pixmaps", "text-balloon.png" }.Combine ();