Merge pull request #1822 from hbons/fix/gtk-widgets

Fix/gtk-widgets
This commit is contained in:
Hylke Bons 2018-03-08 20:13:03 +00:00 committed by GitHub
commit d1c9169c14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View file

@ -15,6 +15,7 @@
// along with this program. If not, see (http://www.gnu.org/licenses/).
using System.IO;
using Gtk;
namespace SparkleShare {
@ -55,6 +56,9 @@ namespace SparkleShare {
Controller.ShowWindowEvent += delegate {
Application.Invoke (delegate {
if (Child != null)
Remove (Child);
CreateNote ();
ShowAll ();
Present ();
@ -64,14 +68,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 ();
@ -96,8 +103,9 @@ namespace SparkleShare {
var cancel_button = new Button ("Cancel");
var sync_button = new Button ("Sync"); // TODO: Make default button
sync_button.CanDefault = true;
var sync_button = new Button ("Sync") { CanDefault = true };
sync_button.StyleContext.AddClass ("suggested-action");
cancel_button.Clicked += delegate { Controller.CancelClicked (); };
sync_button.Clicked += delegate { Controller.SyncClicked (balloon.Buffer.Text); };

View file

@ -34,10 +34,9 @@ namespace Sparkles {
public string KnownHostsFilePath { get; private set; }
readonly string Path;
// TODO: Store keys in the platform's secure key store
public SSHAuthenticationInfo ()
{
Path = IO.Path.Combine (Configuration.DefaultConfiguration.DirectoryPath, "ssh");