mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-07-02 08:28:55 +02:00
Compare commits
8 Commits
powerscrip
...
microsoft-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8ced06f9d | ||
|
|
c777fcc1e4 | ||
|
|
28e078897a | ||
|
|
64f1243bdf | ||
|
|
e1074bc835 | ||
|
|
2390aacbfc | ||
|
|
02af47f942 | ||
|
|
826659f0a7 |
7
.github/workflows/auto-labeler.yml
vendored
7
.github/workflows/auto-labeler.yml
vendored
@@ -73,6 +73,13 @@ jobs:
|
||||
|
||||
const itemType = issue.pull_request ? 'Pull request' : 'Issue';
|
||||
|
||||
// Skip pull requests that already have labels applied.
|
||||
if (issue.pull_request && issue.labels && issue.labels.length > 0) {
|
||||
const existingLabels = issue.labels.map(l => l.name).join(', ');
|
||||
console.log(`${itemType} #${issueNumber} already has labels (${existingLabels}); skipping.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const title = issue.title ?? '';
|
||||
const body = issue.body ?? '';
|
||||
|
||||
|
||||
64
NOTICE.md
64
NOTICE.md
@@ -12,6 +12,7 @@ This software incorporates material from third parties.
|
||||
- Peek
|
||||
- PowerDisplay
|
||||
- Registry Preview
|
||||
- ZoomIt
|
||||
|
||||
## Utility: Color Picker
|
||||
|
||||
@@ -1549,6 +1550,69 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
## Utility: ZoomIt
|
||||
|
||||
### libwebp
|
||||
|
||||
ZoomIt uses libwebp to encode screenshots in the WebP image format.
|
||||
|
||||
**Source**: <https://github.com/webmproject/libwebp>
|
||||
|
||||
BSD-3-Clause License
|
||||
|
||||
Copyright (c) 2010, Google Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* Neither the name of Google nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Additional IP Rights Grant (Patents)
|
||||
|
||||
"These implementations" means the copyrightable works that implement the WebM
|
||||
codecs distributed by Google as part of the WebM Project.
|
||||
|
||||
Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge,
|
||||
royalty-free, irrevocable (except as stated in this section) patent license to
|
||||
make, have made, use, offer to sell, sell, import, transfer, and otherwise
|
||||
run, modify and propagate the contents of these implementations of WebM, where
|
||||
such license applies only to those patent claims, both currently owned by
|
||||
Google and acquired in the future, licensable by Google that are necessarily
|
||||
infringed by these implementations of WebM. This grant does not include claims
|
||||
that would be infringed only as a consequence of further modification of these
|
||||
implementations. If you or your agent or exclusive licensee institute or order
|
||||
or agree to the institution of patent litigation or any other patent
|
||||
enforcement activity against any entity (including a cross-claim or
|
||||
counterclaim in a lawsuit) alleging that any of these implementations of WebM
|
||||
or any code incorporated within any of these implementations of WebM
|
||||
constitute direct or contributory patent infringement, or inducement of
|
||||
patent infringement, then any patent rights granted to you under this License
|
||||
for these implementations of WebM shall terminate as of the date such
|
||||
litigation is filed.
|
||||
|
||||
## NuGet Packages used by PowerToys
|
||||
|
||||
- AdaptiveCards.ObjectModel.WinUI3
|
||||
|
||||
@@ -105,6 +105,13 @@ public sealed partial class ExtensionGalleryItemViewModel : ObservableObject
|
||||
|
||||
public string? Homepage => _entry.Homepage;
|
||||
|
||||
// Validated, browser-openable homepage uri. Null when the entry has no
|
||||
// homepage or it is not a web uri. NavigateUri bindings must use this
|
||||
// (a Uri) rather than the raw Homepage string: x:Bind evaluates bindings
|
||||
// regardless of element visibility, and converting a null/invalid string
|
||||
// to Uri throws and crashes the page.
|
||||
public Uri? HomepageUri => _homepageHttpUri;
|
||||
|
||||
public Uri IconUri { get; }
|
||||
|
||||
public ImageSource IconSource
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
Grid.Row="3"
|
||||
Padding="0"
|
||||
AutomationProperties.AutomationId="CmdPal_GalleryItemPage_ViewRepository"
|
||||
NavigateUri="{x:Bind ViewModel.Homepage, Mode=OneWay}"
|
||||
NavigateUri="{x:Bind ViewModel.HomepageUri, Mode=OneWay}"
|
||||
ToolTipService.ToolTip="{x:Bind ViewModel.Homepage, Mode=OneWay}"
|
||||
Visibility="{x:Bind help:BindTransformers.BoolToVisibility(ViewModel.HasHomepage), Mode=OneWay, FallbackValue=Collapsed}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
|
||||
@@ -160,20 +160,24 @@ public sealed partial class SettingsWindow : WindowEx,
|
||||
break;
|
||||
}
|
||||
|
||||
if (pageType is not null)
|
||||
if (pageType is null)
|
||||
{
|
||||
NavFrame.Navigate(pageType);
|
||||
return;
|
||||
}
|
||||
|
||||
// Now, make sure to actually select the correct menu item too
|
||||
foreach (var obj in NavView.MenuItems)
|
||||
if (NavFrame.Content?.GetType() == pageType)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
NavFrame.Navigate(pageType);
|
||||
|
||||
// Now, make sure to actually select the correct menu item too
|
||||
foreach (var obj in NavView.MenuItems)
|
||||
{
|
||||
if (obj is NavigationViewItem item && item.Tag is string s && s == page)
|
||||
{
|
||||
if (obj is NavigationViewItem item)
|
||||
{
|
||||
if (item.Tag is string s && s == page)
|
||||
{
|
||||
NavView.SelectedItem = item;
|
||||
}
|
||||
}
|
||||
NavView.SelectedItem = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,6 +119,7 @@ public class ExtensionGalleryItemViewModelTests
|
||||
var viewModel = CreateViewModel(entry);
|
||||
|
||||
Assert.IsFalse(viewModel.HasHomepage);
|
||||
Assert.IsNull(viewModel.HomepageUri);
|
||||
Assert.IsFalse(viewModel.HasAuthorUrl);
|
||||
Assert.IsFalse(viewModel.HasUrlSource);
|
||||
Assert.IsFalse(viewModel.HasActionableSourceDetails);
|
||||
@@ -131,6 +132,32 @@ public class ExtensionGalleryItemViewModelTests
|
||||
Assert.IsFalse(viewModel.OpenInstallUrlCommand.CanExecute(null));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Constructor_SetsHomepageUri_WhenHomepageIsWebUri()
|
||||
{
|
||||
var entry = CreateEntry(iconUrl: null);
|
||||
entry.Homepage = "https://example.com/extension";
|
||||
|
||||
var viewModel = CreateViewModel(entry);
|
||||
|
||||
Assert.IsTrue(viewModel.HasHomepage);
|
||||
Assert.AreEqual(new Uri("https://example.com/extension"), viewModel.HomepageUri);
|
||||
Assert.IsTrue(viewModel.OpenHomepageCommand.CanExecute(null));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Constructor_LeavesHomepageUriNull_WhenHomepageIsMissing()
|
||||
{
|
||||
var entry = CreateEntry(iconUrl: null);
|
||||
entry.Homepage = null;
|
||||
|
||||
var viewModel = CreateViewModel(entry);
|
||||
|
||||
Assert.IsFalse(viewModel.HasHomepage);
|
||||
Assert.IsNull(viewModel.HomepageUri);
|
||||
Assert.IsFalse(viewModel.OpenHomepageCommand.CanExecute(null));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Constructor_EnablesCopyCommand_WhenWinGetIdIsAvailable()
|
||||
{
|
||||
|
||||
@@ -134,6 +134,25 @@ internal sealed partial class PerformanceWidgetsPage : OnLoadStaticListPage, IDi
|
||||
MoreCommands = _networkPage.Commands,
|
||||
};
|
||||
|
||||
if (isBandPage)
|
||||
{
|
||||
_networkUpItem = new ListItem(_networkPage)
|
||||
{
|
||||
Title = $"{_networkUpSpeed}",
|
||||
Subtitle = Resources.GetResource("Network_Send_Subtitle"),
|
||||
Icon = Icons.NetworkUpIcon,
|
||||
MoreCommands = _networkPage.Commands,
|
||||
};
|
||||
|
||||
_networkDownItem = new ListItem(_networkPage)
|
||||
{
|
||||
Title = $"{_networkDownSpeed}",
|
||||
Subtitle = Resources.GetResource("Network_Receive_Subtitle"),
|
||||
Icon = Icons.NetworkDownIcon,
|
||||
MoreCommands = _networkPage.Commands,
|
||||
};
|
||||
}
|
||||
|
||||
_networkPage.Updated += (s, e) =>
|
||||
{
|
||||
_networkItem.Title = _networkPage.GetItemTitle(isBandPage);
|
||||
@@ -253,22 +272,6 @@ internal sealed partial class PerformanceWidgetsPage : OnLoadStaticListPage, IDi
|
||||
}
|
||||
else
|
||||
{
|
||||
_networkUpItem = new ListItem(_networkPage!)
|
||||
{
|
||||
Title = $"{_networkUpSpeed}",
|
||||
Subtitle = Resources.GetResource("Network_Send_Subtitle"),
|
||||
Icon = Icons.NetworkUpIcon,
|
||||
MoreCommands = _networkPage!.Commands,
|
||||
};
|
||||
|
||||
_networkDownItem = new ListItem(_networkPage!)
|
||||
{
|
||||
Title = $"{_networkDownSpeed}",
|
||||
Subtitle = Resources.GetResource("Network_Receive_Subtitle"),
|
||||
Icon = Icons.NetworkDownIcon,
|
||||
MoreCommands = _networkPage!.Commands,
|
||||
};
|
||||
|
||||
return _batteryItem is not null
|
||||
? new[] { _cpuItem!, _memoryItem!, _networkUpItem!, _networkDownItem!, _gpuItem!, _batteryItem! }
|
||||
: new[] { _cpuItem!, _memoryItem!, _networkUpItem!, _networkDownItem!, _gpuItem! };
|
||||
@@ -783,34 +786,34 @@ internal sealed partial class SystemNetworkUsageWidgetPage : WidgetPage, IDispos
|
||||
value /= 1024;
|
||||
if (value < 1024)
|
||||
{
|
||||
if (value < 100)
|
||||
if (MathF.Round(value, 1) < 10f)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0.0} Kbps", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0.0} Kbps", value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0} Kbps", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0} Kbps", value);
|
||||
}
|
||||
|
||||
// Kbits to Mbits
|
||||
value /= 1024;
|
||||
if (value < 1024)
|
||||
{
|
||||
if (value < 100)
|
||||
if (MathF.Round(value, 1) < 10f)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0.0} Mbps", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0.0} Mbps", value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0} Mbps", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0} Mbps", value);
|
||||
}
|
||||
|
||||
// Mbits to Gbits
|
||||
value /= 1024;
|
||||
if (value < 100)
|
||||
if (MathF.Round(value, 1) < 10f)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0.0} Gbps", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0.0} Gbps", value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0} Gbps", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0} Gbps", value);
|
||||
}
|
||||
|
||||
private static string FormatAsBytesPerSecString(float value)
|
||||
@@ -819,34 +822,34 @@ internal sealed partial class SystemNetworkUsageWidgetPage : WidgetPage, IDispos
|
||||
value /= 1024;
|
||||
if (value < 1024)
|
||||
{
|
||||
if (value < 100)
|
||||
if (MathF.Round(value, 1) < 10f)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0.0} KB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0.0} KB/s", value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0} KB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0} KB/s", value);
|
||||
}
|
||||
|
||||
// KB to MB
|
||||
value /= 1024;
|
||||
if (value < 1024)
|
||||
{
|
||||
if (value < 100)
|
||||
if (MathF.Round(value, 1) < 10f)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0.0} MB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0.0} MB/s", value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0} MB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0} MB/s", value);
|
||||
}
|
||||
|
||||
// MB to GB
|
||||
value /= 1024;
|
||||
if (value < 100)
|
||||
if (MathF.Round(value, 1) < 10f)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0.0} GB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0.0} GB/s", value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0} GB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0} GB/s", value);
|
||||
}
|
||||
|
||||
private static string FormatAsBinaryBytesPerSecString(float value)
|
||||
@@ -855,34 +858,34 @@ internal sealed partial class SystemNetworkUsageWidgetPage : WidgetPage, IDispos
|
||||
value /= 1024;
|
||||
if (value < 1024)
|
||||
{
|
||||
if (value < 100)
|
||||
if (MathF.Round(value, 1) < 10f)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0.0} KiB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0.0} KiB/s", value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0} KiB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0} KiB/s", value);
|
||||
}
|
||||
|
||||
// KiB to MiB
|
||||
value /= 1024;
|
||||
if (value < 1024)
|
||||
{
|
||||
if (value < 100)
|
||||
if (MathF.Round(value, 1) < 10f)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0.0} MiB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0.0} MiB/s", value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0} MiB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0} MiB/s", value);
|
||||
}
|
||||
|
||||
// MiB to GiB
|
||||
value /= 1024;
|
||||
if (value < 100)
|
||||
if (MathF.Round(value, 1) < 10f)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0.0} GiB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0.0} GiB/s", value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0:0} GiB/s", value);
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0,-4:0} GiB/s", value);
|
||||
}
|
||||
|
||||
internal override void PushActivate()
|
||||
|
||||
Reference in New Issue
Block a user