1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-25 08:34:05 +02:00

Generalize PluginListFlowLayout and move it

This commit is contained in:
chylex 2019-07-15 00:49:28 +02:00
parent 26d2d7a51e
commit a34a02e14d
3 changed files with 6 additions and 11 deletions

View File

@ -1,13 +1,8 @@
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Utils; using TweetDuck.Core.Utils;
namespace TweetDuck.Plugins{ namespace TweetDuck.Core.Controls{
sealed class PluginListFlowLayout : FlowLayoutPanel{ sealed class FlowLayoutPanelNoHScroll : FlowLayoutPanel{
public PluginListFlowLayout(){
FlowDirection = FlowDirection.TopDown;
WrapContents = false;
}
protected override void WndProc(ref Message m){ protected override void WndProc(ref Message m){
if (m.Msg == 0x85){ // WM_NCPAINT if (m.Msg == 0x85){ // WM_NCPAINT
NativeMethods.ShowScrollBar(Handle, NativeMethods.SB_HORZ, false); // basically fuck the horizontal scrollbar very much NativeMethods.ShowScrollBar(Handle, NativeMethods.SB_HORZ, false); // basically fuck the horizontal scrollbar very much

View File

@ -1,4 +1,4 @@
using TweetDuck.Plugins; using TweetDuck.Core.Controls;
namespace TweetDuck.Core.Other { namespace TweetDuck.Core.Other {
partial class FormPlugins { partial class FormPlugins {
@ -29,7 +29,7 @@ private void InitializeComponent() {
this.btnClose = new System.Windows.Forms.Button(); this.btnClose = new System.Windows.Forms.Button();
this.btnReload = new System.Windows.Forms.Button(); this.btnReload = new System.Windows.Forms.Button();
this.btnOpenFolder = new System.Windows.Forms.Button(); this.btnOpenFolder = new System.Windows.Forms.Button();
this.flowLayoutPlugins = new PluginListFlowLayout(); this.flowLayoutPlugins = new FlowLayoutPanelNoHScroll();
this.timerLayout = new System.Windows.Forms.Timer(this.components); this.timerLayout = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout(); this.SuspendLayout();
// //
@ -119,7 +119,7 @@ private void InitializeComponent() {
private System.Windows.Forms.Button btnClose; private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnReload; private System.Windows.Forms.Button btnReload;
private System.Windows.Forms.Button btnOpenFolder; private System.Windows.Forms.Button btnOpenFolder;
private PluginListFlowLayout flowLayoutPlugins; private FlowLayoutPanelNoHScroll flowLayoutPlugins;
private System.Windows.Forms.Timer timerLayout; private System.Windows.Forms.Timer timerLayout;
} }
} }

View File

@ -247,7 +247,7 @@
<DependentUpon>PluginControl.cs</DependentUpon> <DependentUpon>PluginControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Plugins\PluginDispatcher.cs" /> <Compile Include="Plugins\PluginDispatcher.cs" />
<Compile Include="Plugins\PluginListFlowLayout.cs"> <Compile Include="Core\Controls\FlowLayoutPanelNoHScroll.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="Configuration\PluginConfig.cs" /> <Compile Include="Configuration\PluginConfig.cs" />