Skip to content

Commit

Permalink
Release/3.0.0 (#120)
Browse files Browse the repository at this point in the history
* set version to 3.0.7

* set relative path to images

* update readme.md

* remove RegistryTool.cs

* code cleanup
  • Loading branch information
bNobo authored Apr 23, 2024
1 parent 04dddb2 commit 9676034
Show file tree
Hide file tree
Showing 20 changed files with 377 additions and 454 deletions.
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

0 comments on commit 9676034

Please sign in to comment.