-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/0.62.1_updates'
- Loading branch information
Showing
132 changed files
with
900 additions
and
1,783 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
PowerToysPlugin/Commands/FancyZones/FancyZonesNextWindowCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using Loupedeck.PowerToysPlugin.Helpers; | ||
using Loupedeck.PowerToysPlugin.Services; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Commands.FancyZones | ||
{ | ||
class FancyZonesNextWindowCommand : PluginDynamicCommand | ||
{ | ||
private PowerToysPlugin _plugin; | ||
private FancyZonesService _service; | ||
|
||
public FancyZonesNextWindowCommand() | ||
: base("Next Window", | ||
"Presses the assigned keyboard shortcuts to next window.", | ||
"Fancy Zones") | ||
{ | ||
// | ||
} | ||
|
||
protected override bool OnLoad() | ||
{ | ||
_plugin = base.Plugin as PowerToysPlugin; | ||
if (_plugin is null) | ||
return false; | ||
|
||
_service = _plugin.FancyZonesService; | ||
if (_service is null) | ||
return false; | ||
|
||
_service.IsRunningUpdated += ServiceOnIsRunningUpdated; | ||
|
||
return true; | ||
} | ||
|
||
private void ServiceOnIsRunningUpdated(object sender, bool e) | ||
{ | ||
base.ActionImageChanged(); | ||
} | ||
|
||
protected override void RunCommand(string actionParameter) | ||
{ | ||
_service.NextWindow(); | ||
} | ||
|
||
protected override BitmapImage GetCommandImage(string actionParameter, PluginImageSize imageSize) | ||
{ | ||
using (var bitmapBuilder = new BitmapBuilder(imageSize)) | ||
{ | ||
bitmapBuilder.Clear(new BitmapColor(0x00, 0x19, 0x7C)); | ||
|
||
var path = "Loupedeck.PowerToysPlugin.Resources.Modules.FancyZones.next-80.png"; | ||
|
||
var background = ResourceHelper.GetBackgroundImage(path); | ||
bitmapBuilder.SetBackgroundImage(background); | ||
|
||
bitmapBuilder.Translate(0, 20); | ||
var text = GetCommandDisplayName(actionParameter, imageSize); | ||
bitmapBuilder.DrawText(text, BitmapColor.White, 10); | ||
|
||
return bitmapBuilder.ToImage(); | ||
} | ||
} | ||
|
||
protected override string GetCommandDisplayName(string actionParameter, PluginImageSize imageSize) | ||
{ | ||
return "Next Window"; | ||
} | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
PowerToysPlugin/Commands/FancyZones/FancyZonesPrevWindowCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using Loupedeck.PowerToysPlugin.Helpers; | ||
using Loupedeck.PowerToysPlugin.Services; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Commands.FancyZones | ||
{ | ||
class FancyZonesPrevWindowCommand : PluginDynamicCommand | ||
{ | ||
private PowerToysPlugin _plugin; | ||
private FancyZonesService _service; | ||
|
||
public FancyZonesPrevWindowCommand() | ||
: base("Prev Window", | ||
"Presses the assigned keyboard shortcuts to prev window.", | ||
"Fancy Zones") | ||
{ | ||
// | ||
} | ||
|
||
protected override bool OnLoad() | ||
{ | ||
_plugin = base.Plugin as PowerToysPlugin; | ||
if (_plugin is null) | ||
return false; | ||
|
||
_service = _plugin.FancyZonesService; | ||
if (_service is null) | ||
return false; | ||
|
||
_service.IsRunningUpdated += ServiceOnIsRunningUpdated; | ||
|
||
return true; | ||
} | ||
|
||
private void ServiceOnIsRunningUpdated(object sender, bool e) | ||
{ | ||
base.ActionImageChanged(); | ||
} | ||
|
||
protected override void RunCommand(string actionParameter) | ||
{ | ||
_service.PrevWindow(); | ||
} | ||
|
||
protected override BitmapImage GetCommandImage(string actionParameter, PluginImageSize imageSize) | ||
{ | ||
using (var bitmapBuilder = new BitmapBuilder(imageSize)) | ||
{ | ||
bitmapBuilder.Clear(new BitmapColor(0x00, 0x19, 0x7C)); | ||
|
||
var path = "Loupedeck.PowerToysPlugin.Resources.Modules.FancyZones.prev-80.png"; | ||
|
||
var background = ResourceHelper.GetBackgroundImage(path); | ||
bitmapBuilder.SetBackgroundImage(background); | ||
|
||
bitmapBuilder.Translate(0, 20); | ||
var text = GetCommandDisplayName(actionParameter, imageSize); | ||
bitmapBuilder.DrawText(text, BitmapColor.White, 10); | ||
|
||
return bitmapBuilder.ToImage(); | ||
} | ||
} | ||
|
||
protected override string GetCommandDisplayName(string actionParameter, PluginImageSize imageSize) | ||
{ | ||
return "Prev Window"; | ||
} | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
PowerToysPlugin/Commands/MeasureTool/MeasureToolCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using Loupedeck.PowerToysPlugin.Helpers; | ||
using Loupedeck.PowerToysPlugin.Services; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Commands.MeasureTool | ||
{ | ||
class MeasureToolCommand : PluginDynamicCommand | ||
{ | ||
private PowerToysPlugin _plugin; | ||
private MeasureToolService _service; | ||
|
||
public MeasureToolCommand() | ||
: base("Enable Screen Ruler", | ||
"Enable Screen Ruler", | ||
"MeasureTool") | ||
{ | ||
// | ||
} | ||
|
||
protected override bool OnLoad() | ||
{ | ||
_plugin = base.Plugin as PowerToysPlugin; | ||
if (_plugin is null) | ||
return false; | ||
|
||
_service = _plugin.MeasureToolService; | ||
if (_service is null) | ||
return false; | ||
|
||
return true; | ||
} | ||
|
||
protected override void RunCommand(string actionParameter) | ||
{ | ||
_service.Activate(); | ||
} | ||
|
||
protected override BitmapImage GetCommandImage(string actionParameter, PluginImageSize imageSize) | ||
{ | ||
using (var bitmapBuilder = new BitmapBuilder(imageSize)) | ||
{ | ||
bitmapBuilder.Clear(new BitmapColor(0x00, 0x19, 0x7C)); | ||
|
||
var path = "Loupedeck.PowerToysPlugin.Resources.Modules.MeasureTool.icon-80.png"; | ||
|
||
var background = ResourceHelper.GetBackgroundImage(path); | ||
bitmapBuilder.SetBackgroundImage(background); | ||
|
||
bitmapBuilder.Translate(0, 20); | ||
var text = GetCommandDisplayName(actionParameter, imageSize); | ||
bitmapBuilder.DrawText(text, BitmapColor.White, 10); | ||
|
||
return bitmapBuilder.ToImage(); | ||
} | ||
} | ||
|
||
protected override string GetCommandDisplayName(string actionParameter, PluginImageSize imageSize) | ||
{ | ||
return "Screen Ruler"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.