refactor: repository configure

* move button to the left
* change view type from Popup to ChromelessWindow
This commit is contained in:
leo 2024-07-25 10:59:06 +08:00
parent 0fb121e6ed
commit 31f918071f
No known key found for this signature in database
6 changed files with 115 additions and 45 deletions

View file

@ -427,13 +427,6 @@ namespace SourceGit.ViewModels
PopupHost.ShowAndStartPopup(new Cleanup(this));
}
public void OpenConfigure()
{
if (!PopupHost.CanCreatePopup())
return;
PopupHost.ShowPopup(new RepositoryConfigure(this));
}
public void ClearHistoriesFilter()
{
_settings.Filters.Clear();

View file

@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
namespace SourceGit.ViewModels
{
public class RepositoryConfigure : Popup
public class RepositoryConfigure : ObservableObject
{
public string UserName
{
@ -58,11 +58,9 @@ namespace SourceGit.ViewModels
GPGUserSigningKey = signingKey;
if (_cached.TryGetValue("http.proxy", out var proxy))
HttpProxy = proxy;
View = new Views.RepositoryConfigure() { DataContext = this };
}
public override Task<bool> Sure()
public void Save()
{
SetIfChanged("user.name", UserName);
SetIfChanged("user.email", UserEmail);
@ -70,7 +68,6 @@ namespace SourceGit.ViewModels
SetIfChanged("tag.gpgsign", GPGTagSigningEnabled ? "true" : "false");
SetIfChanged("user.signingkey", GPGUserSigningKey);
SetIfChanged("http.proxy", HttpProxy);
return null;
}
private void SetIfChanged(string key, string value)