From 64fcff88ae6fd680291387ad1349cd7702432768 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 1 Jun 2021 10:49:46 +0100 Subject: [PATCH] Fixed: big icons for folders --- Windows/Forms/Tile/TTilePanelLayout.cs | 44 ++++++++++++++------------ 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/Windows/Forms/Tile/TTilePanelLayout.cs b/Windows/Forms/Tile/TTilePanelLayout.cs index 283efbf..e0a0fb6 100644 --- a/Windows/Forms/Tile/TTilePanelLayout.cs +++ b/Windows/Forms/Tile/TTilePanelLayout.cs @@ -224,17 +224,21 @@ namespace AppLauncher.Windows.Forms { get { - if (this.Parent == null) + Control parentControl = this.Parent; + while (true) { - return null; - } + if (parentControl == null) + { + return null; + } - if (this.Parent.GetType() != typeof(FlowLayoutPanel)) - { - return null; - } + if (parentControl.GetType() == typeof(FlowLayoutPanel)) + { + return parentControl as FlowLayoutPanel; + } - return this.Parent as FlowLayoutPanel; + parentControl = parentControl.Parent; + } } } @@ -242,23 +246,21 @@ namespace AppLauncher.Windows.Forms { get { - FlowLayoutPanel layoutPanel = this.FlowLayoutPanel; - if (layoutPanel == null) + Control parentControl = this.FlowLayoutPanel; + while (true) { - return null; - } + if (parentControl == null) + { + return null; + } - if (layoutPanel.Parent == null) - { - return null; - } + if (parentControl.GetType() == typeof(MainForm)) + { + return parentControl as MainForm; + } - if (layoutPanel.Parent.GetType() != typeof(MainForm)) - { - return null; + parentControl = parentControl.Parent; } - - return layoutPanel.Parent as MainForm; } }