mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-21 23:34:07 +02:00
Add an example tweet to the Settings Form
This commit is contained in:
parent
496c1a91a3
commit
3b10bc9c7c
@ -19,8 +19,8 @@ public FormNotification(Form owner){
|
|||||||
|
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
|
|
||||||
browser = new ChromiumWebBrowser(""){ MenuHandler = new MenuHandlerEmpty() };
|
browser = new ChromiumWebBrowser("about:blank"){ MenuHandler = new MenuHandlerEmpty() };
|
||||||
Controls.Add(browser);
|
panelBrowser.Controls.Add(browser);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowNotification(TweetNotification notification){
|
public void ShowNotification(TweetNotification notification){
|
||||||
@ -33,8 +33,12 @@ public void ShowNotification(TweetNotification notification){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowNotificationForSettings(){
|
if (browser.Address == "about:blank"){
|
||||||
browser.Load("about:blank");
|
browser.Load("about:blank");
|
||||||
|
browser.LoadHtml(TweetNotification.ExampleTweet.GenerateHtml(),"http://tweetdeck.twitter.com/");
|
||||||
|
resetAnimation = true;
|
||||||
|
}
|
||||||
|
|
||||||
MoveToVisibleLocation();
|
MoveToVisibleLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,8 +23,12 @@ public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IF
|
|||||||
|
|
||||||
model.AddItem(CefMenuCommand.Reload,"Reload");
|
model.AddItem(CefMenuCommand.Reload,"Reload");
|
||||||
model.AddSeparator();
|
model.AddSeparator();
|
||||||
model.AddItem((CefMenuCommand)MenuSettings,"Settings");
|
|
||||||
model.AddSeparator();
|
if (TweetNotification.IsReady){
|
||||||
|
model.AddItem((CefMenuCommand)MenuSettings,"Settings");
|
||||||
|
model.AddSeparator();
|
||||||
|
}
|
||||||
|
|
||||||
model.AddItem((CefMenuCommand)MenuAbout,"About TweetDick");
|
model.AddItem((CefMenuCommand)MenuAbout,"About TweetDick");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,30 @@ sealed class TweetNotification{
|
|||||||
private static string FontSizeClass { get; set; }
|
private static string FontSizeClass { get; set; }
|
||||||
private static string HeadTag { get; set; }
|
private static string HeadTag { get; set; }
|
||||||
|
|
||||||
|
public static bool IsReady{
|
||||||
|
get{
|
||||||
|
return FontSizeClass != null && HeadTag != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TweetNotification ExampleTweet{
|
||||||
|
get{
|
||||||
|
StringBuilder build = new StringBuilder();
|
||||||
|
build.Append(@"<article><div class='js-stream-item-content item-box js-show-detail'><div class='js-tweet tweet'>");
|
||||||
|
build.Append(@"<header class='tweet-header'>");
|
||||||
|
build.Append(@"<time class='tweet-timestamp js-timestamp pull-right txt-mute'><a target='_blank' rel='url' href='https://twitter.com/chylexMC' class='txt-small'>0s</a></time>");
|
||||||
|
build.Append(@"<a target='_blank' rel='user' href='https://twitter.com/chylexMC' class='account-link link-complex block'>");
|
||||||
|
build.Append(@"<div class='obj-left item-img tweet-img'><img width='48' height='48' alt='chylexMC's avatar' src='https://pbs.twimg.com/profile_images/645532929930608642/J56NBJVY_normal.png' class='tweet-avatar avatar pull-right'></div>");
|
||||||
|
build.Append(@"<div class='nbfc'><span class='account-inline txt-ellipsis'><b class='fullname link-complex-target'>chylex</b> <span class='username txt-mute'>@chylexMC</span></span></div>");
|
||||||
|
build.Append(@"</a>");
|
||||||
|
build.Append(@"</header>");
|
||||||
|
build.Append(@"<div class='tweet-body'><p class='js-tweet-text tweet-text with-linebreaks'>This is an example tweet, which lets you test the location and duration of popup notifications.</p></div>");
|
||||||
|
build.Append(@"</div></div></article>");
|
||||||
|
|
||||||
|
return new TweetNotification(build.ToString(),95);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void SetFontSizeClass(string newFSClass){
|
public static void SetFontSizeClass(string newFSClass){
|
||||||
FontSizeClass = newFSClass;
|
FontSizeClass = newFSClass;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user