Skip to content

Commit

Permalink
Merge pull request #805 from dremin/overlay-icons
Browse files Browse the repository at this point in the history
Add support for showing taskbar icon badges
  • Loading branch information
dremin authored Apr 22, 2024
2 parents 145b988 + fcf4ceb commit e77fb64
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 0 deletions.
5 changes: 5 additions & 0 deletions RetroBar/Controls/TaskButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Loaded="TaskButton_OnLoaded"
Unloaded="TaskButton_OnUnloaded">
<UserControl.Resources>
<converters:BoolToVisibilityConverter x:Key="boolToVisibilityConverter" />
<converters:ToolTipHorizontalOffsetConverter x:Key="toolTipHorizontalOffsetConverter" />
<converters:ToolTipVerticalOffsetConverter x:Key="toolTipVerticalOffsetConverter" />
<converters:ToolTipPlacementConverter x:Key="toolTipPlacementConverter" />
Expand All @@ -28,6 +29,10 @@
<Image Source="{Binding Path=Icon, Mode=OneWay}"
Grid.Column="0"
Style="{DynamicResource TaskIcon}" />
<Image Source="{Binding Path=OverlayIcon, Mode=OneWay}"
Grid.Column="0"
Style="{DynamicResource TaskOverlayIcon}"
Visibility="{Binding Source={x:Static utilities:Settings.Instance}, Path=ShowTaskBadges, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource boolToVisibilityConverter}}" />
<TextBlock Grid.Column="1"
Style="{DynamicResource TaskLabel}">
<TextBlock.Text>
Expand Down
1 change: 1 addition & 0 deletions RetroBar/Languages/English.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<s:String x:Key="show_quick_launch">Show _Quick Launch</s:String>
<s:String x:Key="select_location">_Select location...</s:String>
<s:String x:Key="quick_launch_folder">Quick Launch - Choose a folder</s:String>
<s:String x:Key="show_badges">Show _badges</s:String>
<s:String x:Key="show_window_previews">Show _window previews (thumbnails)</s:String>
<s:String x:Key="use_software_rendering">_Use software rendering</s:String>
<s:String x:Key="middle_mouse_to_close">_Middle-click to close taskbar items</s:String>
Expand Down
4 changes: 4 additions & 0 deletions RetroBar/PropertiesWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@
<CheckBox IsChecked="{Binding Source={x:Static Settings:Settings.Instance}, Path=AutoHide, UpdateSourceTrigger=PropertyChanged}">
<Label Content="{DynamicResource enable_auto_hide}" />
</CheckBox>
<CheckBox x:Name="cbShowBadges"
IsChecked="{Binding Source={x:Static Settings:Settings.Instance}, Path=ShowTaskBadges, UpdateSourceTrigger=PropertyChanged}">
<Label Content="{DynamicResource show_badges}" />
</CheckBox>
<DockPanel>
<CheckBox x:Name="cbShowQuickLaunch"
IsChecked="{Binding Source={x:Static Settings:Settings.Instance}, Path=ShowQuickLaunch, UpdateSourceTrigger=PropertyChanged}">
Expand Down
15 changes: 15 additions & 0 deletions RetroBar/Themes/System.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,21 @@
Value="0,0,3,0" />
</Style>

<Style TargetType="Image"
x:Key="TaskOverlayIcon"
BasedOn="{StaticResource DefaultDirection}">
<Setter Property="Width"
Value="11" />
<Setter Property="Height"
Value="11" />
<Setter Property="HorizontalAlignment"
Value="Right" />
<Setter Property="VerticalAlignment"
Value="Bottom" />
<Setter Property="Margin"
Value="0,0,2,-1" />
</Style>

<Style TargetType="Image"
x:Key="StartIcon"
BasedOn="{StaticResource TaskIcon}">
Expand Down
7 changes: 7 additions & 0 deletions RetroBar/Themes/Windows Longhorn Aero.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,13 @@
Value="0,0,2,1" />
</Style>

<Style TargetType="Image"
x:Key="TaskOverlayIcon"
BasedOn="{StaticResource TaskOverlayIcon}">
<Setter Property="Margin"
Value="0,0,1,0" />
</Style>

<Style TargetType="TextBlock"
x:Key="TaskLabel"
BasedOn="{StaticResource TaskLabel}">
Expand Down
7 changes: 7 additions & 0 deletions RetroBar/Themes/Windows Vista Aero.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,13 @@
Value="0,0,4,0" />
</Style>

<Style TargetType="Image"
x:Key="TaskOverlayIcon"
BasedOn="{StaticResource TaskOverlayIcon}">
<Setter Property="Margin"
Value="0,0,3,-1" />
</Style>

<Style TargetType="TextBlock"
x:Key="TaskLabel"
BasedOn="{StaticResource TaskLabel}">
Expand Down
7 changes: 7 additions & 0 deletions RetroBar/Themes/Windows XP Blue.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1553,6 +1553,13 @@
Value="0,0,4,0" />
</Style>

<Style TargetType="Image"
x:Key="TaskOverlayIcon"
BasedOn="{StaticResource TaskOverlayIcon}">
<Setter Property="Margin"
Value="0,0,3,-1" />
</Style>

<Style TargetType="Image"
x:Key="StartIcon"
BasedOn="{StaticResource StartIcon}">
Expand Down
17 changes: 17 additions & 0 deletions RetroBar/Utilities/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,23 @@ public InvertIconsOption InvertIconsMode
}
}
}

private bool _showTaskBadges = true;
public bool ShowTaskBadges
{
get
{
return _showTaskBadges;
}
set
{
if (_showTaskBadges != value)
{
_showTaskBadges = value;
OnPropertyChanged();
}
}
}
#endregion

#region Enums
Expand Down

0 comments on commit e77fb64

Please sign in to comment.