Skip to content

Commit

Permalink
v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adamecr committed Dec 21, 2022
1 parent 3bee6ee commit 1a2a9a2
Show file tree
Hide file tree
Showing 114 changed files with 8,588 additions and 382 deletions.
25 changes: 25 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [2.1.0] - 2022-12-21 ##
### Added ###
- **Applications pinned to Windows Start are available in menu popup**
- **Audio device info and settings**
- See the **mute and volume state** of audio capture and render devices
- See whether the **audio device is being used** - for example whether any application captures the audio from mike
- Toggle mute and adjust volume of audio devices
- Change the default audio capture and render devices

- **Clock panel**
- See the current date and time in customizable format
- See the **date and time in time zones** defined in settings

- Common shortcuts in application list panel and pinned apps panel
- Documents, Pictures, Downloads, Run, Console/Terminal, Devices, Windows Settings
- Close window button in thumbnail
- Search ranking of applications
- Application settings `ShowAudioControls`, `AudioControlsPopupWidth`, `ShowClock`, `ClockWidth`, `ClockPopupWidth`, `RefreshClockIntervalMs`, `ClockDateFormat`, `ClockTimeFormat`, `ClockTimeZones`, `ClockTimeZoneDateFormat`, `ClockTimeZoneTimeFormat`, `ClockLongFormat`
- Feature flags `EnableRunInfoFromWindowsPrefetch`, `EnableStartMenuPins`, `EnableContextMenuOnThumbnail`
- Translations `AudioIsDefault`, `AudioSetDefault`, `AudioIsCommDefault`, `MenuPopupPins`

### Fixed ###
- [UI not responsive when some app does not respond to SendMessage](https://github.com/adamecr/AppSwitcherBar/issues/6) - sending the windows message with timeout

## [2.0.1] - 2022-11-28 ##
### Fixed ###
- [Settings reset on start in version 2.0](https://github.com/adamecr/AppSwitcherBar/issues/5) - the desing time settings (used by WPF designer) are not saved at all now
Expand Down Expand Up @@ -97,6 +121,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added ###
- Initial application release

[2.1.0]: https://github.com/adamecr/AppSwitcherBar/compare/v2.0.1...v2.1.0
[2.0.1]: https://github.com/adamecr/AppSwitcherBar/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/adamecr/AppSwitcherBar/compare/v1.3.1...v2.0.0
[1.3.1]: https://github.com/adamecr/AppSwitcherBar/compare/v1.3.0...v1.3.1
Expand Down
Binary file added doc/img/AdditionalControls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/img/AppList.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/img/AppSwitcherBar.png
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 doc/img/AudioCapturePopup.png
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 doc/img/AudioControl.png
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 doc/img/AudioInUse.png
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 doc/img/AudioPopup.png
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 doc/img/AudioRenderPopup.png
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 doc/img/ClockControl.png
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 doc/img/ClockPopup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/img/Menu.png
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 doc/img/StartPins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/img/Thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions net.adamec.ui.AppSwitcherBar/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
<system:String x:Key="StrMenuPopupSettings">Settings</system:String>
<system:String x:Key="StrMenuPopupColors">Colors</system:String>
<system:String x:Key="StrMenuPopupApps">Applications</system:String>
<system:String x:Key="StrMenuPopupPins">Pinned apps</system:String>
<system:String x:Key="StrMenuPopupToggleDesktop">Toggle desktop</system:String>
<system:String x:Key="StrMenuPopupToggleTheme">Toggle theme</system:String>
<system:String x:Key="StrMenuPopupExit">Exit app</system:String>
<system:String x:Key="StrMenuPopupSettingsRefresh">Refresh</system:String>
<system:String x:Key="StrMenuPopupSettingsRunOnStartup">Run on Win start</system:String>
<system:String x:Key="StrMenuPopupSettingsAutoSize">Auto size</system:String>
<system:String x:Key="StrAudioIsDefault">Default device</system:String>
<system:String x:Key="StrAudioSetDefault">Set as default device</system:String>
<system:String x:Key="StrAudioIsCommDefault">Default comm device</system:String>
</ResourceDictionary>

</ResourceDictionary.MergedDictionaries>
Expand Down
28 changes: 23 additions & 5 deletions net.adamec.ui.AppSwitcherBar/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
using Microsoft.Extensions.Logging;
using net.adamec.ui.AppSwitcherBar.Config;
using net.adamec.ui.AppSwitcherBar.ViewModel;
using net.adamec.ui.AppSwitcherBar.Win32.Services.Audio;
using net.adamec.ui.AppSwitcherBar.Win32.Services.JumpLists;
using net.adamec.ui.AppSwitcherBar.Win32.Services.Pins;
using net.adamec.ui.AppSwitcherBar.Win32.Services.Startup;
using Wpf.Ui.Mvvm.Contracts;
using Wpf.Ui.Mvvm.Services;
Expand Down Expand Up @@ -46,7 +48,7 @@ public partial class App : Application
protected override async void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);

host = Host
.CreateDefaultBuilder(e.Args)
.ConfigureHostConfiguration(config =>
Expand Down Expand Up @@ -142,16 +144,27 @@ private void ConfigureServices(IConfiguration configuration, IServiceCollection
//Register configuration objects
services.Configure<AppSettings>(configuration.GetSection(nameof(AppSettings)));
services.Configure<Language>(configuration.GetSection(nameof(Language)));

//Register services
services.AddSingleton<IThemeService, ThemeService>();
services.AddSingleton<ILanguageService, LanguageService>();
services.AddSingleton<IBackgroundDataService, BackgroundDataService>();
services.AddSingleton<IPinsService, PinsService>();

if (bool.TryParse(configuration[$"{nameof(AppSettings)}:{nameof(AppSettings.ShowAudioControls)}"], out var showAudioControls) && showAudioControls)
{
services.AddSingleton<IAudioService, AudioService>();
}
else
{
services.AddSingleton<IAudioService, DummyAudioService>();
}


if (bool.TryParse(configuration[$"{nameof(AppSettings)}:{nameof(AppSettings.FeatureFlags)}:JumpList"], out var hasJumpList) && hasJumpList)
if (bool.TryParse(configuration[$"{nameof(AppSettings)}:{nameof(AppSettings.FeatureFlags)}:{AppSettings.FF_JumpList}"], out var hasJumpList) && hasJumpList)
{
var jumpListSvcVersion =
int.TryParse(configuration[$"{nameof(AppSettings)}:{nameof(AppSettings.FeatureFlags)}:JumpListSvcVersion"], out var parsedVersion)
int.TryParse(configuration[$"{nameof(AppSettings)}:{nameof(AppSettings.FeatureFlags)}:{AppSettings.FF_JumpListSvcVersion}"], out var parsedVersion)
? parsedVersion
: 2;

Expand All @@ -173,7 +186,7 @@ private void ConfigureServices(IConfiguration configuration, IServiceCollection
services.AddSingleton<IJumpListService, DummyJumpListService>();
}

if (bool.TryParse(configuration[$"{nameof(AppSettings)}:{nameof(AppSettings.FeatureFlags)}:RunOnWindowsStartup"], out var hasWinStartup) && hasWinStartup)
if (bool.TryParse(configuration[$"{nameof(AppSettings)}:{nameof(AppSettings.FeatureFlags)}:{AppSettings.FF_RunOnWindowsStartup}"], out var hasWinStartup) && hasWinStartup)
{
services.AddSingleton<IStartupService, StartupService>();
}
Expand All @@ -183,8 +196,13 @@ private void ConfigureServices(IConfiguration configuration, IServiceCollection
}

// Register app ViewModels
//the view models are in general used "on one place" and (can) have life time same as life time of application,
//so I better have them as singletons and not transient
//the singletons are also easier to dispose if needed
services.AddSingleton<MainViewModel>();
services.AddSingleton<MenuPopupViewModel>();
services.AddSingleton<AudioViewModel>();
services.AddSingleton<ClockViewModel>();

// Register app Windows
services.AddSingleton<MainWindow>();
Expand Down
122 changes: 120 additions & 2 deletions net.adamec.ui.AppSwitcherBar/Config/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.IO;
using System.Windows;
using net.adamec.ui.AppSwitcherBar.AppBar;
using net.adamec.ui.AppSwitcherBar.ViewModel;

// ReSharper disable IdentifierTypo
// ReSharper disable CommentTypo
Expand All @@ -16,12 +15,71 @@ namespace net.adamec.ui.AppSwitcherBar.Config
/// </summary>
public class AppSettings : IAppSettings
{
/// <summary>
/// Name of the Feature Flag for windows anonymization
/// </summary>
// ReSharper disable once InconsistentNaming
public const string FF_AnonymizeWindows = "AnonymizeWindows";

/// <summary>
/// Name of the Feature Flag for using the undocumented application resolver to get the app it
/// </summary>
// ReSharper disable once InconsistentNaming
public const string FF_UseApplicationResolver = "UseApplicationResolver";

/// <summary>
/// Name of the Feature Flag for keeping the menu popup open even when another app is active
/// </summary>
// ReSharper disable once InconsistentNaming
public const string FF_KeepMenuPopupOpen = "KeepMenuPopupOpen";

/// <summary>
/// Name of the Feature Flag for enabling the color panel in menu popup
/// </summary>
// ReSharper disable once InconsistentNaming
public const string FF_EnableColorsInMenuPopup = "EnableColorsInMenuPopup";

/// <summary>
/// Name of the Feature Flag for enabling the jumplist support
/// </summary>
// ReSharper disable once InconsistentNaming
public const string FF_JumpList = "JumpList";

/// <summary>
/// Name of the Feature Flag for setting the jumplist service version
/// </summary>
// ReSharper disable once InconsistentNaming
public const string FF_JumpListSvcVersion = "JumpListSvcVersion";

/// <summary>
/// Name of the Feature Flag for enabling the run on windows startup functionality
/// </summary>
// ReSharper disable once InconsistentNaming
public const string FF_RunOnWindowsStartup = "RunOnWindowsStartup";

/// <summary>
/// Name of the Feature Flag for enabling the run on windows startup functionality
/// </summary>
// ReSharper disable once InconsistentNaming
public const string FF_EnableRunInfoFromWindowsPrefetch = "EnableRunInfoFromWindowsPrefetch";

/// <summary>
/// Name of the Feature Flag for enabling the color panel in menu popup
/// </summary>
// ReSharper disable once InconsistentNaming
public const string FF_EnableStartMenuPins = "EnableStartMenuPins";
/// <summary>
/// Name of the Feature Flag for enabling the window's context menu on the thumbnail
/// </summary>
// ReSharper disable once InconsistentNaming
public const string FF_EnableContextMenuOnThumbnail = "EnableContextMenuOnThumbnail";

/// <summary>
/// Design time app settings
/// </summary>
public static AppSettings DesignTimeAppSettings { get; } = new (settings => {
settings.AppBarAutoSize = false;
settings.FeatureFlags![MenuPopupViewModel.FF_EnableColorsInMenuPopup] = true.ToString();
settings.FeatureFlags![FF_EnableColorsInMenuPopup] = true.ToString();
}, true);

/// <summary>
Expand Down Expand Up @@ -244,6 +302,66 @@ public class AppSettings : IAppSettings
/// </summary>
public static string DefaultLanguage = CultureInfo.CurrentCulture.Name;

/// <summary>
/// Flag whether to show the audio device info and settings in the app bar (default is true)
/// </summary>
public bool ShowAudioControls { get; set; } = true;

/// <summary>
/// Width of audio controls popup (default is 300)
/// </summary>
public int AudioControlsPopupWidth { get; set; } = 300;

/// <summary>
/// Flag whether to show the clock in the app bar (default is true)
/// </summary>
public bool ShowClock { get; set; } = true;

/// <summary>
/// Width of clock control in the app bar (default is 80)
/// </summary>
public int ClockWidth { get; set; } = 80;

/// <summary>
/// Width of clock popup (default is 200)
/// </summary>
public int ClockPopupWidth { get; set; } = 200;

/// <summary>
/// Refresh interval (in milliseconds) to update clock (default is 250)
/// </summary>
public int RefreshClockIntervalMs { get; set; } = 250;

/// <summary>
/// Clock control date format. Keep empty to hide the date (default is dd.MM.yyyy)
/// </summary>
public string? ClockDateFormat { get; set; } = "d.M.yyyy";

/// <summary>
/// Clock control time format. Keep empty to hide the time (default is HH:mm)
/// </summary>
public string? ClockTimeFormat { get; set; } = "H:mm";

/// <summary>
/// Clock control long date and time format.
/// </summary>
public string? ClockLongFormat { get; } = "dddd d. MMMM yyyy";

/// <summary>
/// Time zones collection name-TZ ID (default is empty)
/// </summary>
public Dictionary<string, string>? ClockTimeZones { get; } = new();

/// <summary>
/// Clock control date format to be used for time zone (default is ddd d.M.)
/// </summary>
public string? ClockTimeZoneDateFormat { get; } = "ddd d.M.";

/// <summary>
/// Clock control time format to be used for time zone (default is H:mm)
/// </summary>
public string? ClockTimeZoneTimeFormat { get; } = "H:mm";

//---------------------------------------------------------------------

/// <summary>
Expand Down
65 changes: 63 additions & 2 deletions net.adamec.ui.AppSwitcherBar/Config/IAppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ public interface IAppSettings
/// <summary>
/// Flag whether the application will allow user to change the order of the buttons representing the (task bar) windows
/// </summary>
bool AllowAppBarButtonReorder { get; }
bool AllowAppBarButtonReorder { get; }

/// <summary>
/// Flag whether to show buttons ("pins") for applications pinned to the task bar when they have no window open
/// </summary>
Expand Down Expand Up @@ -195,6 +195,67 @@ public interface IAppSettings
/// </summary>
StartupThemeEnum StartupTheme { get; }

/// <summary>
/// Flag whether to show the audio device info and settings in the app bar
/// </summary>
bool ShowAudioControls { get; }

/// <summary>
/// Width of audio controls popup
/// </summary>
int AudioControlsPopupWidth { get; }

/// <summary>
/// Flag whether to show the clock in the app bar
/// </summary>
bool ShowClock { get; }

/// <summary>
/// Width of clock control in the app bar
/// </summary>
int ClockWidth { get; }

/// <summary>
/// Width of clock popup
/// </summary>
int ClockPopupWidth { get; }

/// <summary>
/// Refresh interval (in milliseconds) to update clock
/// </summary>
int RefreshClockIntervalMs { get; }

/// <summary>
/// Clock control date format. Keep empty to hide the date
/// </summary>
string? ClockDateFormat { get; }

/// <summary>
/// Clock control time format. Keep empty to hide the time
/// </summary>
string? ClockTimeFormat { get; }

/// <summary>
/// Clock control long date and time format.
/// </summary>
string? ClockLongFormat { get; }

/// <summary>
/// Time zones collection
/// </summary>
Dictionary<string, string>? ClockTimeZones { get; }

/// <summary>
/// Clock control date format to be used for time zone
/// </summary>
string? ClockTimeZoneDateFormat { get; }

/// <summary>
/// Clock control time format to be used for time zone
/// </summary>
string? ClockTimeZoneTimeFormat { get; }


//---------------------------------------------------------------------

/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions net.adamec.ui.AppSwitcherBar/Config/LanguageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ private void InitDefaultTranslations()
SetTranslation(TranslationKeys.MenuPopupSettings, "Settings");
SetTranslation(TranslationKeys.MenuPopupColors, "Colors");
SetTranslation(TranslationKeys.MenuPopupApps, "Applications");
SetTranslation(TranslationKeys.MenuPopupPins, "Pinned apps");
SetTranslation(TranslationKeys.MenuPopupToggleDesktop, "Toggle desktop");
SetTranslation(TranslationKeys.MenuPopupToggleTheme, "Toggle theme");
SetTranslation(TranslationKeys.MenuPopupExit, "Exit app");
Expand All @@ -73,6 +74,10 @@ private void InitDefaultTranslations()
SetTranslation(TranslationKeys.JumpListCategoryPinned, "Pinned");
SetTranslation(TranslationKeys.JumpListCategoryRecent, "Recent");
SetTranslation(TranslationKeys.JumpListCategoryFrequent, "Frequent");

SetTranslation(TranslationKeys.AudioIsDefault, "Default device");
SetTranslation(TranslationKeys.AudioSetDefault, "Set as default device");
SetTranslation(TranslationKeys.AudioIsCommDefault, "Default comm device");
}

/// <summary>
Expand Down
7 changes: 6 additions & 1 deletion net.adamec.ui.AppSwitcherBar/Config/TranslationKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public enum TranslationKeys
MenuPopupSettings,
MenuPopupColors,
MenuPopupApps,
MenuPopupPins,
MenuPopupToggleDesktop,
MenuPopupToggleTheme,
MenuPopupExit,
Expand All @@ -32,5 +33,9 @@ public enum TranslationKeys
JumpListCategoryTasks,
JumpListCategoryPinned,
JumpListCategoryRecent,
JumpListCategoryFrequent
JumpListCategoryFrequent,

AudioIsDefault,
AudioSetDefault,
AudioIsCommDefault
}
Loading

0 comments on commit 1a2a9a2

Please sign in to comment.