Skip to content

Commit 8ca6a0a

Browse files
committed
fix(sidebar): use StackPanel instead of Toolbar, revert sidebar left toggle
1 parent 1db5a76 commit 8ca6a0a

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

LLPlayer/ViewModels/SubtitlesSidebarVM.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ public bool IsPrimary
7373
FL.Action.CmdOpenWindowSubsExporter.Execute();
7474
});
7575

76+
public DelegateCommand CmdSwapSidebarPosition => field ??= new(() =>
77+
{
78+
FL.Config.SidebarLeft = !FL.Config.SidebarLeft;
79+
});
80+
7681
public DelegateCommand<int?> CmdSubPlay => field ??= new((index) =>
7782
{
7883
if (!index.HasValue)

LLPlayer/Views/SubtitlesSidebar.xaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@
7373
<RowDefinition Height="Auto" />
7474
</Grid.RowDefinitions>
7575

76-
<ToolBar
76+
<StackPanel
7777
Grid.Row="0"
78-
Margin="5">
78+
Orientation="Horizontal"
79+
Margin="7">
7980

8081
<!-- Primary Secondary Toggle -->
8182
<ToggleButton
@@ -106,16 +107,20 @@
106107
Kind="FormatText" />
107108
</materialDesign:PopupBox.ToggleContent>
108109

110+
<!--TODO: L: In Toolbar, there is a bug that the color of the button turns black when it overflows.
111+
I don't know how to solve this problem, so I use StackPanel.-->
109112
<StackPanel Orientation="Horizontal">
110113
<Button Style="{StaticResource IconButton}"
111114
Command="{Binding CmdSubFontSizeChange}"
112115
CommandParameter="-1"
116+
Background="{DynamicResource MaterialDesignToolBarBackground}"
113117
ToolTip="Font size decrease"
114118
Content="{materialDesign:PackIcon Kind=FormatFontSizeDecrease}" />
115119

116120
<Button Style="{StaticResource IconButton}"
117121
Command="{Binding CmdSubFontSizeChange}"
118122
CommandParameter="1"
123+
Background="{DynamicResource MaterialDesignToolBarBackground}"
119124
ToolTip="Font size increase"
120125
Content="{materialDesign:PackIcon Kind=FormatFontSizeIncrease}" />
121126
</StackPanel>
@@ -150,7 +155,13 @@
150155
Command="{Binding CmdShowExportSubsDialog}"
151156
ToolTip="Export subtitles as srt"
152157
Content="{materialDesign:PackIcon Kind=FileExportOutline}" />
153-
</ToolBar>
158+
159+
<!-- Sidebar Left Toggle -->
160+
<Button Style="{StaticResource IconButton}"
161+
Command="{Binding CmdSwapSidebarPosition}"
162+
ToolTip="Swap sidebar position"
163+
Content="{materialDesign:PackIcon Kind=SwapHorizontal}" />
164+
</StackPanel>
154165

155166
<controls:NonTopmostPopup
156167
Grid.Row="0"

0 commit comments

Comments
 (0)