Skip to content

Commit

Permalink
Merge pull request #31 from beyluta/development
Browse files Browse the repository at this point in the history
Bugfixes and update readme
  • Loading branch information
beyluta committed Mar 11, 2023
2 parents 6eb07ab + 056b8b6 commit e1565c1
Show file tree
Hide file tree
Showing 15 changed files with 217 additions and 54 deletions.
Binary file added Assets/Images/dev-widget.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Images/open-widget.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Images/settings-widget.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Assets/Images/step1.png
Binary file not shown.
Binary file removed Assets/Images/step2.png
Binary file not shown.
Binary file removed Assets/Images/step3.png
Binary file not shown.
Binary file removed Assets/Images/step4.png
Binary file not shown.
Binary file removed Assets/Images/step5.png
Binary file not shown.
2 changes: 1 addition & 1 deletion Assets/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "1.1.7",
"version": "1.1.8",
"remoteResources": "https://7xdeveloper.com/api/AccessEndpoint.php?endpoint=getappconfigs&id=resources"
}
72 changes: 38 additions & 34 deletions Classes/Widget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using CefSharp.WinForms;
using System;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;

namespace Widgets
Expand Down Expand Up @@ -50,40 +51,43 @@ public override void AppendWidget(Form window, string path)

public override void CreateWindow(int width, int height, string title, FormStartPosition startPosition)
{
POINT mousePos;
GetCursorPos(out mousePos);

/*
@@ Extracting the <meta> tags from the html document.
*/
string sizeString = GetMetaTagValue("windowSize", widgetPath);
string radiusString = GetMetaTagValue("windowBorderRadius", widgetPath);
string locationString = GetMetaTagValue("windowLocation", widgetPath);
string topMostString = GetMetaTagValue("topMost", widgetPath);
string opacityString = GetMetaTagValue("windowOpacity", widgetPath);
int roundess = radiusString != null ? int.Parse(radiusString) : 0;
this.width = sizeString != null ? int.Parse(sizeString.Split(' ')[0]) : width;
this.height = sizeString != null ? int.Parse(sizeString.Split(' ')[1]) : height;
int locationX = locationString != null ? int.Parse(locationString.Split(' ')[0]) : mousePos.X;
int locationY = locationString != null ? int.Parse(locationString.Split(' ')[1]) : mousePos.Y;
byte opacity = (byte)(opacityString != null ? byte.Parse(opacityString.Split(' ')[0]) : 255);
bool topMost = topMostString != null ? bool.Parse(topMostString.Split(' ')[0]) : false;

window = new Form();
window.Size = new Size(this.width, this.height);
window.StartPosition = startPosition;
window.Location = new Point(locationX, locationY);
window.Text = title;
window.TopMost = topMost;
window.FormBorderStyle = FormBorderStyle.None;
window.ShowInTaskbar = false;
window.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, this.width, this.height, roundess, roundess)); // Border radius
window.Activated += OnFormActivated;
window.BackColor = Color.Black;

SetWindowTransparency(window.Handle, opacity);
AppendWidget(window, widgetPath);
window.ShowDialog();
new Thread(() =>
{
POINT mousePos;
GetCursorPos(out mousePos);
/*
@@ Extracting the <meta> tags from the html document.
*/
string sizeString = GetMetaTagValue("windowSize", widgetPath);
string radiusString = GetMetaTagValue("windowBorderRadius", widgetPath);
string locationString = GetMetaTagValue("windowLocation", widgetPath);
string topMostString = GetMetaTagValue("topMost", widgetPath);
string opacityString = GetMetaTagValue("windowOpacity", widgetPath);
int roundess = radiusString != null ? int.Parse(radiusString) : 0;
this.width = sizeString != null ? int.Parse(sizeString.Split(' ')[0]) : width;
this.height = sizeString != null ? int.Parse(sizeString.Split(' ')[1]) : height;
int locationX = locationString != null ? int.Parse(locationString.Split(' ')[0]) : mousePos.X;
int locationY = locationString != null ? int.Parse(locationString.Split(' ')[1]) : mousePos.Y;
byte opacity = (byte)(opacityString != null ? byte.Parse(opacityString.Split(' ')[0]) : 255);
bool topMost = topMostString != null ? bool.Parse(topMostString.Split(' ')[0]) : false;
window = new Form();
window.Size = new Size(this.width, this.height);
window.StartPosition = startPosition;
window.Location = new Point(locationX, locationY);
window.Text = title;
window.TopMost = topMost;
window.FormBorderStyle = FormBorderStyle.None;
window.ShowInTaskbar = false;
window.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, this.width, this.height, roundess, roundess)); // Border radius
window.Activated += OnFormActivated;
window.BackColor = Color.Black;
SetWindowTransparency(window.Handle, opacity);
AppendWidget(window, widgetPath);
window.ShowDialog();
}).Start();
}

private void OnBrowserInitialized(object sender, EventArgs e)
Expand Down
3 changes: 2 additions & 1 deletion Classes/WidgetMenuHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CefSharp;
using System;
using System.Windows.Forms;
using Widgets.Manager;

Expand Down Expand Up @@ -37,7 +38,7 @@ public bool OnContextMenuCommand(IWebBrowser chromiumWebBrowser, IBrowser browse
return true;

case (CefMenuCommand)2:
widget.window.Invoke(new MethodInvoker(delegate ()
widget.window.BeginInvoke(new Action(() =>
{
widget.window.Close();
WidgetAssets.widgets.RemoveWidget(widget);
Expand Down
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<p align="center">
<a href="https://github.com/beyluta/WinWidgets">
<img src="https://img.shields.io/badge/Version-1.1.7-green" alt="WinWidgets version" />
<img src="https://img.shields.io/badge/Version-1.1.8-green" alt="WinWidgets version" />
</a>
</p>

Expand Down Expand Up @@ -40,20 +40,14 @@ This is what makes this project interesting:

## Screenshots and usage

1. Dashboard with all your installed widgets
<br><img src="Assets/Images/step1.png">
#### Drag & Drop your widgets to install
<br><img src="Assets/Images/open-widget.gif">

2. Click on any widget to open it up
<br><img src="Assets/Images/step2.png">

3. Right-click on the widget to see the menu
<br><img src="Assets/Images/step3.png">

4. The application stays in the system tray when minimized
<br><img src="Assets/Images/step4.png">

5. Go to your widgets folder under `C://Users/USER/Documents` to add new widgets. There is a sample widget under `Assets/Samples` copy the html file to the widgets folder
<br><img src="Assets/Images/step5.png">
#### The settings panel will show you the version of the app and its settings
<br><img src="Assets/Images/settings-widget.gif">

#### Develop your own widgets easily. Find out more by navigating to the development panel
<br><img src="Assets/Images/dev-widget.gif">

### Built With

Expand Down
63 changes: 63 additions & 0 deletions Resource1.Designer.cs

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

101 changes: 101 additions & 0 deletions Resource1.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->

<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
8 changes: 4 additions & 4 deletions WidgetsDotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>97D03B0CFD9E4F840E5D6F87BF2984402511013A</ManifestCertificateThumbprint>
<ManifestCertificateThumbprint>23D1128B44E5589E77D6DF9D709E9CC5BEED8767</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>WidgetsDotNet_TemporaryKey.pfx</ManifestKeyFile>
<ManifestKeyFile>WidgetsDotNet_1_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>WidgetsDotNet_TemporaryKey.pfx</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>WidgetsDotNet_1_TemporaryKey.pfx</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
Expand Down Expand Up @@ -119,7 +119,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="WidgetsDotNet_TemporaryKey.pfx" />
<None Include="WidgetsDotNet_1_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\favicon.ico">
Expand Down

0 comments on commit e1565c1

Please sign in to comment.