WIP: main form ui

This commit is contained in:
Ray committed 2021-09-09 22:39:23 +01:00
1 parent f58608fc23
commit d575c66ed9
10 files changed
+390 -258

No files matched your search

+45 -41
View File
@@ -273,7 +273,6 @@ namespace RyzStudio.Windows.Forms
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool AllowBeginEdit { get; set; } = false;
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool HasChanged
{
@@ -607,7 +606,7 @@ namespace RyzStudio.Windows.Forms
public void SetNoChanges()
{
hasChanged = false;
this.HasChanged = false;
}
public void Sort() => Sort(this.SelectedNode);
@@ -631,7 +630,7 @@ namespace RyzStudio.Windows.Forms
}
#region integrated behaviour
#region integrated behaviour
protected override void OnItemDrag(ItemDragEventArgs e)
{
@@ -836,50 +835,55 @@ namespace RyzStudio.Windows.Forms
base.OnPreviewKeyDown(e);
}
#endregion
#endregion
protected int addIcon(BookmarkItemViewModel viewModel) => addIcon(viewModel.ToModel());
protected int addIcon(BookmarkItemModel model)
protected int addIcon(BookmarkItemViewModel viewModel)
{
return (int)IconSet.Default;
if (this.ImageList.Images.ContainsKey(model.SiteAddress))
{
return this.ImageList.Images.IndexOfKey(model.SiteAddress);
}
//if (iconDatabase.HasIcon(model.SiteAddress))
//{
// Image rs = iconDatabase.GetIcon(model.SiteAddress);
// if (rs == null)
// {
// return (int)IconSet.Default;
// }
// else
// {
// this.Add(this.ImageList, model.SiteAddress, rs);
// return this.ImageList.Images.IndexOfKey(model.SiteAddress);
// }
//}
byte[] rawData;
Bitmap bmp = model.RetrieveFavicon(out rawData);
if (bmp == null)
{
return (int)IconSet.Default;
}
ThreadControl.Add(this, this.ImageList, model.SiteAddress, bmp);
//iconDatabase.AddIcon(model.SiteAddress, rawData);
return this.ImageList.Images.IndexOfKey(model.SiteAddress);
}
//protected int addIcon(BookmarkItemViewModel viewModel) => addIcon(viewModel.ToModel());
//protected int addIcon(BookmarkItemModel model)
//{
// return (int)IconSet.Default;
// if (this.ImageList.Images.ContainsKey(model.SiteAddress))
// {
// return this.ImageList.Images.IndexOfKey(model.SiteAddress);
// }
// //if (iconDatabase.HasIcon(model.SiteAddress))
// //{
// // Image rs = iconDatabase.GetIcon(model.SiteAddress);
// // if (rs == null)
// // {
// // return (int)IconSet.Default;
// // }
// // else
// // {
// // this.Add(this.ImageList, model.SiteAddress, rs);
// // return this.ImageList.Images.IndexOfKey(model.SiteAddress);
// // }
// //}
// byte[] rawData;
// Bitmap bmp = model.RetrieveFavicon(out rawData);
// if (bmp == null)
// {
// return (int)IconSet.Default;
// }
// ThreadControl.Add(this, this.ImageList, model.SiteAddress, bmp);
// //iconDatabase.AddIcon(model.SiteAddress, rawData);
// return this.ImageList.Images.IndexOfKey(model.SiteAddress);
//}
protected TreeNode AddFolderPath(string path)
{
TreeNode tn = null;