Skip to content

Commit 1c61298

Browse files
authored
[DevExpress] Add default text styling (#109)
1 parent 004fa40 commit 1c61298

File tree

9 files changed

+35
-17
lines changed

9 files changed

+35
-17
lines changed

samples/SampleApp/App.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
<Application.Styles>
66
<!-- <FluentTheme /> -->
7-
<StyleInclude Source="avares://Devolutions.AvaloniaTheme.MacOS/MacOSTheme.axaml" />
8-
<!-- <StyleInclude Source="avares://Devolutions.AvaloniaTheme.DevExpress/DevExpressTheme.axaml" /> -->
7+
<!-- <StyleInclude Source="avares://Devolutions.AvaloniaTheme.MacOS/MacOSTheme.axaml" /> -->
8+
<StyleInclude Source="avares://Devolutions.AvaloniaTheme.DevExpress/DevExpressTheme.axaml" />
99
<StyleInclude Source="/Styles.axaml" />
1010
</Application.Styles>
1111
</Application>

src/Devolutions.AvaloniaTheme.DevExpress/Accents/Styles.axaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
<Styles xmlns="https://github.com/avaloniaui"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
33

4-
<!-- FontFamily should be inherited from Window normally. Adding this for RDM where the views are embedded into the native app without a Window -->
5-
<Style Selector="TextBlock, AccessText">
6-
<Setter Property="FontFamily" Value="{StaticResource DevExpressThemeFontFamily}" />
7-
</Style>
8-
9-
<Style Selector="TextBlock">
10-
<Setter Property="FontSize" Value="12" />
11-
</Style>
12-
134
<Style Selector="TextBlock.SectionTitle">
145
<Setter Property="FontWeight" Value="Bold" />
156
<Setter Property="FontSize" Value="14" />
@@ -23,13 +14,11 @@
2314
</Style>
2415

2516
<Style Selector="AutoCompleteBox">
26-
<Setter Property="FontSize" Value="12" />
2717
<Setter Property="MinHeight" Value="1" />
2818
<Setter Property="Padding" Value="10 3" />
2919
</Style>
3020

3121
<Style Selector="AutoCompleteBox ListBoxItem">
32-
<Setter Property="FontSize" Value="12" />
3322
<Setter Property="MinHeight" Value="1" />
3423
<Setter Property="Height" Value="26" />
3524
<Setter Property="Padding" Value="10 2" />

src/Devolutions.AvaloniaTheme.DevExpress/Accents/ThemeResources.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<SolidColorBrush x:Key="TransparentBrush" Color="Transparent" />
4444

4545
<FontFamily x:Key="DevExpressThemeFontFamily">Segoe UI, Helvetica Neue, Arial, sans-serif</FontFamily>
46+
<x:Double x:Key="DefaultFontSize">12</x:Double>
4647
<x:Double x:Key="ControlFontSize">12</x:Double>
4748
<x:Double x:Key="PasswordHiddenFontSize">10</x:Double>
4849

src/Devolutions.AvaloniaTheme.DevExpress/Controls/Button.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<Setter Property="Padding" Value="5 0 5 0 " />
2828
<Setter Property="HorizontalContentAlignment" Value="Center" />
2929
<Setter Property="VerticalContentAlignment" Value="Center" />
30-
<Setter Property="FontSize" Value="12" />
30+
<Setter Property="FontSize" Value="{DynamicResource ControlFontSize}" />
3131
<Setter Property="FontWeight" Value="Light" />
3232
<Setter Property="Template">
3333
<ControlTemplate>

src/Devolutions.AvaloniaTheme.DevExpress/Controls/ComboBox.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<Setter Property="Padding" Value="{DynamicResource ComboBoxPadding}" />
3939
<Setter Property="FocusAdorner" Value="{x:Null}" />
4040
<Setter Property="MaxDropDownHeight" Value="504" />
41-
<Setter Property="FontSize" Value="12" />
41+
<Setter Property="FontSize" Value="{DynamicResource ControlFontSize}" />
4242
<Setter Property="Foreground" Value="{DynamicResource ForegroundHighBrush}" />
4343
<Setter Property="Background" Value="{DynamicResource TextBoxBackgroundBrush}" />
4444
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrush}" />

src/Devolutions.AvaloniaTheme.DevExpress/Controls/ComboBoxItem.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</Design.PreviewWith>
2626

2727
<ControlTheme x:Key="{x:Type ComboBoxItem}" TargetType="ComboBoxItem">
28-
<Setter Property="FontSize" Value="12" />
28+
<Setter Property="FontSize" Value="{DynamicResource ControlFontSize}" />
2929
<Setter Property="Foreground" Value="{DynamicResource ForegroundHighBrush}" />
3030
<Setter Property="Background" Value="{DynamicResource BackgroundColor}" />
3131
<Setter Property="Padding" Value="10 3 " />
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<ResourceDictionary xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3+
4+
<ControlTheme x:Key="{x:Type EmbeddableControlRoot}" TargetType="EmbeddableControlRoot">
5+
<Setter Property="Background" Value="{DynamicResource SystemRegionBrush}" />
6+
<Setter Property="TopLevel.SystemBarColor" Value="{DynamicResource SystemControlBackgroundAltHighBrush}" />
7+
<Setter Property="Foreground" Value="{DynamicResource ForegroundHighBrush}" />
8+
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
9+
<Setter Property="FontFamily" Value="{StaticResource DevExpressThemeFontFamily}" />
10+
<Setter Property="Template">
11+
<ControlTemplate>
12+
<Panel>
13+
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
14+
<Border Background="{TemplateBinding Background}">
15+
<VisualLayerManager>
16+
<ContentPresenter Name="PART_ContentPresenter"
17+
ContentTemplate="{TemplateBinding ContentTemplate}"
18+
Content="{TemplateBinding Content}"
19+
Margin="{TemplateBinding Padding}" />
20+
</VisualLayerManager>
21+
</Border>
22+
</Panel>
23+
</ControlTemplate>
24+
</Setter>
25+
</ControlTheme>
26+
</ResourceDictionary>

src/Devolutions.AvaloniaTheme.DevExpress/Controls/Window.axaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<Setter Property="Background" Value="{DynamicResource SystemRegionBrush}" />
66
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource SystemControlBackgroundAltHighBrush}" />
77
<Setter Property="TopLevel.SystemBarColor" Value="{DynamicResource SystemControlBackgroundAltHighBrush}" />
8-
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
8+
<Setter Property="Foreground" Value="{DynamicResource ForegroundHighBrush}" />
9+
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
910
<Setter Property="FontFamily" Value="{StaticResource DevExpressThemeFontFamily}" />
1011
<Setter Property="Template">
1112
<ControlTemplate>

src/Devolutions.AvaloniaTheme.DevExpress/Controls/_index.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<MergeResourceInclude Source="Button.axaml" />
66
<MergeResourceInclude Source="ComboBox.axaml" />
77
<MergeResourceInclude Source="ComboBoxItem.axaml" />
8+
<MergeResourceInclude Source="EmbeddableControlRoot.axaml" />
89
<MergeResourceInclude Source="TabControl.axaml" />
910
<MergeResourceInclude Source="TabItem.axaml" />
1011
<MergeResourceInclude Source="TextBox.axaml" />

0 commit comments

Comments
 (0)