1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-23 12:15:48 +02:00

Fix scrollbar in Options not working after focusing certain controls

This commit is contained in:
chylex 2017-06-23 19:01:09 +02:00
parent c641a92d89
commit 28eb7d0810
2 changed files with 21 additions and 1 deletions

View File

@ -105,6 +105,10 @@ private void SelectTab(SettingsTab tab){
tab.Button.BackColor = tab.Button.FlatAppearance.MouseDownBackColor;
if (!tab.IsInitialized){
foreach(Control control in tab.Control.InteractiveControls){
control.MouseLeave += control_MouseLeave;
}
tab.Control.OnReady();
}
@ -118,6 +122,10 @@ private void SelectTab(SettingsTab tab){
currentTab = tab;
}
private void control_MouseLeave(object sender, EventArgs e){
panelContents.Focus();
}
private class SettingsTab{
public Button Button { get; }

View File

@ -1,10 +1,22 @@
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using TweetDuck.Configuration;
namespace TweetDuck.Core.Other.Settings{
class BaseTabSettings : UserControl{
protected static UserConfig Config => Program.UserConfig;
public IEnumerable<Control> InteractiveControls{
get{
foreach(Panel panel in Controls.OfType<Panel>()){
foreach(Control control in panel.Controls){
yield return control;
}
}
}
}
public BaseTabSettings(){
Padding = new Padding(6);
}