Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/3.0.0 #120

Merged
merged 10 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Captures/en/taskbar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 0 additions & 12 deletions NeedABreak/AboutBoxWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using MahApps.Metro.Controls;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace NeedABreak
{
Expand Down
9 changes: 2 additions & 7 deletions NeedABreak/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ You should have received a copy of the GNU General Public License
using NeedABreak.Properties;
using NeedABreak.Utils;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using System.Windows.Threading;

namespace NeedABreak
{
Expand Down Expand Up @@ -88,7 +83,7 @@ static App()
_cumulativeScreenTime += interruptionDuration;
}
}

_dayStart = DateTime.Today;
_startShowingScreen = DateTime.Now;

Expand Down Expand Up @@ -283,7 +278,7 @@ private static void SystemEvents_SessionSwitch(object sender, Microsoft.Win32.Se
if (e.Reason == Microsoft.Win32.SessionSwitchReason.SessionUnlock)
{
Logger.Debug("SessionUnlock");

Current.Dispatcher.BeginInvoke(() =>
{
var mainWindow = GetMainWindow();
Expand Down
13 changes: 4 additions & 9 deletions NeedABreak/BorderSelectedAdorner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;
Expand All @@ -42,7 +37,7 @@ protected override void OnRender(DrawingContext drawingContext)
var pen = new Pen(brush, 6);
var whitePen = new Pen(Brushes.White, 8);
drawingContext.DrawRectangle(Brushes.Transparent, pen, adornedElementRect);
var miniRect = new Rect(adornedElementRect.Right - 50, adornedElementRect.Bottom - 50,
var miniRect = new Rect(adornedElementRect.Right - 50, adornedElementRect.Bottom - 50,
50, 50);
drawingContext.DrawRectangle(brush, pen, miniRect);
var p1 = new Point(adornedElementRect.Right - 40, adornedElementRect.Bottom - 25);
Expand All @@ -51,8 +46,8 @@ protected override void OnRender(DrawingContext drawingContext)
var p3 = new Point(p2.X + 20, p2.Y - 20);
drawingContext.DrawLine(whitePen, p1, p2);
drawingContext.DrawLine(whitePen, p4, p3);
}

}
}
}
4 changes: 0 additions & 4 deletions NeedABreak/Converters/BooleanToOppositeValueConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace NeedABreak.Converters
Expand Down
4 changes: 0 additions & 4 deletions NeedABreak/Converters/BooleanToVisibilityConverter.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

Expand Down
7 changes: 0 additions & 7 deletions NeedABreak/Enums/SuspensionCause.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace NeedABreak
{
public enum SuspensionCause
Expand Down
6 changes: 0 additions & 6 deletions NeedABreak/Enums/UserNotificationState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NeedABreak.Utils
{
public enum UserNotificationState
Expand Down
4 changes: 0 additions & 4 deletions NeedABreak/Extensions/TimeSpanExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NeedABreak.Extensions
{
Expand Down
7 changes: 3 additions & 4 deletions NeedABreak/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using MahApps.Metro.Controls;
using Microsoft.Win32;
using NeedABreak.Extensions;
using NeedABreak.Utils;
using System;
Expand Down Expand Up @@ -109,9 +108,9 @@ private async void LaunchOnStartupMenuItem_Unchecked(object sender, RoutedEventA
}

private async void LaunchOnStartupMenuItem_Checked(object sender, RoutedEventArgs e)
{
{
StartupTask startupTask = await StartupTask.GetAsync("NeedABreak.StartupTask");

switch (startupTask.State)
{
case StartupTaskState.Disabled:
Expand Down Expand Up @@ -387,7 +386,7 @@ private void AutomaticSuspensionMenuItem_Unchecked(object sender, RoutedEventArg

if (App.IsSuspended && App.SuspensionCause == SuspensionCause.Automatic)
{
App.Resume();
App.Resume();
}
}

Expand Down
Loading