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

Add an option to disable screenshot window border

This commit is contained in:
chylex 2017-01-08 02:47:47 +01:00
parent 9252b3040e
commit 50a8893f4f
4 changed files with 34 additions and 3 deletions

View File

@ -14,7 +14,7 @@ namespace TweetDck.Configuration{
sealed class UserConfig{
private static readonly IFormatter Formatter = new BinaryFormatter{ Binder = new CustomBinder() };
private const int CurrentFileVersion = 5;
private const int CurrentFileVersion = 6;
// START OF CONFIGURATION
@ -30,6 +30,7 @@ sealed class UserConfig{
public bool EnableSpellCheck { get; set; }
public bool ExpandLinksOnHover { get; set; }
public bool ShowScreenshotBorder { get; set; }
public bool EnableTrayHighlight { get; set; }
public bool EnableUpdateCheck { get; set; }
@ -117,6 +118,7 @@ private UserConfig(string file){
NotificationDurationValue = 25;
EnableUpdateCheck = true;
ExpandLinksOnHover = true;
ShowScreenshotBorder = true;
EnableTrayHighlight = true;
Plugins = new PluginConfig();
PluginsWindow = new WindowState();
@ -161,6 +163,11 @@ private void UpgradeFile(){
++fileVersion;
}
if (fileVersion == 5){
ShowScreenshotBorder = true;
++fileVersion;
}
// update the version
fileVersion = CurrentFileVersion;
Save();

View File

@ -23,6 +23,8 @@ public void LoadNotificationForScreenshot(TweetNotification tweet, int width, in
browser.LoadHtml(tweet.GenerateHtml(enableCustomCSS: false), "http://tweetdeck.twitter.com/?"+DateTime.Now.Ticks);
Location = ControlExtensions.InvisibleLocation;
FormBorderStyle = Program.UserConfig.ShowScreenshotBorder ? FormBorderStyle.FixedToolWindow : FormBorderStyle.None;
SetNotificationSize(width, height, false);
}

View File

@ -29,6 +29,7 @@ private void InitializeComponent() {
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.checkTrayHighlight = new System.Windows.Forms.CheckBox();
this.checkSpellCheck = new System.Windows.Forms.CheckBox();
this.checkScreenshotBorder = new System.Windows.Forms.CheckBox();
this.groupTray = new System.Windows.Forms.GroupBox();
this.labelTrayIcon = new System.Windows.Forms.Label();
this.groupInterface = new System.Windows.Forms.GroupBox();
@ -87,12 +88,24 @@ private void InitializeComponent() {
this.checkSpellCheck.UseVisualStyleBackColor = true;
this.checkSpellCheck.CheckedChanged += new System.EventHandler(this.checkSpellCheck_CheckedChanged);
//
// checkScreenshotBorder
//
this.checkScreenshotBorder.AutoSize = true;
this.checkScreenshotBorder.Location = new System.Drawing.Point(9, 67);
this.checkScreenshotBorder.Name = "checkScreenshotBorder";
this.checkScreenshotBorder.Size = new System.Drawing.Size(169, 17);
this.checkScreenshotBorder.TabIndex = 16;
this.checkScreenshotBorder.Text = "Include Border In Screenshots";
this.toolTip.SetToolTip(this.checkScreenshotBorder, "Shows the window border in tweet screenshots.");
this.checkScreenshotBorder.UseVisualStyleBackColor = true;
this.checkScreenshotBorder.CheckedChanged += new System.EventHandler(this.checkScreenshotBorder_CheckedChanged);
//
// groupTray
//
this.groupTray.Controls.Add(this.checkTrayHighlight);
this.groupTray.Controls.Add(this.labelTrayIcon);
this.groupTray.Controls.Add(this.comboBoxTrayType);
this.groupTray.Location = new System.Drawing.Point(9, 86);
this.groupTray.Location = new System.Drawing.Point(9, 109);
this.groupTray.Name = "groupTray";
this.groupTray.Size = new System.Drawing.Size(183, 93);
this.groupTray.TabIndex = 15;
@ -111,11 +124,12 @@ private void InitializeComponent() {
//
// groupInterface
//
this.groupInterface.Controls.Add(this.checkScreenshotBorder);
this.groupInterface.Controls.Add(this.checkSpellCheck);
this.groupInterface.Controls.Add(this.checkExpandLinks);
this.groupInterface.Location = new System.Drawing.Point(9, 9);
this.groupInterface.Name = "groupInterface";
this.groupInterface.Size = new System.Drawing.Size(183, 71);
this.groupInterface.Size = new System.Drawing.Size(183, 90);
this.groupInterface.TabIndex = 16;
this.groupInterface.TabStop = false;
this.groupInterface.Text = "User Interface";
@ -146,5 +160,6 @@ private void InitializeComponent() {
private System.Windows.Forms.Label labelTrayIcon;
private System.Windows.Forms.CheckBox checkTrayHighlight;
private System.Windows.Forms.CheckBox checkSpellCheck;
private System.Windows.Forms.CheckBox checkScreenshotBorder;
}
}

View File

@ -14,6 +14,7 @@ public TabSettingsGeneral(){
checkExpandLinks.Checked = Config.ExpandLinksOnHover;
checkSpellCheck.Checked = Config.EnableSpellCheck;
checkScreenshotBorder.Checked = Config.ShowScreenshotBorder;
checkTrayHighlight.Checked = Config.EnableTrayHighlight;
}
@ -30,6 +31,12 @@ private void checkSpellCheck_CheckedChanged(object sender, EventArgs e){
PromptRestart();
}
private void checkScreenshotBorder_CheckedChanged(object sender, EventArgs e){
if (!Ready)return;
Config.ShowScreenshotBorder = checkScreenshotBorder.Checked;
}
private void comboBoxTrayType_SelectedIndexChanged(object sender, EventArgs e){
if (!Ready)return;