Skip to content

Commit

Permalink
Fixed issue with transparency slider when in HiDPI
Browse files Browse the repository at this point in the history
  • Loading branch information
mscrivo committed Apr 27, 2014
1 parent eb42e2e commit 72fa5d9
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 85 deletions.
16 changes: 13 additions & 3 deletions OutlookDesktop.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30110.0
VisualStudioVersion = 12.0.30324.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OutlookDesktop", "OutlookDesktop\OutlookDesktop.csproj", "{C38D62CC-0544-4D90-83B9-B222CB5A8EF1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetSparkle2010", "..\NetSparkle\NetSparkle\NetSparkle2010.csproj", "{74635A21-2BAD-4522-AB95-E3E5703CD301}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MACTrackBarLib", "..\MACTrackBarLib\MACTrackBarLib\MACTrackBarLib.csproj", "{77A112B1-5440-440B-A0F6-2EDCC5B093CB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand All @@ -25,12 +27,20 @@ Global
{74635A21-2BAD-4522-AB95-E3E5703CD301}.Debug|x64.ActiveCfg = Debug|Any CPU
{74635A21-2BAD-4522-AB95-E3E5703CD301}.Debug|x64.Build.0 = Debug|Any CPU
{74635A21-2BAD-4522-AB95-E3E5703CD301}.Debug|x64.Deploy.0 = Debug|Any CPU
{74635A21-2BAD-4522-AB95-E3E5703CD301}.Debug|x86.ActiveCfg = Debug|Any CPU
{74635A21-2BAD-4522-AB95-E3E5703CD301}.Debug|x86.Build.0 = Debug|Any CPU
{74635A21-2BAD-4522-AB95-E3E5703CD301}.Debug|x86.ActiveCfg = Debug|x86
{74635A21-2BAD-4522-AB95-E3E5703CD301}.Debug|x86.Build.0 = Debug|x86
{74635A21-2BAD-4522-AB95-E3E5703CD301}.Release|x64.ActiveCfg = Release|Any CPU
{74635A21-2BAD-4522-AB95-E3E5703CD301}.Release|x64.Build.0 = Release|Any CPU
{74635A21-2BAD-4522-AB95-E3E5703CD301}.Release|x86.ActiveCfg = Release|x86
{74635A21-2BAD-4522-AB95-E3E5703CD301}.Release|x86.Build.0 = Release|x86
{77A112B1-5440-440B-A0F6-2EDCC5B093CB}.Debug|x64.ActiveCfg = Debug|Any CPU
{77A112B1-5440-440B-A0F6-2EDCC5B093CB}.Debug|x64.Build.0 = Debug|Any CPU
{77A112B1-5440-440B-A0F6-2EDCC5B093CB}.Debug|x86.ActiveCfg = Debug|Any CPU
{77A112B1-5440-440B-A0F6-2EDCC5B093CB}.Debug|x86.Build.0 = Debug|Any CPU
{77A112B1-5440-440B-A0F6-2EDCC5B093CB}.Release|x64.ActiveCfg = Release|Any CPU
{77A112B1-5440-440B-A0F6-2EDCC5B093CB}.Release|x64.Build.0 = Release|Any CPU
{77A112B1-5440-440B-A0F6-2EDCC5B093CB}.Release|x86.ActiveCfg = Release|Any CPU
{77A112B1-5440-440B-A0F6-2EDCC5B093CB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
5 changes: 2 additions & 3 deletions OutlookDesktop/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0"?>

<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
</configuration>
101 changes: 43 additions & 58 deletions OutlookDesktop/Forms/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 33 additions & 8 deletions OutlookDesktop/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -68,7 +69,7 @@ public partial class MainForm : Form
/// </summary>
/// <param name="instanceName">The name of the instance to display.</param>
public MainForm(String instanceName)
{
{
try
{
InitializeComponent();
Expand Down Expand Up @@ -411,7 +412,6 @@ private void CheckSelectedView(ToolStripMenuItem viewItem)
/// <returns></returns>
private static string GetFolderNameFromFullPath(string fullPath)
{
//TODO: Revert back and deal with online/offline better!
return fullPath.Substring(fullPath.LastIndexOf("\\", StringComparison.Ordinal) + 1,
fullPath.Length - fullPath.LastIndexOf("\\", StringComparison.Ordinal) - 1);
}
Expand Down Expand Up @@ -779,7 +779,7 @@ private void DisableEnableEditingMenu_Click(object sender, EventArgs e)

private void RemoveInstanceMenu_Click(object sender, EventArgs e)
{
var result = MessageBox.Show(this.Parent, Resources.RemoveInstanceConfirmation,
var result = MessageBox.Show(Parent, Resources.RemoveInstanceConfirmation,
Resources.ConfirmationCaption, MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
if (result == DialogResult.Yes)
Expand Down Expand Up @@ -909,47 +909,72 @@ private void LabelCurrentDate_MouseDown(object sender, MouseEventArgs e)
}
}

#region "Resize Cursor Reset Events"
#region "Resize Cursor Reset Events"
private void HeaderPanel_MouseMove(object sender, MouseEventArgs e)
{
ResizeDir = ResizeDirection.None;
Cursor = Cursors.SizeAll;
}

private void WorkWeekButton_MouseHover(object sender, EventArgs e)
{
ResizeDir = ResizeDirection.None;
Cursor = Cursors.Default;
}

private void DayButton_MouseHover(object sender, EventArgs e)
{
ResizeDir = ResizeDirection.None;
Cursor = Cursors.Default;
}

private void TodayButton_MouseHover(object sender, EventArgs e)
{
ResizeDir = ResizeDirection.None;
Cursor = Cursors.Default;
}

private void WeekButton_MouseHover(object sender, EventArgs e)
{
ResizeDir = ResizeDirection.None;
Cursor = Cursors.Default;
}

private void MonthButton_MouseHover(object sender, EventArgs e)
{
ResizeDir = ResizeDirection.None;
Cursor = Cursors.Default;
}

private void ButtonPrevious_MouseHover(object sender, EventArgs e)
{
ResizeDir = ResizeDirection.None;
Cursor = Cursors.Default;
}

private void ButtonNext_MouseHover(object sender, EventArgs e)
{
ResizeDir = ResizeDirection.None;
Cursor = Cursors.Default;
}
#endregion

private void TransparencySlider_MouseHover(object sender, EventArgs e)
{
ResizeDir = ResizeDirection.None;
Cursor = Cursors.Default;
}

private void sliderContainerPanel_MouseHover(object sender, EventArgs e)
{
ResizeDir = ResizeDirection.None;
Cursor = Cursors.Default;
}

private void LabelCurrentDate_MouseHover(object sender, EventArgs e)
{
Cursor = Cursors.SizeAll;
}
#endregion

private void SetViewXml(string value)
{
Expand Down Expand Up @@ -1037,7 +1062,7 @@ private void SetCurrentViewControlAsActiveIfNecessary(CurrentCalendarView mode,
if (InstanceManager.InstanceCount == 1) return;

// we can bail if we know the last button clicked was the one on this form.
if ((Guid) button.Tag == lastButtonGuidClicked) return;
if ((Guid)button.Tag == lastButtonGuidClicked) return;

var currentDate = axOutlookViewControl.SelectedDate;
switch (mode)
Expand Down Expand Up @@ -1076,9 +1101,9 @@ private CurrentCalendarView GetCurrentCalendarViewMode()
return mode;
}

private void TransparencySlider_Scroll(object sender, EventArgs e)
private void TransparencySlider_ValueChanged(object sender, decimal value)
{
double opacityVal = (double)TransparencySlider.Value / 100;
var opacityVal = (double)(value / 100);
if (Math.Abs(opacityVal - 1) < double.Epsilon)
{
opacityVal = 0.99;
Expand Down
Loading

0 comments on commit 72fa5d9

Please sign in to comment.