Skip to content

armgit / Filee

Public Imported from GitHub
0

Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.

Theme: the colour picker's flyout has no empty tab strip

KnifeLemon2314129ef358
diff --git a/src/Filee.App/App.axaml b/src/Filee.App/App.axaml
index 0491d1ac..f266848f 100644
--- a/src/Filee.App/App.axaml
+++ b/src/Filee.App/App.axaml
@@ -16,6 +16,9 @@
<ResourceInclude Source="avares://Filee/Styles/Icons.axaml" />
<ResourceInclude Source="avares://Filee/Styles/Brands.axaml" />
</ResourceDictionary.MergedDictionaries>
+ <!-- The Theme page's colour picker shows only the spectrum: no empty tab strip above it. Set here because its
+ flyout looks resources up outside the page. -->
+ <x:Double x:Key="ColorViewTabStripHeight">0</x:Double>
</ResourceDictionary>
</Application.Resources>
@@ -26,6 +29,13 @@
<Style Selector="ColorSpectrum">
<Setter Property="Focusable" Value="True" />
</Style>
+ <!-- The colour picker's flyout (class nopadding) draws a fixed 48 px tab strip background: gone with the strip. -->
+ <Style Selector="FlyoutPresenter.nopadding Border#TabBackgroundBorder">
+ <Setter Property="IsVisible" Value="False" />
+ </Style>
+ <Style Selector="FlyoutPresenter.nopadding Border#ContentBackgroundBorder">
+ <Setter Property="Margin" Value="0" />
+ </Style>
<StyleInclude Source="avares://Filee/Styles/Soft.axaml" />
<StyleInclude Source="avares://Filee/Styles/Controls.axaml" />
<StyleInclude Source="avares://Filee/Styles/TagEditor.axaml" />
diff --git a/src/Filee.App/Views/Pages/ThemePage.axaml b/src/Filee.App/Views/Pages/ThemePage.axaml
index cda938e4..9e54acae 100644
--- a/src/Filee.App/Views/Pages/ThemePage.axaml
+++ b/src/Filee.App/Views/Pages/ThemePage.axaml
@@ -64,12 +64,7 @@
MinHeight="44" MinWidth="90"
IsAlphaVisible="False" IsColorSpectrumVisible="True" IsColorPaletteVisible="False"
IsColorComponentsVisible="False" IsColorModelVisible="False" IsColorPreviewVisible="True"
- FlowDirection="LeftToRight" AutomationProperties.Name="{DynamicResource theme.custom_color}">
- <ColorPicker.Resources>
- <!-- There is only one panel: no empty tab header above the spectrum. -->
- <x:Double x:Key="ColorViewTabStripHeight">0</x:Double>
- </ColorPicker.Resources>
- </ColorPicker>
+ FlowDirection="LeftToRight" AutomationProperties.Name="{DynamicResource theme.custom_color}" />
<TextBox Text="{Binding AccentHex}" Width="120" PlaceholderText="#7F77DD" FlowDirection="LeftToRight"
AutomationProperties.Name="{DynamicResource theme.custom_color}" />
</StackPanel>
diff --git a/tests/Filee.App.Tests/ThemePageTests.cs b/tests/Filee.App.Tests/ThemePageTests.cs
index 562bf469..fb7a6a9d 100644
--- a/tests/Filee.App.Tests/ThemePageTests.cs
+++ b/tests/Filee.App.Tests/ThemePageTests.cs
@@ -66,6 +66,12 @@ public class ThemePageTests
Assert.Equal(vm.Accent, picker.Color);
Assert.Equal(vm.Accent, swatches.SelectedItem);
+ // A colour typed as #RRGGBB moves the picker too.
+ vm.AccentHex = "#2E8B57";
+ RenderTests.Pump();
+ Assert.Equal(Color.Parse("#2E8B57"), picker.Color);
+ Assert.Equal("#2E8B57", store.Settings.Theme.Accent);
+
// Open the actual flyout with the keyboard and capture the spectrum for visual review.
var button = picker.GetVisualDescendants().OfType<Button>().First();
Assert.True(button.Focus());