Skip to content
Open
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
67 changes: 65 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,74 @@
# Windows-RoundedScreen

**THIS PROJECT IS NOT MAINTAINED BUT I FREQUENTLY CHECK THE PULL REQUESTS**

A simple workaround to get rounded screen corners on Windows.

LATEST CHANGES (26/01/2023) :
> 🖥️ [Download RoundedScreen.exe](https://github.com/BeezBeez/Windows-RoundedScreen/releases/latest/download/RoundedScreen.exe)

## Customize rounded corners

The program runs in the Windows taskbar.

Right-clicking the program provides options for customizing the rounded corners style and radius:

![](png.png)

Your selections are automatically saved, and will be the same when you reopen the program.

## Troubleshooting

**Program doesn't appear in taskbar on Windows 11**

If you are using Windows 11, you will need to add the program to your taskbar:

1. Run the program
2. Right-click your taskbar and select "Taskbar settings"
3. In the Settings select "Other system tray icons"
4. Enable the system tray icon for "RoundedScreen"

# Changelog

## Latest changes

- hidden from alt+tab list
- made corners a bit smaller
- added an AppIcon
- upped the version number
- added a command to quit the program
- added program to taskbar with corner size options
- added superellipse rounding style for smoother corners
- customization of corner style and size is now saved between sessions

**THIS PROJECT IS NOT MAINTAINED BUT I FREQUENTLY CHECK THE PULL REQUESTS**
# How to build this project

## Prerequisites

- **Visual Studio 2022 Build Tools** with the Managed Desktop workload
- **.NET Framework 4.7.2 Targeting Pack** (installed as a component of Build Tools)

## Install

Install prerequisites:

```bat
install.bat
```

## Build

Build the program:

```bat
build.bat
```

Program is built to `RoundedScreen/bin/Release/RoundedScreen.exe`.

## Run

Run the program after building:

```bat
run.bat
```
102 changes: 100 additions & 2 deletions RoundedScreen/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,115 @@
using System;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;

namespace RoundedScreen
{
/// <summary>
/// Logique d'interaction pour App.xaml
/// </summary>
public partial class App : Application
public partial class App : System.Windows.Application
{
private NotifyIcon _trayIcon;

protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);

_trayIcon = new NotifyIcon();
_trayIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.Windows.Forms.Application.ExecutablePath);
_trayIcon.Visible = true;
_trayIcon.Text = "RoundedScreen";

var menu = new ContextMenuStrip();

void AddSizeItem(string text, int size)
{
var item = new ToolStripMenuItem(text);
item.Click += (s, a) => ApplySize(size);
menu.Items.Add(item);
}

menu.Items.Add(new ToolStripLabel("Corner size"));
menu.Items.Add(new ToolStripSeparator());
int[] presets = new int[] { 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 40, 48, 56, 64 };
foreach (var size in presets)
{
AddSizeItem($"{size} px", size);
}
menu.Items.Add(new ToolStripSeparator());

// Rounding mode section
menu.Items.Add(new ToolStripLabel("Rounding mode"));
var simpleItem = new ToolStripMenuItem("Simple (Circle)") { CheckOnClick = true };
var smoothItem = new ToolStripMenuItem("Smooth (Squircle)") { CheckOnClick = true };

// Initialize checked state from registry
var wndInit = Current.Windows.OfType<MainWindow>().FirstOrDefault();
var currentMode = wndInit?.ReadRoundingMode() ?? RoundedScreen.MainWindow.RoundingMode.Smooth;
simpleItem.Checked = currentMode == RoundedScreen.MainWindow.RoundingMode.Simple;
smoothItem.Checked = currentMode == RoundedScreen.MainWindow.RoundingMode.Smooth;

void ApplyMode(RoundedScreen.MainWindow.RoundingMode mode)
{
var wnd = Current.Windows.OfType<MainWindow>().FirstOrDefault();
if (wnd != null)
{
wnd.SaveRoundingMode(mode);
int size = wnd.ReadCornerSize();
wnd.ApplyCornerSize(size);
}
}

simpleItem.Click += (s, a) =>
{
simpleItem.Checked = true;
smoothItem.Checked = false;
ApplyMode(RoundedScreen.MainWindow.RoundingMode.Simple);
};
smoothItem.Click += (s, a) =>
{
simpleItem.Checked = false;
smoothItem.Checked = true;
ApplyMode(RoundedScreen.MainWindow.RoundingMode.Smooth);
};

menu.Items.Add(simpleItem);
menu.Items.Add(smoothItem);
menu.Items.Add(new ToolStripSeparator());

var exitItem = new ToolStripMenuItem("Exit");
exitItem.Click += (s, a) => ExitApplication();
menu.Items.Add(exitItem);

_trayIcon.ContextMenuStrip = menu;
}

private void ApplySize(int size)
{
var wnd = Current.Windows.OfType<MainWindow>().FirstOrDefault();
if (wnd != null)
{
wnd.ApplyCornerSize(size);
wnd.SaveCornerSize(size);
}
}

private void ExitApplication()
{
var wnd = Current.Windows.OfType<MainWindow>().FirstOrDefault();
if (wnd != null)
{
wnd.AllowClose();
wnd.Close();
}
_trayIcon.Visible = false;
_trayIcon.Dispose();
Shutdown();
}
}
}
43 changes: 26 additions & 17 deletions RoundedScreen/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Window x:Name="wndRoundedScreen" x:Class="RoundedScreen.MainWindow"
<Window x:Name="wndRoundedScreen" x:Class="RoundedScreen.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Expand All @@ -24,37 +24,46 @@
Opacity="0.0" />
</Window.Background>
<Grid x:Name="grid">
<Image x:Name="imgCornerTL" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Top" Width="16" Source="Resources/Corner.png"/>
<Image x:Name="imgCornerTR" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Top" Width="16" Source="Resources/Corner.png" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<Path x:Name="pathCornerTL" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0" Width="16" Fill="#FF000000" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="90"/>
<RotateTransform Angle="180"/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image x:Name="imgCornerBR" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Bottom" Width="16" Source="Resources/Corner.png" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
</Path.RenderTransform>
</Path>
<Path x:Name="pathCornerTR" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0" Width="16" Fill="#FF000000" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="180"/>
<RotateTransform Angle="270"/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image x:Name="imgCornerBL" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Bottom" Width="16" Source="Resources/Corner.png" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
</Path.RenderTransform>
</Path>
<Path x:Name="pathCornerBR" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0" Width="16" Fill="#FF000000" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="270"/>
<RotateTransform Angle="0"/>
<TranslateTransform/>
</TransformGroup>
</Path.RenderTransform>
</Path>
<Path x:Name="pathCornerBL" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="0" Width="16" Fill="#FF000000" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="90"/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
</Path.RenderTransform>
</Path>

</Grid>
</Window>
Loading