1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-08-01 13:59:02 +02:00

Fix example notification not running notification.js script (breaking links)

This commit is contained in:
chylex 2016-05-11 17:40:41 +02:00
parent 40acb49011
commit bea158b0d9
3 changed files with 11 additions and 9 deletions

View File

@ -22,6 +22,7 @@ private static UserConfig Config{
public string UpdateInstallerPath { get; private set; }
private readonly ChromiumWebBrowser browser;
private readonly TweetDeckBridge bridge;
private readonly FormNotification notification;
private FormSettings currentFormSettings;
@ -35,7 +36,7 @@ public FormBrowser(){
Text = Program.BrandName;
TweetDeckBridge bridge = new TweetDeckBridge(this);
bridge = new TweetDeckBridge(this);
browser = new ChromiumWebBrowser("https://tweetdeck.twitter.com/"){
MenuHandler = new ContextMenuBrowser(this),
@ -56,7 +57,8 @@ public FormBrowser(){
UpdateTrayIcon();
notification = new FormNotification(this,bridge,true){ CanMoveWindow = () => false };
notification = CreateNotificationForm(true);
notification.CanMoveWindow = () => false;
notification.Show();
}
@ -65,6 +67,10 @@ private void ShowChildForm(Form form){
form.MoveToCenter(this);
}
public FormNotification CreateNotificationForm(bool autoHide){
return new FormNotification(this,bridge,autoHide);
}
// window setup
private void SetupWindow(){

View File

@ -60,10 +60,7 @@ public FormNotification(Form owner, TweetDeckBridge bridge, bool autoHide){
browser = new ChromiumWebBrowser("about:blank"){ MenuHandler = new ContextMenuNotification(this,autoHide) };
browser.FrameLoadEnd += Browser_FrameLoadEnd;
if (bridge != null){
browser.RegisterJsObject("$TD",bridge);
}
browser.RegisterJsObject("$TD",bridge);
panelBrowser.Controls.Add(browser);
@ -75,8 +72,6 @@ public FormNotification(Form owner, TweetDeckBridge bridge, bool autoHide){
Disposed += (sender, args) => browser.Dispose();
}
public FormNotification(Form owner, bool autoHide) : this(owner,null,autoHide){}
protected override void WndProc(ref Message m){
if (m.Msg == 0x0112 && (m.WParam.ToInt32() & 0xFFF0) == 0xF010 && !CanMoveWindow()){ // WM_SYSCOMMAND, SC_MOVE
return;

View File

@ -20,7 +20,8 @@ public FormSettings(FormBrowser browserForm){
Text = Program.BrandName+" Settings";
notification = new FormNotification(browserForm,false){ CanMoveWindow = () => radioLocCustom.Checked };
notification = browserForm.CreateNotificationForm(false);
notification.CanMoveWindow = () => radioLocCustom.Checked;
notification.Move += (sender, args) => {
if (radioLocCustom.Checked){